You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-dev@jakarta.apache.org by vm...@apache.org on 2002/08/28 21:56:03 UTC

cvs commit: jakarta-cactus/framework/src/java/share/org/apache/cactus/util ClassLoaderUtils.java ChainedRuntimeException.java ChainedException.java

vmassol     2002/08/28 12:56:03

  Modified:    framework/src/java/share/org/apache/cactus/util
                        ClassLoaderUtils.java ChainedRuntimeException.java
                        ChainedException.java
  Log:
  new coding conventions
  
  Revision  Changes    Path
  1.3       +24 -21    jakarta-cactus/framework/src/java/share/org/apache/cactus/util/ClassLoaderUtils.java
  
  Index: ClassLoaderUtils.java
  ===================================================================
  RCS file: /home/cvs/jakarta-cactus/framework/src/java/share/org/apache/cactus/util/ClassLoaderUtils.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ClassLoaderUtils.java	12 May 2002 19:41:14 -0000	1.2
  +++ ClassLoaderUtils.java	28 Aug 2002 19:56:03 -0000	1.3
  @@ -56,10 +56,10 @@
    */
   package org.apache.cactus.util;
   
  -import java.util.ResourceBundle;
  -import java.util.PropertyResourceBundle;
  -import java.util.MissingResourceException;
   import java.util.Locale;
  +import java.util.MissingResourceException;
  +import java.util.PropertyResourceBundle;
  +import java.util.ResourceBundle;
   
   /**
    * Utiliy methods related to class loading in a webapp environment.
  @@ -88,11 +88,13 @@
           // Get the class to call and build an instance of it.
           Class clazz = null;
   
  -        try {
  +        try
  +        {
               // try loading from webapp classloader first
  -            clazz = loadClassFromWebappClassLoader(theClassName,
  -                theReferrer);
  -        } catch (Exception internalException) {
  +            clazz = loadClassFromWebappClassLoader(theClassName, theReferrer);
  +        }
  +        catch (Exception internalException)
  +        {
               // Then try first from Context class loader so that we can put the
               // Cactus jar as an external library.
               clazz = loadClassFromContextClassLoader(theClassName);
  @@ -112,7 +114,7 @@
       public static Class loadClassFromContextClassLoader(String theClassName)
           throws ClassNotFoundException
       {
  -        return Class.forName(theClassName, true,
  +        return Class.forName(theClassName, true, 
               Thread.currentThread().getContextClassLoader());
       }
   
  @@ -126,13 +128,12 @@
        * @exception ClassNotFoundException if the class cannot be loaded through
        *            this class loader
        */
  -    public static Class loadClassFromWebappClassLoader(
  -        String theClassName, Class theReferrer) throws ClassNotFoundException
  +    public static Class loadClassFromWebappClassLoader(String theClassName, 
  +        Class theReferrer) throws ClassNotFoundException
       {
           return Class.forName(theClassName, true, theReferrer.getClassLoader());
       }
   
  -
       /**
        * Try loading a resource bundle from either the context class loader or
        * the
  @@ -142,23 +143,25 @@
        *        classloader which has loaded this referrer class
        * @return the loaded resource bundle
        */
  -    public static ResourceBundle loadPropertyResourceBundle(
  -        String theName, Class theReferrer)
  +    public static ResourceBundle loadPropertyResourceBundle(String theName, 
  +        Class theReferrer)
       {
           ResourceBundle bundle;
   
  -        try {
  +        try
  +        {
               // Then, try to load from the referrer class loader first
  -            bundle = PropertyResourceBundle.getBundle(theName,
  +            bundle = PropertyResourceBundle.getBundle(theName, 
                   Locale.getDefault(), theReferrer.getClassLoader());
  -        } catch (MissingResourceException e) {
  +        }
  +        catch (MissingResourceException e)
  +        {
               // Then, try to load from context classloader
  -            bundle = PropertyResourceBundle.getBundle(theName,
  -                Locale.getDefault(),
  +            bundle = PropertyResourceBundle.getBundle(theName, 
  +                Locale.getDefault(), 
                   Thread.currentThread().getContextClassLoader());
           }
   
           return bundle;
       }
  -
  -}
  +}
  \ No newline at end of file
  
  
  
  1.3       +7 -4      jakarta-cactus/framework/src/java/share/org/apache/cactus/util/ChainedRuntimeException.java
  
  Index: ChainedRuntimeException.java
  ===================================================================
  RCS file: /home/cvs/jakarta-cactus/framework/src/java/share/org/apache/cactus/util/ChainedRuntimeException.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ChainedRuntimeException.java	1 May 2002 19:52:27 -0000	1.2
  +++ ChainedRuntimeException.java	28 Aug 2002 19:56:03 -0000	1.3
  @@ -128,7 +128,9 @@
       public void printStackTrace(PrintStream thePs)
       {
           super.printStackTrace(thePs);
  -        if (this.originalException != null) {
  +
  +        if (this.originalException != null)
  +        {
               this.originalException.printStackTrace(thePs);
           }
       }
  @@ -141,9 +143,10 @@
       public void printStackTrace(PrintWriter thePw)
       {
           super.printStackTrace(thePw);
  -        if (this.originalException != null) {
  +
  +        if (this.originalException != null)
  +        {
               this.originalException.printStackTrace(thePw);
           }
       }
  -
   }
  
  
  
  1.2       +7 -4      jakarta-cactus/framework/src/java/share/org/apache/cactus/util/ChainedException.java
  
  Index: ChainedException.java
  ===================================================================
  RCS file: /home/cvs/jakarta-cactus/framework/src/java/share/org/apache/cactus/util/ChainedException.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ChainedException.java	1 May 2002 19:52:27 -0000	1.1
  +++ ChainedException.java	28 Aug 2002 19:56:03 -0000	1.2
  @@ -126,7 +126,9 @@
       public void printStackTrace(PrintStream thePs)
       {
           super.printStackTrace(thePs);
  -        if (this.originalException != null) {
  +
  +        if (this.originalException != null)
  +        {
               this.originalException.printStackTrace(thePs);
           }
       }
  @@ -139,9 +141,10 @@
       public void printStackTrace(PrintWriter thePw)
       {
           super.printStackTrace(thePw);
  -        if (this.originalException != null) {
  +
  +        if (this.originalException != null)
  +        {
               this.originalException.printStackTrace(thePw);
           }
       }
  -
   }
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>