tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From billbar...@apache.org
Subject cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/compat JdkCompat.java
Date Wed, 05 Feb 2003 03:47:13 GMT
billbarker    2003/02/04 19:47:13

  Modified:    util/java/org/apache/tomcat/util/compat JdkCompat.java
  Log:
  Fix cut-and-paste from too many files errors :)
  
  Submitted by: Tim Funk funkman@joedog.org
  
  Revision  Changes    Path
  1.3       +27 -32    jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/compat/JdkCompat.java
  
  Index: JdkCompat.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/compat/JdkCompat.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- JdkCompat.java	4 Feb 2003 07:16:47 -0000	1.2
  +++ JdkCompat.java	5 Feb 2003 03:47:12 -0000	1.3
  @@ -82,15 +82,14 @@
    *  @author Tim Funk
    */
   public class JdkCompat {
  -    // -------------------------------------------------------------- Constants
  -    public static final String JDK14_CLASS = "org.apache.catalina.util.Jdk14Compat";
   
       // ------------------------------------------------------- Static Variables
  +
       /**
  -     *  The static instance holder.
  +     * class providing java2 support
        */
  -    static JdkCompat jdkCompat;
  -
  +    static final String JAVA14_SUPPORT =
  +        "org.apache.tomcat.util.compat.Jdk14Compat";
       /**
        *  Commons logger wrapper
        */
  @@ -99,15 +98,15 @@
       /** Return java version as a string
        */
       public static String getJavaVersion() {
  -	return javaVersion;
  +        return javaVersion;
       }
   
       public static boolean isJava2() {
  -	return java2;
  +        return java2;
       } 
      
       public static boolean isJava14() {
  -	return java14;
  +        return java14;
       }
   
       // -------------------- Implementation --------------------
  @@ -122,43 +121,39 @@
       static String javaVersion;
       static boolean java2=false;
       static boolean java14=false;
  -    static JdkCompat compat;
  +    static JdkCompat jdkCompat;
       
       static {
  -	init();
  +        init();
       }
   
  -    // class providing java2 support
  -    static final String JAVA14_SUPPORT=
  -	"org.apache.tomcat.util.compat.Jdk14Compat";
  -
       private static void init() {
           try {
               javaVersion = JAVA_1_0;
               Class.forName("java.lang.Void");
               javaVersion = JAVA_1_1;
               Class.forName("java.lang.ThreadLocal");
  -	    java2=true;
  +            java2=true;
               javaVersion = JAVA_1_2;
               Class.forName("java.lang.StrictMath");
               javaVersion = JAVA_1_3;
  -	    Class.forName("java.lang.CharSequence");
  -	    javaVersion = JAVA_1_4;
  -	    java14=true;
  +            Class.forName("java.lang.CharSequence");
  +            javaVersion = JAVA_1_4;
  +            java14=true;
           } catch (ClassNotFoundException cnfe) {
               // swallow as we've hit the max class version that we have
           }
  -	if( java14 ) {
  -	    try {
  -		Class c=Class.forName(JAVA14_SUPPORT);
  -		compat=(JdkCompat)c.newInstance();
  -	    } catch( Exception ex ) {
  -		compat=new JdkCompat();
  -	    }
  -	} else {
  -	    compat=new JdkCompat();
  -	    // Install jar handler if none installed
  -	}
  +        if( java14 ) {
  +            try {
  +                Class c=Class.forName(JAVA14_SUPPORT);
  +                jdkCompat=(JdkCompat)c.newInstance();
  +            } catch( Exception ex ) {
  +                jdkCompat=new JdkCompat();
  +            }
  +        } else {
  +            jdkCompat=new JdkCompat();
  +            // Install jar handler if none installed
  +        }
       }
   
       // ----------------------------------------------------------- Constructors
  
  
  

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


Mime
View raw message