equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2003,2010, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2003,2012, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
724 // Private stuff.... |
724 // Private stuff.... |
725 |
725 |
726 private static final String PACK_PROVIDER = "java.util.jar.Pack200.Packer"; |
726 private static final String PACK_PROVIDER = "java.util.jar.Pack200.Packer"; |
727 private static final String UNPACK_PROVIDER = "java.util.jar.Pack200.Unpacker"; |
727 private static final String UNPACK_PROVIDER = "java.util.jar.Pack200.Unpacker"; |
728 |
728 |
729 private static Class packerImpl; |
729 private static Class<?> packerImpl; |
730 private static Class unpackerImpl; |
730 private static Class<?> unpackerImpl; |
731 |
731 |
732 private synchronized static Object newInstance(String prop) { |
732 private synchronized static Object newInstance(String prop) { |
733 String implName = "(unknown)"; |
733 String implName = "(unknown)"; |
734 try { |
734 try { |
735 Class impl = (PACK_PROVIDER.equals(prop))? packerImpl: unpackerImpl; |
735 Class<?> impl = (PACK_PROVIDER.equals(prop))? packerImpl: unpackerImpl; |
736 if (impl == null) { |
736 if (impl == null) { |
737 // The first time, we must decide which class to use. |
737 // The first time, we must decide which class to use. |
738 implName = java.security.AccessController.doPrivileged( |
738 implName = java.security.AccessController.doPrivileged( |
739 new sun.security.action.GetPropertyAction(prop,"")); |
739 new sun.security.action.GetPropertyAction(prop,"")); |
740 if (implName != null && !implName.equals("")) |
740 if (implName != null && !implName.equals("")) |