[Fedora-directory-commits] console/src/com/netscape/management/client/util LocalJarClassLoader.java, 1.1.1.1, 1.2

Nathan Kinder (nkinder) fedora-directory-commits at redhat.com
Wed Oct 26 23:16:36 UTC 2005


Author: nkinder

Update of /cvs/dirsec/console/src/com/netscape/management/client/util
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv26415/src/com/netscape/management/client/util

Modified Files:
	LocalJarClassLoader.java 
Log Message:
171830 - Change console version to 1.0


Index: LocalJarClassLoader.java
===================================================================
RCS file: /cvs/dirsec/console/src/com/netscape/management/client/util/LocalJarClassLoader.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- LocalJarClassLoader.java	18 Jul 2005 00:34:27 -0000	1.1.1.1
+++ LocalJarClassLoader.java	26 Oct 2005 23:16:29 -0000	1.2
@@ -45,14 +45,6 @@
 
     static final protected int JAR_FILE_INCLUDE_LIMIT = 100;
 
-    // Flag whether a jar is based on a console version prior to 5.0 (
-    // (4.0, 4.1 or 4.2). Denotes that a class needs swing package name
-    // conversion and compatibility adjustments
-    private boolean isPre50Jar; 
-    
-    // Compatibility jar to be used by all pre 5.0 jars
-    private static String console42Jar= "console42.jar";
-
     protected Vector jarNames = new Vector(); // A String Vector
 
     protected Vector jarFiles = new Vector(); // A ZipFile Vector
@@ -152,38 +144,13 @@
         //
         PropertyResourceBundle manifest = getManifest(filename);
         if (manifest == null) {
-            // Include console42.jar for pre 5.0 jars
-            isPre50Jar = true;
-            includeConsole42Jar(language);
+            if (Debug.isEnabled()) {
+                Debug.println(3, debugTag + "No manifest file for " + filename);
+            }
             return;
         }
         
-        // Step 4. Set isPre50Jar flag
-        //
-        String mccVersion = manifest.getString("mcc-version");
-        
-        if (mccVersion == null) {
-            // 5.0+ manifests must have mcc-version directive
-            isPre50Jar = true;
-            if (Debug.isEnabled()) {
-                Debug.println(2, debugTag + "Bad manifest, no mcc-version directive");
-            }                
-
-        }
-        else {
-            // Only 4.x jars needs swing package name conversion
-            isPre50Jar = mccVersion.startsWith("4");
-        }
-        if (Debug.isEnabled()) {
-            Debug.println(5, debugTag +"isPre50Jar=" + isPre50Jar);
-        }
-
-        // Include console42.jar for pre 5.0 jars
-        if (isPre50Jar) {
-            includeConsole42Jar(language);
-        }
-
-        // Step 5. Include jars specified in the manifest
+        // Step 4. Include jars specified in the manifest
         //
         String[] list = getManifestJarList(manifest);
         for (int i = 0 ; i < list.length; i++) {
@@ -220,33 +187,6 @@
         }        
     }
 
-    /**
-     * Backward compatibility jar console42.jar is automatically added to all
-     * server jars prior to console 5.0
-     */
-    private void includeConsole42Jar(String language) throws Exception {
-        String path = patchDir + "/" + console42Jar;
-        if (!(new File(path)).exists()) {
-            return;
-        }
-        if (Debug.isEnabled()) {
-            Debug.println(2, debugTag + "include jar " + console42Jar);
-        }
-        jarNames.addElement(console42Jar);
-        jarFiles.addElement(new ZipFile(path));
-
-        String langFile = addL10Nsuffix(console42Jar, "en");
-        path = patchDir + "/" + langFile;
-        if (!(new File(path)).exists()) {
-            return;
-        }
-        if (Debug.isEnabled()) {
-            Debug.println(2, debugTag + "include jar " + langFile);
-        }
-        jarNames.addElement(langFile);
-        jarFiles.addElement(new ZipFile(path));
-    }        
-        
 
     /**
       * Processes the manifest PropertyResourceBundle and produces an array
@@ -508,31 +448,7 @@
                 BufferedInputStream zis =
                         new BufferedInputStream(f.getInputStream(e));
 
-                // Do swing package name conversion on the fly if necessary
-                if (isPre50Jar && path.endsWith(".class")) {
-                    try {
-                        if (Debug.isEnabled()) {
-                            Debug.println(6, debugTag + "converting " + path + " ...");
-                        }
-                        ByteArrayOutputStream bos = new ByteArrayOutputStream(512);
-                        SwingPackageNameConverter.convert(zis,bos);
-                        bos.close();
-                        if (Debug.isEnabled()) {
-                            Debug.println(6, debugTag + "---- Done");
-                        }
-                        return bos.toByteArray();
-                    }    
-                    catch (Exception ex) {
-                        Debug.println(0, debugTag + "Conversion Exception "+ ex);
-                        if (Debug.isEnabled()) {
-                            ex.printStackTrace(System.out);
-                        }                            
-                        throw ex;
-                    }
-
-                }
-                
-                // Read the content if no swing name conversion
+                // Read the content
                 int size = (int)(e.getSize());
                 int cnt = 0;
                 byte[] storage = new byte[size];




More information about the Fedora-directory-commits mailing list