[cvs] expresso commit by lhamel: remove redundant code in constructors by

JCorporate Ltd jcorp at jcorporate.com
Mon Nov 14 05:28:33 UTC 2005


Log Message:
-----------
remove redundant code in constructors by chaining

Modified Files:
--------------
    expresso/expresso-web/WEB-INF/src/com/jcorporate/expresso/services/dbobj:
        RowGroupPerms.java

Revision Data
-------------
Index: RowGroupPerms.java
===================================================================
RCS file: /home/javacorp/.cvs/expresso/expresso/expresso-web/WEB-INF/src/com/jcorporate/expresso/services/dbobj/RowGroupPerms.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -Lexpresso-web/WEB-INF/src/com/jcorporate/expresso/services/dbobj/RowGroupPerms.java -Lexpresso-web/WEB-INF/src/com/jcorporate/expresso/services/dbobj/RowGroupPerms.java -u -r1.14 -r1.15
--- expresso-web/WEB-INF/src/com/jcorporate/expresso/services/dbobj/RowGroupPerms.java
+++ expresso-web/WEB-INF/src/com/jcorporate/expresso/services/dbobj/RowGroupPerms.java
@@ -81,7 +81,6 @@
  * @see com.jcorporate.expresso.services.dbobj.RowPermissions
  */
 public class RowGroupPerms extends DBObject /* ironically, we do not subclass SecuredDBObject because anybody must be able to write their own permissions */ {
-
     public static final String GROUP_PERMISSIONS_TABLE_NAME = "ROW_GRP_PERMS";
     /**
      * field name for name of table
@@ -143,26 +142,12 @@
      * @param grp name of group
      */
     public RowGroupPerms(String table, String rowKey, String grp) throws DBException {
-        // test for key length being too large
-        if (rowKey == null) {
-            throw new DBException("null row key");
-        }
-        if (table == null) {
-            throw new DBException("null table name");
-        }
+        this(table, rowKey);
 
         if (grp == null) {
             throw new DBException("null grp name");
         }
 
-        if ((rowKey.length() + table.length() + grp.length()) > RowPermissions.sMaxKeyLen) {
-            throw new DBException("Cannot create row permissions for table: "
-                    + this.getJDBCMetaData().getTargetTable() + " row: " + rowKey
-                    + " because table name + row's ID (PK) exceeds maximum of " + RowPermissions.sMaxKeyLen);
-        }
-
-        setField(TABLE_NAME, table);
-        setField(ROW_KEY, rowKey);
         setField(GROUP, grp);
     }
 


More information about the cvs mailing list