commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jke...@apache.org
Subject cvs commit: jakarta-commons/cli/src/java/org/apache/commons/cli2/validation messages.properties ClassValidator.java
Date Tue, 30 Mar 2004 23:48:04 GMT
jkeyes      2004/03/30 15:48:04

  Modified:    cli/src/java/org/apache/commons/cli2/validation Tag:
                        RESEARCH_CLI_2_ROXSPRING messages.properties
                        ClassValidator.java
  Log:
  - renamed xxxLoader methods to xxxClassLoader
  - changed getClassLoader to return the validators class loader by default
  - fixed exception message
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.1.2.2   +1 -1      jakarta-commons/cli/src/java/org/apache/commons/cli2/validation/Attic/messages.properties
  
  Index: messages.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/cli/src/java/org/apache/commons/cli2/validation/Attic/messages.properties,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- messages.properties	23 Jan 2004 00:17:34 -0000	1.1.2.1
  +++ messages.properties	30 Mar 2004 23:48:04 -0000	1.1.2.2
  @@ -1,4 +1,4 @@
   ClassValidator.error.bad.classname = The class name "{0}" is invalid.
   ClassValidator.error.class.notfound = The class "{0}" could not be found.
   ClassValidator.error.class.access = The class "{0}" could not be accessed.  Reason: {1}.
  -ClassValidator.error.class.create = The class "{0}" could not be created.  Reason: {1}.
  +ClassValidator.error.class.create = The class "{0}" could not be created.
  
  
  
  1.1.2.5   +9 -8      jakarta-commons/cli/src/java/org/apache/commons/cli2/validation/Attic/ClassValidator.java
  
  Index: ClassValidator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/cli/src/java/org/apache/commons/cli2/validation/Attic/ClassValidator.java,v
  retrieving revision 1.1.2.4
  retrieving revision 1.1.2.5
  diff -u -r1.1.2.4 -r1.1.2.5
  --- ClassValidator.java	8 Feb 2004 13:09:00 -0000	1.1.2.4
  +++ ClassValidator.java	30 Mar 2004 23:48:04 -0000	1.1.2.5
  @@ -47,9 +47,7 @@
               }
   
               if (loadable || instance) {
  -                if (loader == null) {
  -                    loader = getClass().getClassLoader();
  -                }
  +                final ClassLoader loader = getClassLoader();
                   try {
                       final Class clazz = loader.loadClass(name);
                       if (instance) {
  @@ -75,9 +73,8 @@
                   catch (final InstantiationException exp) {
                       throw new InvalidArgumentException(
                           resources.getMessage(
  -                            "ClassValidator.error.class.access",
  -                            name,
  -                            exp.getMessage()));
  +                            "ClassValidator.error.class.create",
  +                            name));
                   }
               }
           }
  @@ -118,11 +115,15 @@
           this.loadable = loadable;
       }
   
  -    public ClassLoader getLoader() {
  +    public ClassLoader getClassLoader() {
  +        if (loader == null) {
  +            loader = getClass().getClassLoader();
  +        }
  +        
           return loader;
       }
   
  -    public void setLoader(ClassLoader loader) {
  +    public void setClassLoader(ClassLoader loader) {
           this.loader = loader;
       }
   
  
  
  

---------------------------------------------------------------------
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