# HG changeset patch # User bchristi # Date 1434044309 25200 # Node ID 9bde92d55eaec11ee1db2e481b7f6392a4377f00 # Parent 0acb07ceb0bc68401e18f987baf08bdbc0c311d1 8064956: Remove sun.misc.ExtensionInstallationProvider and relevant classes Reviewed-by: mchung, alanb diff -r 0acb07ceb0bc -r 9bde92d55eae jdk/src/java.base/share/classes/sun/misc/ExtensionDependency.java --- a/jdk/src/java.base/share/classes/sun/misc/ExtensionDependency.java Thu Jun 11 17:29:09 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,554 +0,0 @@ -/* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.misc; - -import java.io.File; -import java.io.FilenameFilter; -import java.io.IOException; -import java.io.FileNotFoundException; -import java.util.StringTokenizer; -import java.util.Vector; -import java.util.Enumeration; -import java.util.jar.JarFile; -import java.util.jar.Manifest; -import java.util.jar.Attributes; -import java.util.jar.Attributes.Name; -import java.security.AccessController; -import java.security.PrivilegedAction; -import java.security.PrivilegedExceptionAction; -import java.security.PrivilegedActionException; -import java.net.URL; -import java.net.MalformedURLException; -import sun.net.www.ParseUtil; - -/** - * This class checks dependent extensions a particular jar file may have - * declared through its manifest attributes. - *
- * Jar file declared dependent extensions through the extension-list - * attribute. The extension-list contains a list of keys used to - * fetch the other attributes describing the required extension. - * If key is the extension key declared in the extension-list - * attribute, the following describing attribute can be found in - * the manifest: - *
- * This class also maintain versioning consistency of installed
- * extensions dependencies declared in jar file manifest.
- *
- * @deprecated this class will be removed in a future release.
- * @author Jerome Dochez
- */
-@Deprecated
-public class ExtensionDependency {
-
- /* Callbak interfaces to delegate installation of missing extensions */
- private static Vector
- * Construct a new exception with an exception reason
- *
- * Request the installation of an extension in the extension directory
- * {@code
- * < 0 if source < version
- * > 0 if source > version
- * = 0 if source = version}
- */
- private int strictCompareExtensionVersion(String source, String target)
- throws NumberFormatException
- {
- if (source.equals(target))
- return 0;
-
- StringTokenizer stk = new StringTokenizer(source, ".,");
- StringTokenizer ttk = new StringTokenizer(target, ".,");
-
- // Compare number
- int n = 0, m = 0, result = 0;
-
- // Convert token into meaning number for comparision
- if (stk.hasMoreTokens())
- n = convertToken(stk.nextToken().toString());
-
- // Convert token into meaning number for comparision
- if (ttk.hasMoreTokens())
- m = convertToken(ttk.nextToken().toString());
-
- if (n > m)
- return 1;
- else if (m > n)
- return -1;
- else
- {
- // Look for index of "." in the string
- int sIdx = source.indexOf('.');
- int tIdx = target.indexOf('.');
-
- if (sIdx == -1)
- sIdx = source.length() - 1;
-
- if (tIdx == -1)
- tIdx = target.length() - 1;
-
- return strictCompareExtensionVersion(source.substring(sIdx + 1),
- target.substring(tIdx + 1));
- }
- }
-
- private int convertToken(String token)
- {
- if (token == null || token.equals(""))
- return 0;
-
- int charValue = 0;
- int charVersion = 0;
- int patchVersion = 0;
- int strLength = token.length();
- int endIndex = strLength;
- char lastChar;
-
- Object[] args = {name};
- MessageFormat mf = new MessageFormat(rb.getString("optpkg.versionerror"));
- String versionError = mf.format(args);
-
- // Look for "-" for pre-release
- int prIndex = token.indexOf('-');
-
- // Look for "_" for patch release
- int patchIndex = token.indexOf('_');
-
- if (prIndex == -1 && patchIndex == -1)
- {
- // This is a FCS release
- try {
- return Integer.parseInt(token) * 100;
- } catch (NumberFormatException e) {
- System.out.println(versionError);
- return 0;
- }
- }
- else if (patchIndex != -1)
- {
- // This is a patch (update) release
- int prversion;
- try {
- // Obtain the version
- prversion = Integer.parseInt(token.substring(0, patchIndex));
-
- // Check to see if the patch version is in the n.n.n_nnl format (special release)
- lastChar = token.charAt(strLength-1);
- if (Character.isLetter(lastChar)) {
- // letters a-z have values from 10-35
- charValue = Character.getNumericValue(lastChar);
- endIndex = strLength-1;
-
- // Obtain the patch version id
- patchVersion = Integer.parseInt(token.substring(patchIndex+1, endIndex));
-
- if (charValue >= Character.getNumericValue('a') && charValue <= Character.getNumericValue('z')) {
- // This is a special release
- charVersion = (patchVersion * 100) + charValue;
- } else {
- // character is not a a-z letter, ignore
- charVersion = 0;
- System.out.println(versionError);
- }
- } else {
- // This is a regular update release. Obtain the patch version id
- patchVersion = Integer.parseInt(token.substring(patchIndex+1, endIndex));
- }
- } catch (NumberFormatException e) {
- System.out.println(versionError);
- return 0;
- }
- return prversion * 100 + (patchVersion + charVersion);
- }
- else
- {
- //This is a milestone release, either a early access, alpha, beta, or RC
-
- // Obtain the version
- int mrversion;
- try {
- mrversion = Integer.parseInt(token.substring(0, prIndex));
- } catch (NumberFormatException e) {
- System.out.println(versionError);
- return 0;
- }
-
- // Obtain the patch version string, including the milestone + version
- String prString = token.substring(prIndex + 1);
-
- // Milestone version
- String msVersion = "";
- int delta = 0;
-
- if (prString.indexOf("ea") != -1)
- {
- msVersion = prString.substring(2);
- delta = 50;
- }
- else if (prString.indexOf("alpha") != -1)
- {
- msVersion = prString.substring(5);
- delta = 40;
- }
- else if (prString.indexOf("beta") != -1)
- {
- msVersion = prString.substring(4);
- delta = 30;
- }
- else if (prString.indexOf("rc") != -1)
- {
- msVersion = prString.substring(2);
- delta = 20;
- }
-
- if (msVersion == null || msVersion.equals(""))
- {
- // No version after the milestone, assume 0
- return mrversion * 100 - delta ;
- }
- else
- {
- // Convert the milestone version
- try {
- return mrversion * 100 - delta + Integer.parseInt(msVersion);
- } catch (NumberFormatException e) {
- System.out.println(versionError);
- return 0;
- }
- }
- }
- }
-}
diff -r 0acb07ceb0bc -r 9bde92d55eae jdk/src/java.base/share/classes/sun/misc/ExtensionInstallationException.java
--- a/jdk/src/java.base/share/classes/sun/misc/ExtensionInstallationException.java Thu Jun 11 17:29:09 2015 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.misc;
-
-/*
- * Exception when installation of an extension has failed for
- * any reason
- *
- * @deprecated this class will be removed in a future release.
- * @author Jerome Dochez
- */
-@Deprecated
-public class ExtensionInstallationException extends Exception {
-
- static final long serialVersionUID = 3139688306909345924L;
-
- /*
- *