changeset 7158:48dc2b5d484f

Merge
author asaha
date Tue, 11 Mar 2014 14:21:45 -0700
parents fe7a36f9c888 51ff2df66fd5
children f7340a27b42c 774d237e97c4
files .hgtags
diffstat 2 files changed, 15 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Tue Mar 11 13:39:59 2014 -0700
+++ b/.hgtags	Tue Mar 11 14:21:45 2014 -0700
@@ -397,6 +397,7 @@
 d39dd4135844ca5c707bc39ae1d7e020d49880ce jdk7u55-b09
 b231536550067c3b00c77d0e035afe8faaa15581 jdk7u55-b10
 2d80b7cd7aae76f0909a210414317dcf846ad651 jdk7u55-b11
+07be5d5508733ed37c11fcd21a13ae3c8288313b jdk7u55-b12
 db5a29c812ee25c34ce9cd97de6e0dae284a4e34 jdk7u60-b00
 def34c4a798678c424786a8f0d0508e90185958d jdk7u60-b01
 ff67c89658525e8903fb870861ed3645befd6bc5 jdk7u60-b02
--- a/src/share/classes/javax/script/ScriptEngineManager.java	Tue Mar 11 13:39:59 2014 -0700
+++ b/src/share/classes/javax/script/ScriptEngineManager.java	Tue Mar 11 14:21:45 2014 -0700
@@ -85,15 +85,18 @@
         nameAssociations = new HashMap<String, ScriptEngineFactory>();
         extensionAssociations = new HashMap<String, ScriptEngineFactory>();
         mimeTypeAssociations = new HashMap<String, ScriptEngineFactory>();
-        AccessController.doPrivileged(new PrivilegedAction<Object>() {
-            public Object run() {
-                initEngines(loader);
-                return null;
-            }
-        });
+        List<ScriptEngineFactory> facList = AccessController.doPrivileged(
+            new PrivilegedAction<List<ScriptEngineFactory>>() {
+                public List<ScriptEngineFactory> run() {
+                    return initEngines(loader);
+                }
+            });
+        for (ScriptEngineFactory fac : facList) {
+            engineSpis.add(fac);
+        }
     }
 
-    private void initEngines(final ClassLoader loader) {
+    private List<ScriptEngineFactory> initEngines(final ClassLoader loader) {
         Iterator itr = null;
         try {
             if (loader != null) {
@@ -110,14 +113,15 @@
             // do not throw any exception here. user may want to
             // manage his/her own factories using this manager
             // by explicit registratation (by registerXXX) methods.
-            return;
+            return null;
         }
 
+        final List<ScriptEngineFactory> facList = new ArrayList<>();
         try {
             while (itr.hasNext()) {
                 try {
                     ScriptEngineFactory fact = (ScriptEngineFactory) itr.next();
-                    engineSpis.add(fact);
+                    facList.add(fact);
                 } catch (ServiceConfigurationError err) {
                     System.err.println("ScriptEngineManager providers.next(): "
                                  + err.getMessage());
@@ -137,8 +141,8 @@
             // do not throw any exception here. user may want to
             // manage his/her own factories using this manager
             // by explicit registratation (by registerXXX) methods.
-            return;
         }
+        return facList;
     }
 
     /**