commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dgra...@apache.org
Subject cvs commit: jakarta-commons/validator/src/share/org/apache/commons/validator Var.java
Date Sat, 24 May 2003 18:27:51 GMT
dgraham     2003/05/24 11:27:51

  Modified:    validator/src/share/org/apache/commons/validator Var.java
  Log:
  Simplified clone().
  
  Revision  Changes    Path
  1.6       +11 -24    jakarta-commons/validator/src/share/org/apache/commons/validator/Var.java
  
  Index: Var.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/validator/src/share/org/apache/commons/validator/Var.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Var.java	22 May 2003 03:28:05 -0000	1.5
  +++ Var.java	24 May 2003 18:27:50 -0000	1.6
  @@ -79,19 +79,19 @@
        * Int Constant for JavaScript type.  This can be used 
        * when auto-generating JavaScript.
        */
  -    public final static String JSTYPE_INT = "int";
  +    public static final String JSTYPE_INT = "int";
   
       /**
        * String Constant for JavaScript type.  This can be used 
        * when auto-generating JavaScript.
        */
  -    public final static String JSTYPE_STRING = "string";
  +    public static final String JSTYPE_STRING = "string";
   
       /**
        * Regular Expression Constant for JavaScript type.  This can be used 
        * when auto-generating JavaScript.
        */
  -    public final static String JSTYPE_REGEXP = "regexp";
  +    public static final String JSTYPE_REGEXP = "regexp";
       
       /**
        * The name of the variable.
  @@ -122,7 +122,7 @@
        * Gets the name of the variable.
        */
       public String getName() {
  -       return name;	
  +       return this.name;	
       }
   
       /**
  @@ -136,7 +136,7 @@
        * Gets the value of the variable.
        */
       public String getValue() {
  -       return value;	
  +       return this.value;	
       }
   
       /**
  @@ -150,7 +150,7 @@
        * Gets the JavaScript type of the variable.
        */
       public String getJsType() {
  -       return jsType;	
  +       return this.jsType;	
       }
   
       /**
  @@ -165,21 +165,8 @@
        */
       public Object clone() {
          try {
  -           Var var = (Var)super.clone();
  +           return super.clone();
              
  -           if (name != null) {
  -              var.setName(new String(name));
  -           }
  -           
  -           if (value != null) {
  -              var.setValue(new String(value));
  -           }
  -           
  -           if (jsType != null) {
  -              var.setJsType(new String(jsType));
  -           }
  -           
  -           return var;
          } catch (CloneNotSupportedException e) {
             throw new InternalError(e.toString());
          }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message