Index: /Users/alex/Documents/Harmony/Workspace/Pack200/src/main/java/java/util/jar/Pack200.java =================================================================== --- /Users/alex/Documents/Harmony/Workspace/Pack200/src/main/java/java/util/jar/Pack200.java (revision 467155) +++ /Users/alex/Documents/Harmony/Workspace/Pack200/src/main/java/java/util/jar/Pack200.java (working copy) @@ -44,26 +44,23 @@ * @return a instance of Packer */ public static Pack200.Packer newPacker() { - Packer packer = (Packer) AccessController + return (Packer) AccessController .doPrivileged(new PrivilegedAction() { public Object run() { String className = System - .getProperty(SYSTEM_PROPERTY_PACKER); - if (null != className) { - try { - return ClassLoader.getSystemClassLoader() - .loadClass(className); - } catch (ClassNotFoundException e) { - throw new Error(); - } + .getProperty(SYSTEM_PROPERTY_PACKER, + "org.apache.harmony.archive.internal.pack200.Pack200PackerAdapter"); //$NON-NLS-1$ + try { + // TODO Not sure if this will cause problems with + // loading the packer + return ClassLoader.getSystemClassLoader() + .loadClass(className).newInstance(); + } catch (Exception e) { + throw new Error("Can't load class " + className, e); } - return null; } }); - if (null != packer) { - return packer; - } - return PackFactory.newPacker(); + } /** @@ -74,26 +71,20 @@ * @return a instance of Unpacker */ public static Pack200.Unpacker newUnpacker() { - Unpacker unpacker = (Unpacker) AccessController + return (Unpacker) AccessController .doPrivileged(new PrivilegedAction() { public Object run() { String className = System - .getProperty(SYSTEM_PROPERTY_UNPACKER); - if (null != className) { - try { - return ClassLoader.getSystemClassLoader() - .loadClass(className); - } catch (ClassNotFoundException e) { - throw new Error(); - } + .getProperty(SYSTEM_PROPERTY_UNPACKER, + "org.apache.harmony.archive.internal.pack200.Pack200UnpackerAdapter");//$NON-NLS-1$ + try { + return ClassLoader.getSystemClassLoader() + .loadClass(className).newInstance(); + } catch (Exception e) { + throw new Error("Can't load class " + className, e); } - return null; } }); - if (null != unpacker) { - return unpacker; - } - return PackFactory.newUnpacker(); } /** Index: /Users/alex/Documents/Harmony/Workspace/Pack200/src/main/java/java/util/jar/PackFactory.java =================================================================== --- /Users/alex/Documents/Harmony/Workspace/Pack200/src/main/java/java/util/jar/PackFactory.java (revision 467155) +++ /Users/alex/Documents/Harmony/Workspace/Pack200/src/main/java/java/util/jar/PackFactory.java (working copy) @@ -1,30 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package java.util.jar; - -class PackFactory { - static Pack200.Packer newPacker() { - // TODO implement - return null; - } - - static Pack200.Unpacker newUnpacker() { - // TODO implement - return null; - } -} \ No newline at end of file