src/share/jaxws_classes/com/sun/tools/internal/xjc/ClassLoaderBuilder.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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

@@ -34,11 +34,10 @@
 
 import javax.xml.bind.JAXBContext;
 
 import com.sun.istack.internal.tools.MaskingClassLoader;
 import com.sun.istack.internal.tools.ParallelWorldClassLoader;
-import com.sun.tools.internal.xjc.SecureLoader;
 
 /**
  * Creates a class loader configured to run XJC 1.0/2.0 safely without
  * interference with JAXB 2.0 API in Mustang.
  *

@@ -60,11 +59,11 @@
 
         if (SecureLoader.getClassClassLoader(JAXBContext.class) == null) {
             // JAXB API is loaded from the bootstrap. We need to override one with ours
             mustang = true;
 
-            List mask = new ArrayList(Arrays.asList(maskedPackages));
+            List<String> mask = new ArrayList<String>(Arrays.asList(maskedPackages));
             mask.add("javax.xml.bind.");
 
             cl = new MaskingClassLoader(cl,mask);
 
             URL apiUrl = cl.getResource("javax/xml/bind/JAXBPermission.class");

@@ -78,11 +77,11 @@
         // and then isolate XJC1 in a child class loader,
         // then use a MaskingClassLoader
         // so that the XJC2 classes in the parent class loader
         //  won't interfere with loading XJC1 classes in a child class loader
 
-        if (v.equals("1.0")) {
+        if ("1.0".equals(v)) {
             if(!mustang)
                 // if we haven't used Masking ClassLoader, do so now.
                 cl = new MaskingClassLoader(cl,toolPackages);
             cl = new ParallelWorldClassLoader(cl,"1.0/");
         } else {