jdk/src/java.base/share/classes/sun/security/jca/ProviderList.java
changeset 31270 e6470b24700d
parent 30374 2abaf49910ea
child 32649 2ee9017c7597
equal deleted inserted replaced
31269:14968253ce7e 31270:e6470b24700d
     1 /*
     1 /*
     2  * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2003, 2015, 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
   176             int k = entry.indexOf(' ');
   176             int k = entry.indexOf(' ');
   177             ProviderConfig config;
   177             ProviderConfig config;
   178             if (k == -1) {
   178             if (k == -1) {
   179                 config = new ProviderConfig(entry);
   179                 config = new ProviderConfig(entry);
   180             } else {
   180             } else {
   181                 String className = entry.substring(0, k);
   181                 String provName = entry.substring(0, k);
   182                 String argument = entry.substring(k + 1).trim();
   182                 String argument = entry.substring(k + 1).trim();
   183                 config = new ProviderConfig(className, argument);
   183                 config = new ProviderConfig(provName, argument);
   184             }
   184             }
   185 
   185 
   186             // Get rid of duplicate providers.
   186             // Get rid of duplicate providers.
   187             if (configList.contains(config) == false) {
   187             if (configList.contains(config) == false) {
   188                 configList.add(config);
   188                 configList.add(config);
   198      * Construct a special ProviderList for JAR verification. It consists
   198      * Construct a special ProviderList for JAR verification. It consists
   199      * of the providers specified via jarClassNames, which must be on the
   199      * of the providers specified via jarClassNames, which must be on the
   200      * bootclasspath and cannot be in signed JAR files. This is to avoid
   200      * bootclasspath and cannot be in signed JAR files. This is to avoid
   201      * possible recursion and deadlock during verification.
   201      * possible recursion and deadlock during verification.
   202      */
   202      */
   203     ProviderList getJarList(String[] jarClassNames) {
   203     ProviderList getJarList(String[] jarProvNames) {
   204         List<ProviderConfig> newConfigs = new ArrayList<>();
   204         List<ProviderConfig> newConfigs = new ArrayList<>();
   205         for (String className : jarClassNames) {
   205         for (String provName : jarProvNames) {
   206             ProviderConfig newConfig = new ProviderConfig(className);
   206             ProviderConfig newConfig = new ProviderConfig(provName);
   207             for (ProviderConfig config : configs) {
   207             for (ProviderConfig config : configs) {
   208                 // if the equivalent object is present in this provider list,
   208                 // if the equivalent object is present in this provider list,
   209                 // use the old object rather than the new object.
   209                 // use the old object rather than the new object.
   210                 // this ensures that when the provider is loaded in the
   210                 // this ensures that when the provider is loaded in the
   211                 // new thread local list, it will also become available
   211                 // new thread local list, it will also become available