You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-commits@axis.apache.org by ve...@apache.org on 2017/07/01 18:31:50 UTC

svn commit: r1800521 [3/4] - in /axis/axis2/java/core/branches/hermetic-tests: ./ apidocs/ databinding-tests/jaxbri-tests/ etc/ modules/adb-codegen/ modules/adb-codegen/src/org/apache/axis2/schema/template/ modules/adb-codegen/test-resources/testsuite/...

Modified: axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/deployment/DeploymentClassLoader.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/deployment/DeploymentClassLoader.java?rev=1800521&r1=1800520&r2=1800521&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/deployment/DeploymentClassLoader.java (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/deployment/DeploymentClassLoader.java Sat Jul  1 18:31:49 2017
@@ -21,241 +21,30 @@ package org.apache.axis2.deployment;
 
 import org.apache.axis2.classloader.BeanInfoCache;
 import org.apache.axis2.classloader.BeanInfoCachingClassLoader;
-import org.apache.commons.io.IOUtils;
 
-import java.io.ByteArrayInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.URL;
 import java.net.URLClassLoader;
-import java.net.URLConnection;
-import java.net.URLStreamHandler;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.List;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipInputStream;
 
 public class DeploymentClassLoader extends URLClassLoader implements BeanInfoCachingClassLoader {
-    // List of URL's
-    private URL[] urls = null;
-
-    // List of jar files inside the jars in the original url
-    private List embedded_jars;
-
     private boolean isChildFirstClassLoading;
 
     private final BeanInfoCache beanInfoCache = new BeanInfoCache();
     
     /**
-     * DeploymentClassLoader is extended from URLClassLoader. The constructor
-     * does not override the super constructor, but takes in an addition list of
-     * jar files inside /lib directory.
+     * Constructor.
      *
      * @param urls   <code>URL</code>s
      * @param parent parent classloader <code>ClassLoader</code>
      */
     public DeploymentClassLoader(URL[] urls,
-                                 List embedded_jars,
                                  ClassLoader parent,
                                  boolean isChildFirstClassLoading) {
         super(urls, parent);
-        this.urls = urls;
-        this.embedded_jars = embedded_jars;
         this.isChildFirstClassLoading = isChildFirstClassLoading;
     }
 
-    /**
-     * Finds and loads the class with the specified name from the URL search
-     * path. Any URLs referring to JAR files are loaded and opened as needed
-     * until the class is found.
-     *
-     * @param name the name of the class
-     * @return the resulting class
-     * @exception ClassNotFoundException if the class could not be found
-     */
-    protected Class findClass(String name) throws ClassNotFoundException {
-        Class clazz;
-        try {
-            clazz = super.findClass(name);
-        } catch (ClassNotFoundException e) {
-            byte raw[] = null;
-            try {
-                String completeFileName = name;
-                /**
-                 * Replacing org.apache. -> org/apache/...
-                 */
-                completeFileName = completeFileName.replace('.', '/').concat(".class");
-                raw = getBytes(completeFileName);
-            } catch (Exception ex) {
-                // Fall through
-            }
-            if (raw == null) {
-                throw new ClassNotFoundException("Class Not found : " + name);
-            }
-            clazz = defineClass(name, raw, 0, raw.length);
-        }
-        return clazz;
-    }
-
-
-    /**
-     * Finds the resource with the specified name on the URL search path.
-     *
-     * @param resource the name of the resource
-     * @return a <code>URL</code> for the resource, or <code>null</code>
-     * if the resource could not be found.
-     */
-    public URL findResource(String resource) {
-        URL url = super.findResource(resource);
-        if (url == null) {
-            for (int i = 0; embedded_jars != null && i < embedded_jars.size(); i++) {
-                String libjar_name = (String) embedded_jars.get(i);
-                try {
-                    InputStream in = getJarAsStream(libjar_name);
-                    ZipInputStream zin = new ZipInputStream(in);
-                    ZipEntry entry;
-                    String entryName;
-                    while ((entry = zin.getNextEntry()) != null) {
-                        entryName = entry.getName();
-                        if (entryName != null &&
-                                entryName.endsWith(resource)) {
-                            byte[] raw = IOUtils.toByteArray(zin);
-                            return new URL("jar", "", -1, urls[0] + "!/" + libjar_name + "!/" + entryName,
-                                    new ByteUrlStreamHandler(raw));
-                        }
-                    }
-                } catch (Exception e) {
-                    throw new RuntimeException(e);
-                }
-            }
-        }
-        return url;
-    }
-
-    /**
-     * Returns an Enumeration of URLs representing all of the resources
-     * on the URL search path having the specified name.
-     *
-     * @param resource the resource name
-     * @exception IOException if an I/O exception occurs
-     * @return an <code>Enumeration</code> of <code>URL</code>s
-     */
-    public Enumeration findResources(String resource) throws IOException {
-        ArrayList resources = new ArrayList();
-        Enumeration e = super.findResources(resource);
-        while (e.hasMoreElements()) {
-            resources.add(e.nextElement());
-        }
-        for (int i = 0; embedded_jars != null && i < embedded_jars.size(); i++) {
-            String libjar_name = (String) embedded_jars.get(i);
-            try {
-            InputStream in = getJarAsStream(libjar_name);
-            ZipInputStream zin = new ZipInputStream(in);
-            ZipEntry entry;
-            String entryName;
-                while ((entry = zin.getNextEntry()) != null) {
-                    entryName = entry.getName();
-                    if (entryName != null &&
-                            entryName.endsWith(resource)) {
-                        byte[] raw = IOUtils.toByteArray(zin);
-                        resources.add(new URL("jar", "", -1, urls[0] + "!/" + libjar_name + "!/" + entryName,
-                                new ByteUrlStreamHandler(raw)));
-                    }
-                }
-            } catch (Exception ex) {
-                throw new RuntimeException(ex);
-            }
-        }
-        return Collections.enumeration(resources);
-    }
-
-    /**
-     * Access the jars file (/lib) one by one , then for each one create a <code>ZipInputStream</code>
-     * and check to see whether there is any entry eith given name. if it is found then
-     * return the byte array for that
-     *
-     * @param resource <code>String</code>  Name of the file to be found
-     * @return byte[]
-     * @throws java.io.IOException <code>Exception</code>
-     */
-    private byte[] getBytes(String resource) throws Exception {
-        for (int i = 0; embedded_jars != null && i < embedded_jars.size(); i++) {
-            String libjar_name = (String) embedded_jars.get(i);
-            InputStream in = getJarAsStream(libjar_name);
-            byte[] bytes = getBytes(in, resource);
-            if(bytes != null) {
-                return bytes;
-            }
-        }
-        return null;
-    }
-
-    /**
-     * Get a specific entry's content as a byte array
-     * 
-     * @param in
-     * @param resource
-     * @return
-     * @throws Exception
-     */
-    private byte[] getBytes(InputStream in, String resource) throws Exception {
-        ZipInputStream zin = new ZipInputStream(in);
-        ZipEntry entry;
-        String entryName;
-        while ((entry = zin.getNextEntry()) != null) {
-            entryName = entry.getName();
-            if (entryName != null &&
-                    entryName.endsWith(resource)) {
-                byte[] raw = IOUtils.toByteArray(zin);
-                zin.close();
-                return raw;
-            }
-        }
-        return null;
-    }
-
-    /**
-     * Get the specified embedded jar from the main jar 
-     *
-     * @param libjar_name
-     * @return
-     * @throws Exception
-     */
-    private InputStream getJarAsStream(String libjar_name) throws Exception {
-        return new ByteArrayInputStream(getBytes(urls[0].openStream(), libjar_name));
-    }
-
-    public static class ByteUrlStreamHandler extends URLStreamHandler {
-        private byte[] bytes;
-
-        public ByteUrlStreamHandler(byte[] bytes) {
-            this.bytes = bytes;
-        }
-
-        protected URLConnection openConnection(URL u) throws IOException {
-            return new ByteURLConnection(u, bytes);
-        }
-    }
-
-    public static class ByteURLConnection extends URLConnection {
-        protected byte[] bytes;
-
-        public ByteURLConnection(URL url, byte[] bytes) {
-            super(url);
-            this.bytes = bytes;
-        }
-
-        public void connect() {
-        }
-
-        public InputStream getInputStream() {
-            return new ByteArrayInputStream(bytes);
-        }
-    }
-
     public InputStream getResourceAsStream(String name) {
         URL url = findResource(name);
         if(url == null) {
@@ -272,7 +61,7 @@ public class DeploymentClassLoader exten
     }
 
     protected synchronized Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException {
-        Class c = null;
+        Class<?> c = null;
         if (!isChildFirstClassLoading) {
             c = super.loadClass(name, resolve);
         } else {

Modified: axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/deployment/DeploymentEngine.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/deployment/DeploymentEngine.java?rev=1800521&r1=1800520&r2=1800521&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/deployment/DeploymentEngine.java (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/deployment/DeploymentEngine.java Sat Jul  1 18:31:49 2017
@@ -46,7 +46,6 @@ import org.apache.commons.logging.LogFac
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
 import java.io.BufferedReader;
-import java.io.Closeable;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileOutputStream;
@@ -1157,9 +1156,9 @@ public abstract class DeploymentEngine i
     }
 
     private static void destroyClassLoader(ClassLoader classLoader) {
-        if (classLoader instanceof DeploymentClassLoader && classLoader instanceof Closeable) {
+        if (classLoader instanceof DeploymentClassLoader) {
             try {
-                ((Closeable)classLoader).close();
+                ((DeploymentClassLoader)classLoader).close();
             } catch (IOException ex) {
                 log.warn("Failed to destroy class loader " + classLoader, ex);
             }

Modified: axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/deployment/DescriptionBuilder.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/deployment/DescriptionBuilder.java?rev=1800521&r1=1800520&r2=1800521&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/deployment/DescriptionBuilder.java (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/deployment/DescriptionBuilder.java Sat Jul  1 18:31:49 2017
@@ -131,10 +131,10 @@ public class DescriptionBuilder implemen
     protected HashMap<String,MessageReceiver> processMessageReceivers(OMElement messageReceivers)
             throws DeploymentException {
         HashMap<String,MessageReceiver> mr_mep = new HashMap<String,MessageReceiver>();
-        Iterator msgReceivers = messageReceivers.getChildrenWithName(new QName(
+        Iterator<OMElement> msgReceivers = messageReceivers.getChildrenWithName(new QName(
                 TAG_MESSAGE_RECEIVER));
         while (msgReceivers.hasNext()) {
-            OMElement msgReceiver = (OMElement) msgReceivers.next();
+            OMElement msgReceiver = msgReceivers.next();
             final OMElement tempMsgReceiver = msgReceiver;
             MessageReceiver receiver = null;
             try {
@@ -164,10 +164,10 @@ public class DescriptionBuilder implemen
     protected HashMap<String,MessageReceiver> processMessageReceivers(ClassLoader loader,
                                               OMElement element) throws DeploymentException {
         HashMap<String,MessageReceiver> meps = new HashMap<String,MessageReceiver>();
-        Iterator iterator = element.getChildrenWithName(new QName(
+        Iterator<OMElement> iterator = element.getChildrenWithName(new QName(
                 TAG_MESSAGE_RECEIVER));
         while (iterator.hasNext()) {
-            OMElement receiverElement = (OMElement) iterator.next();
+            OMElement receiverElement = iterator.next();
             MessageReceiver receiver = loadMessageReceiver(loader,
                                                            receiverElement);
             OMAttribute mepAtt = receiverElement
@@ -216,10 +216,10 @@ public class DescriptionBuilder implemen
     protected HashMap processMessageBuilders(OMElement messageBuildersElement)
             throws DeploymentException {
         HashMap builderSelector = new HashMap();
-        Iterator msgBuilders = messageBuildersElement
+        Iterator<OMElement> msgBuilders = messageBuildersElement
                 .getChildrenWithName(new QName(TAG_MESSAGE_BUILDER));
         while (msgBuilders.hasNext()) {
-            OMElement msgBuilderElement = (OMElement) msgBuilders.next();
+            OMElement msgBuilderElement = msgBuilders.next();
             OMAttribute builderName = msgBuilderElement.getAttribute(new QName(TAG_CLASS_NAME));
             String className = builderName.getAttributeValue();
             Class builderClass = null;
@@ -254,10 +254,10 @@ public class DescriptionBuilder implemen
     protected HashMap processMessageFormatters(OMElement messageFormattersElement)
             throws DeploymentException {
         HashMap messageFormatters = new HashMap();
-        Iterator msgFormatters = messageFormattersElement
+        Iterator<OMElement> msgFormatters = messageFormattersElement
                 .getChildrenWithName(new QName(TAG_MESSAGE_FORMATTER));
         while (msgFormatters.hasNext()) {
-            OMElement msgFormatterElement = (OMElement) msgFormatters.next();
+            OMElement msgFormatterElement = msgFormatters.next();
             OMElement tempMsgFormatter = msgFormatterElement;
             OMAttribute formatterName = tempMsgFormatter.getAttribute(new QName(TAG_CLASS_NAME));
             String className = formatterName.getAttributeValue();
@@ -327,11 +327,11 @@ public class DescriptionBuilder implemen
             return flow;
         }
 
-        Iterator handlers = flowelement.getChildrenWithName(new QName(
+        Iterator<OMElement> handlers = flowelement.getChildrenWithName(new QName(
                 TAG_HANDLER));
 
         while (handlers.hasNext()) {
-            OMElement handlerElement = (OMElement) handlers.next();
+            OMElement handlerElement = handlers.next();
 
             flow.addHandler(processHandler(handlerElement, parent));
         }
@@ -459,7 +459,7 @@ public class DescriptionBuilder implemen
                 }
             }
 
-            Iterator parameters = handler_element
+            Iterator<OMElement> parameters = handler_element
                     .getChildrenWithName(new QName(TAG_PARAMETER));
 
             try {
@@ -586,11 +586,11 @@ public class DescriptionBuilder implemen
      */
     protected void processActionMappings(OMElement operation,
                                          AxisOperation op_descrip) {
-        Iterator mappingIterator = operation.getChildrenWithName(new QName(
+        Iterator<OMElement> mappingIterator = operation.getChildrenWithName(new QName(
                 Constants.ACTION_MAPPING));
         ArrayList mappingList = new ArrayList();
         while (mappingIterator.hasNext()) {
-            OMElement mappingElement = (OMElement) mappingIterator.next();
+            OMElement mappingElement = mappingIterator.next();
             String inputActionString = mappingElement.getText().trim();
             if (log.isTraceEnabled()) {
                 log.trace("Input Action Mapping found: " + inputActionString);
@@ -614,10 +614,10 @@ public class DescriptionBuilder implemen
             }
             op_descrip.setOutputAction(outputActionString);
         }
-        Iterator faultActionsIterator = operation
+        Iterator<OMElement> faultActionsIterator = operation
                 .getChildrenWithName(new QName(Constants.FAULT_ACTION_MAPPING));
         while (faultActionsIterator.hasNext()) {
-            OMElement faultMappingElement = (OMElement) faultActionsIterator
+            OMElement faultMappingElement = faultActionsIterator
                     .next();
             String faultActionString = faultMappingElement.getText().trim();
             String faultActionName = faultMappingElement

Modified: axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/deployment/ModuleBuilder.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/deployment/ModuleBuilder.java?rev=1800521&r1=1800520&r2=1800521&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/deployment/ModuleBuilder.java (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/deployment/ModuleBuilder.java Sat Jul  1 18:31:49 2017
@@ -105,7 +105,7 @@ public class ModuleBuilder extends Descr
             OMAttribute moduleClassAtt = moduleElement.getAttribute(new QName(TAG_CLASS_NAME));
             // processing Parameters
             // Processing service level parameters
-            Iterator<?> itr = moduleElement.getChildrenWithName(new QName(TAG_PARAMETER));
+            Iterator<OMElement> itr = moduleElement.getChildrenWithName(new QName(TAG_PARAMETER));
 
             processParameters(itr, module, module.getParent());
 
@@ -222,7 +222,7 @@ public class ModuleBuilder extends Descr
             }
 
             // processing Operations
-            Iterator<?> op_itr = moduleElement.getChildrenWithName(new QName(TAG_OPERATION));
+            Iterator<OMElement> op_itr = moduleElement.getChildrenWithName(new QName(TAG_OPERATION));
             List<AxisOperation> operations = processOperations(op_itr);
 
             for (AxisOperation op : operations) {

Modified: axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/deployment/ModuleDeployer.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/deployment/ModuleDeployer.java?rev=1800521&r1=1800520&r2=1800521&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/deployment/ModuleDeployer.java (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/deployment/ModuleDeployer.java Sat Jul  1 18:31:49 2017
@@ -197,8 +197,8 @@ public class ModuleDeployer extends Abst
         }
 
         try {
-            ClassLoader deploymentClassLoader = Utils.createClassLoader(new URL[] { fileUrl },
-                    axisConfig.getModuleClassLoader(), true,
+            ClassLoader deploymentClassLoader = Utils.createClassLoader(fileUrl, null,
+                    axisConfig.getModuleClassLoader(),
                     (File) axisConfig.getParameterValue(Constants.Configuration.ARTIFACTS_TEMP_DIR),
                     axisConfig.isChildFirstClassLoading());
             AxisModule module = new AxisModule();

Modified: axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/deployment/POJODeployer.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/deployment/POJODeployer.java?rev=1800521&r1=1800520&r2=1800521&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/deployment/POJODeployer.java (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/deployment/POJODeployer.java Sat Jul  1 18:31:49 2017
@@ -105,17 +105,16 @@ public class POJODeployer extends Abstra
                 List<String> classList = Utils.getListOfClasses(deploymentFileData);
                 ArrayList<AxisService> axisServiceList = new ArrayList<AxisService>();
                 for (String className : classList) {
-                    ArrayList<URL> urls = new ArrayList<URL>();
-                    urls.add(deploymentFileData.getFile().toURI().toURL());
-                    urls.add(configCtx.getAxisConfiguration().getRepository());
+                    List<URL> extraUrls = new ArrayList<>();
+                    extraUrls.add(configCtx.getAxisConfiguration().getRepository());
                     String webLocation = DeploymentEngine.getWebLocationString();
                     if (webLocation != null) {
-                        urls.add(new File(webLocation).toURI().toURL());
+                        extraUrls.add(new File(webLocation).toURI().toURL());
                     }
                     ClassLoader classLoader = Utils.createClassLoader(
-                            urls,
+                            deploymentFileData.getFile().toURI().toURL(),
+                            extraUrls.toArray(new URL[extraUrls.size()]),
                             configCtx.getAxisConfiguration().getSystemClassLoader(),
-                            true,
                             (File)configCtx.getAxisConfiguration().
                                     getParameterValue(Constants.Configuration.ARTIFACTS_TEMP_DIR),
                             configCtx.getAxisConfiguration().isChildFirstClassLoading());

Modified: axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/deployment/ServiceBuilder.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/deployment/ServiceBuilder.java?rev=1800521&r1=1800520&r2=1800521&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/deployment/ServiceBuilder.java (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/deployment/ServiceBuilder.java Sat Jul  1 18:31:49 2017
@@ -121,7 +121,7 @@ public class ServiceBuilder extends Desc
 				}
 			}
 
-			Iterator itr = service_element.getChildrenWithName(new QName(
+			Iterator<OMElement> itr = service_element.getChildrenWithName(new QName(
 					TAG_PARAMETER));
 			processParameters(itr, service, service.getParent());
 
@@ -240,13 +240,12 @@ public class ServiceBuilder extends Desc
 				// when this is doing AxisService.getSchemaTargetNamespace will
 				// be overridden
 				// This will be <mapping/> with @namespace and @package
-				Iterator mappingIterator = schemaElement
+				Iterator<OMElement> mappingIterator = schemaElement
 						.getChildrenWithName(new QName(MAPPING));
 				if (mappingIterator != null) {
 					Map<String,String> pkg2nsMap = new Hashtable<String,String>();
 					while (mappingIterator.hasNext()) {
-						OMElement mappingElement = (OMElement) mappingIterator
-								.next();
+						OMElement mappingElement = mappingIterator.next();
 						OMAttribute namespaceAttribute = mappingElement
 								.getAttribute(new QName(ATTRIBUTE_NAMESPACE));
 						OMAttribute packageAttribute = mappingElement
@@ -323,7 +322,7 @@ public class ServiceBuilder extends Desc
 			}
 
 			// processing service-wide modules which required to engage globally
-			Iterator moduleRefs = service_element
+			Iterator<OMElement> moduleRefs = service_element
 					.getChildrenWithName(new QName(TAG_MODULE));
 
 			processModuleRefs(moduleRefs);
@@ -332,11 +331,11 @@ public class ServiceBuilder extends Desc
 			OMElement transports = service_element
 					.getFirstChildWithName(new QName(TAG_TRANSPORTS));
 			if (transports != null) {
-				Iterator transport_itr = transports
+				Iterator<OMElement> transport_itr = transports
 						.getChildrenWithName(new QName(TAG_TRANSPORT));
 				ArrayList<String> trs = new ArrayList<String>();
 				while (transport_itr.hasNext()) {
-					OMElement trsEle = (OMElement) transport_itr.next();
+					OMElement trsEle = transport_itr.next();
 					String transportName = trsEle.getText().trim();
 					if (axisConfig.getTransportIn(transportName) == null) {
                         log.warn("Service [ " + service.getName()
@@ -357,7 +356,7 @@ public class ServiceBuilder extends Desc
 				service.setExposedTransports(trs);
 			}
 			// processing operations
-			Iterator operationsIterator = service_element
+			Iterator<OMElement> operationsIterator = service_element
 					.getChildrenWithName(new QName(TAG_OPERATION));
 			ArrayList ops = processOperations(operationsIterator);
 
@@ -421,7 +420,7 @@ public class ServiceBuilder extends Desc
 
 			// Need to call the same logic towice
 			setDefaultMessageReceivers();
-			Iterator moduleConfigs = service_element
+			Iterator<OMElement> moduleConfigs = service_element
 					.getChildrenWithName(new QName(TAG_MODULE_CONFIG));
 			processServiceModuleConfig(moduleConfigs, service, service);
 
@@ -490,14 +489,14 @@ public class ServiceBuilder extends Desc
 	 *            OMElement for the packageMappingElement
 	 */
 	private void processTypeMappings(OMElement packageMappingElement) {
-		Iterator elementItr = packageMappingElement
+		Iterator<OMElement> elementItr = packageMappingElement
 				.getChildrenWithName(new QName(TAG_MAPPING));
 		TypeTable typeTable = service.getTypeTable();
 		if (typeTable == null) {
 			typeTable = new TypeTable();
 		}
 		while (elementItr.hasNext()) {
-			OMElement mappingElement = (OMElement) elementItr.next();
+			OMElement mappingElement = elementItr.next();
 			String packageName = mappingElement.getAttributeValue(new QName(
 					TAG_PACKAGE_NAME));
 			String qName = mappingElement
@@ -608,10 +607,10 @@ public class ServiceBuilder extends Desc
 	 */
 	private ArrayList<String> processExcludeOperations(OMElement excludeOperations) {
 		ArrayList<String> exOps = new ArrayList<String>();
-		Iterator excludeOp_itr = excludeOperations
+		Iterator<OMElement> excludeOp_itr = excludeOperations
 				.getChildrenWithName(new QName(TAG_OPERATION));
 		while (excludeOp_itr.hasNext()) {
-			OMElement opName = (OMElement) excludeOp_itr.next();
+			OMElement opName = excludeOp_itr.next();
 			exOps.add(opName.getText().trim());
 		}
 		return exOps;
@@ -632,18 +631,18 @@ public class ServiceBuilder extends Desc
 			AxisMessage message = operation.getMessage(label
 					.getAttributeValue());
 
-			Iterator parameters = messageElement.getChildrenWithName(new QName(
+			Iterator<OMElement> parameters = messageElement.getChildrenWithName(new QName(
 					TAG_PARAMETER));
 
 			// processing <wsp:Policy> .. </..> elements
-			Iterator policyElements = PolicyUtil.getPolicyChildren(messageElement);
+			Iterator<OMElement> policyElements = PolicyUtil.getPolicyChildren(messageElement);
 
 			if (policyElements != null) {
 				processPolicyElements(policyElements, message.getPolicySubject());
 			}
 
 			// processing <wsp:PolicyReference> .. </..> elements
-			Iterator policyRefElements = PolicyUtil.getPolicyRefChildren(messageElement);
+			Iterator<OMElement> policyRefElements = PolicyUtil.getPolicyRefChildren(messageElement);
 
 			if (policyRefElements != null) {
 				processPolicyRefElements(policyRefElements, message.getPolicySubject());
@@ -701,7 +700,7 @@ public class ServiceBuilder extends Desc
 				String module = moduleName_att.getAttributeValue();
 				ModuleConfiguration moduleConfiguration = new ModuleConfiguration(
 						module, parent);
-				Iterator parameters = moduleConfig
+				Iterator<OMElement> parameters = moduleConfig
 						.getChildrenWithName(new QName(TAG_PARAMETER));
 
 				processParameters(parameters, moduleConfiguration, parent);
@@ -807,7 +806,7 @@ public class ServiceBuilder extends Desc
 			}
 
 			// Operation Parameters
-			Iterator parameters = operation.getChildrenWithName(new QName(
+			Iterator<OMElement> parameters = operation.getChildrenWithName(new QName(
 					TAG_PARAMETER));
 			processParameters(parameters, op_descrip, service);
 			// To process wsamapping;
@@ -830,13 +829,13 @@ public class ServiceBuilder extends Desc
 			}
 
 			// Process Module Refs
-			Iterator modules = operation.getChildrenWithName(new QName(
+			Iterator<OMElement> modules = operation.getChildrenWithName(new QName(
 					TAG_MODULE));
 
 			processOperationModuleRefs(modules, op_descrip);
 
 			// processing Messages
-			Iterator messages = operation.getChildrenWithName(new QName(
+			Iterator<OMElement> messages = operation.getChildrenWithName(new QName(
 					TAG_MESSAGE));
 
 			processMessages(messages, op_descrip);
@@ -847,7 +846,7 @@ public class ServiceBuilder extends Desc
 
 				info.setOperationPhases(op_descrip);
 			}
-			Iterator moduleConfigs = operation.getChildrenWithName(new QName(
+			Iterator<OMElement> moduleConfigs = operation.getChildrenWithName(new QName(
 					TAG_MODULE_CONFIG));
 			processOperationModuleConfig(moduleConfigs, op_descrip, op_descrip);
 			// adding the operation
@@ -871,7 +870,7 @@ public class ServiceBuilder extends Desc
 				String module = moduleName_att.getAttributeValue();
 				ModuleConfiguration moduleConfiguration = new ModuleConfiguration(
 						module, parent);
-				Iterator parameters = moduleConfig
+				Iterator<OMElement> parameters = moduleConfig
 						.getChildrenWithName(new QName(TAG_PARAMETER));
 
 				processParameters(parameters, moduleConfiguration, parent);
@@ -893,11 +892,11 @@ public class ServiceBuilder extends Desc
 			service.addDataLocatorClassNames(DRConstants.SERVICE_LEVEL,
 					className);
 		}
-		Iterator iterator = dataLocatorElement.getChildrenWithName(new QName(
+		Iterator<OMElement> iterator = dataLocatorElement.getChildrenWithName(new QName(
 				DRConstants.DIALECT_LOCATOR_ELEMENT));
 
 		while (iterator.hasNext()) {
-			OMElement locatorElement = (OMElement) iterator.next();
+			OMElement locatorElement = iterator.next();
 			OMAttribute dialect = locatorElement.getAttribute(new QName(
 					DRConstants.DIALECT_ATTRIBUTE));
 			OMAttribute dialectclass = locatorElement.getAttribute(new QName(

Modified: axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/deployment/ServiceDeployer.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/deployment/ServiceDeployer.java?rev=1800521&r1=1800520&r2=1800521&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/deployment/ServiceDeployer.java (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/deployment/ServiceDeployer.java Sat Jul  1 18:31:49 2017
@@ -299,8 +299,8 @@ public class ServiceDeployer extends Abs
         try {
             serviceGroup.setServiceGroupName(serviceName);
             ClassLoader serviceClassLoader = Utils
-                    .createClassLoader(new URL[] { servicesURL }, axisConfig
-                            .getServiceClassLoader(), true, (File) axisConfig
+                    .createClassLoader(servicesURL, null, axisConfig
+                            .getServiceClassLoader(), (File) axisConfig
                             .getParameterValue(Constants.Configuration.ARTIFACTS_TEMP_DIR),
                             axisConfig.isChildFirstClassLoading());
             String metainf = "meta-inf";

Modified: axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/deployment/ServiceGroupBuilder.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/deployment/ServiceGroupBuilder.java?rev=1800521&r1=1800520&r2=1800521&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/deployment/ServiceGroupBuilder.java (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/deployment/ServiceGroupBuilder.java Sat Jul  1 18:31:49 2017
@@ -54,25 +54,25 @@ public class ServiceGroupBuilder extends
         try {
 
             // Processing service level parameters
-            Iterator itr = serviceElement.getChildrenWithName(new QName(TAG_PARAMETER));
+            Iterator<OMElement> itr = serviceElement.getChildrenWithName(new QName(TAG_PARAMETER));
 
             processParameters(itr, axisServiceGroup, axisServiceGroup.getParent());
 
-            Iterator moduleConfigs =
+            Iterator<OMElement> moduleConfigs =
                     serviceElement.getChildrenWithName(new QName(TAG_MODULE_CONFIG));
 
             processServiceModuleConfig(moduleConfigs, axisServiceGroup.getParent(),
                                        axisServiceGroup);
 
             // processing service-wide modules which required to engage globally
-            Iterator moduleRefs = serviceElement.getChildrenWithName(new QName(TAG_MODULE));
+            Iterator<OMElement> moduleRefs = serviceElement.getChildrenWithName(new QName(TAG_MODULE));
 
             processModuleRefs(moduleRefs, axisServiceGroup);
 
-            Iterator serviceitr = serviceElement.getChildrenWithName(new QName(TAG_SERVICE));
+            Iterator<OMElement> serviceitr = serviceElement.getChildrenWithName(new QName(TAG_SERVICE));
 
             while (serviceitr.hasNext()) {
-                OMElement service = (OMElement) serviceitr.next();
+                OMElement service = serviceitr.next();
                 OMAttribute serviceNameatt = service.getAttribute(new QName(ATTRIBUTE_NAME));
                 if (serviceNameatt == null) {
                     throw new DeploymentException(
@@ -153,7 +153,7 @@ public class ServiceGroupBuilder extends
                 String module = moduleName_att.getAttributeValue();
                 ModuleConfiguration moduleConfiguration =
                         new ModuleConfiguration(module, parent);
-                Iterator parameters = moduleConfig.getChildrenWithName(new QName(TAG_PARAMETER));
+                Iterator<OMElement> parameters = moduleConfig.getChildrenWithName(new QName(TAG_PARAMETER));
 
                 processParameters(parameters, moduleConfiguration, parent);
                 axisService.addModuleConfig(moduleConfiguration);

Modified: axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/deployment/TransportDeployer.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/deployment/TransportDeployer.java?rev=1800521&r1=1800520&r2=1800521&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/deployment/TransportDeployer.java (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/deployment/TransportDeployer.java Sat Jul  1 18:31:49 2017
@@ -63,7 +63,7 @@ public class TransportDeployer extends A
             element.build();
             AxisConfigBuilder builder = new AxisConfigBuilder(axisConfig);
             // Processing Transport Receivers
-            Iterator trs_Reivers =
+            Iterator<OMElement> trs_Reivers =
                     element.getChildrenWithName(new QName(DeploymentConstants.TAG_TRANSPORT_RECEIVER));
             ArrayList transportReceivers = builder.processTransportReceivers(trs_Reivers);
             for (int i = 0; i < transportReceivers.size(); i++) {
@@ -76,7 +76,7 @@ public class TransportDeployer extends A
             }
 
             // Processing Transport Senders
-            Iterator trs_senders =
+            Iterator<OMElement> trs_senders =
                     element.getChildrenWithName(new QName(DeploymentConstants.TAG_TRANSPORT_SENDER));
 
             builder.processTransportSenders(trs_senders);

Modified: axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/deployment/repository/util/DeploymentFileData.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/deployment/repository/util/DeploymentFileData.java?rev=1800521&r1=1800520&r2=1800521&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/deployment/repository/util/DeploymentFileData.java (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/deployment/repository/util/DeploymentFileData.java Sat Jul  1 18:31:49 2017
@@ -123,8 +123,7 @@ public class DeploymentFileData {
                         throw new AxisFault(Messages.getMessage(DeploymentErrorMsgs.FILE_NOT_FOUND,
                                                                 this.file.getAbsolutePath()));
                     }
-                    urlsToLoadFrom = new URL[]{this.file.toURI().toURL()};
-                    classLoader = Utils.createClassLoader(urlsToLoadFrom, parent, true, file, isChildFirstClassLoading);
+                    classLoader = Utils.createClassLoader(this.file.toURI().toURL(), null, parent, file, isChildFirstClassLoading);
                 } catch (Exception e) {
                     throw AxisFault.makeFault(e);
                 }

Modified: axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java?rev=1800521&r1=1800520&r2=1800521&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java Sat Jul  1 18:31:49 2017
@@ -151,27 +151,31 @@ public class Utils {
     }
 
     public static URL[] getURLsForAllJars(URL url, File tmpDir) {
-        FileInputStream fin = null;
         InputStream in = null;
         ZipInputStream zin = null;
         try {
-            ArrayList array = new ArrayList();
+            ArrayList<URL> array = new ArrayList<URL>();
             in = url.openStream();
-            String fileName = url.getFile();
-            int index = fileName.lastIndexOf('/');
-            if (index != -1) {
-                fileName = fileName.substring(index + 1);
+            if (url.getProtocol().equals("file")) {
+                array.add(url);
+            } else {
+                String fileName = url.getFile();
+                int index = fileName.lastIndexOf('/');
+                if (index != -1) {
+                    fileName = fileName.substring(index + 1);
+                }
+                final File f = createTempFile(fileName, in, tmpDir);
+                in.close();
+
+                in = org.apache.axis2.java.security.AccessController
+                        .doPrivileged(new PrivilegedExceptionAction<InputStream>() {
+                            public InputStream run() throws FileNotFoundException {
+                                return new FileInputStream(f);
+                            }
+                        });
+                array.add(f.toURI().toURL());
             }
-            final File f = createTempFile(fileName, in, tmpDir);
-
-            fin = (FileInputStream)org.apache.axis2.java.security.AccessController
-                    .doPrivileged(new PrivilegedExceptionAction() {
-                        public Object run() throws FileNotFoundException {
-                            return new FileInputStream(f);
-                        }
-                    });
-            array.add(f.toURI().toURL());
-            zin = new ZipInputStream(fin);
+            zin = new ZipInputStream(in);
 
             ZipEntry entry;
             String entryName;
@@ -189,17 +193,10 @@ public class Utils {
                     array.add(f2.toURI().toURL());
                 }
             }
-            return (URL[])array.toArray(new URL[array.size()]);
+            return array.toArray(new URL[array.size()]);
         } catch (Exception e) {
             throw new RuntimeException(e);
         } finally {
-            if (fin != null) {
-                try {
-                    fin.close();
-                } catch (IOException e) {
-                    //
-                }
-            }
             if (in != null) {
                 try {
                     in.close();
@@ -320,13 +317,11 @@ public class Utils {
      */
     public static ClassLoader getClassLoader(final ClassLoader parent, File file, final boolean isChildFirstClassLoading)
             throws DeploymentException {
-        URLClassLoader classLoader;
-
         if (file == null)
             return null; // Shouldn't this just return the parent?
 
         try {
-            ArrayList urls = new ArrayList();
+            ArrayList<URL> urls = new ArrayList<URL>();
             urls.add(file.toURI().toURL());
 
             // lower case directory name
@@ -339,36 +334,30 @@ public class Utils {
 
             final URL urllist[] = new URL[urls.size()];
             for (int i = 0; i < urls.size(); i++) {
-                urllist[i] = (URL)urls.get(i);
+                urllist[i] = urls.get(i);
             }
             if (log.isDebugEnabled()) {
                 log.debug("Creating class loader with the following libraries: " + Arrays.asList(urllist));
             }
-            classLoader = (URLClassLoader)AccessController
-                    .doPrivileged(new PrivilegedAction() {
-                        public Object run() {
-                            return new DeploymentClassLoader(urllist, null, parent, isChildFirstClassLoading);
-                        }
-                    });
-            return classLoader;
+            return createDeploymentClassLoader(urllist, parent, isChildFirstClassLoading);
         } catch (MalformedURLException e) {
             throw new DeploymentException(e);
         }
     }
 
-    private static boolean addFiles(ArrayList urls, final File libfiles)
+    private static boolean addFiles(ArrayList<URL> urls, final File libfiles)
             throws MalformedURLException {
-        Boolean exists = (Boolean)org.apache.axis2.java.security.AccessController
-                .doPrivileged(new PrivilegedAction() {
-                    public Object run() {
+        Boolean exists = org.apache.axis2.java.security.AccessController
+                .doPrivileged(new PrivilegedAction<Boolean>() {
+                    public Boolean run() {
                         return libfiles.exists();
                     }
                 });
         if (exists) {
             urls.add(libfiles.toURI().toURL());
-            File jarfiles[] = (File[])org.apache.axis2.java.security.AccessController
-                    .doPrivileged(new PrivilegedAction() {
-                        public Object run() {
+            File jarfiles[] = org.apache.axis2.java.security.AccessController
+                    .doPrivileged(new PrivilegedAction<File[]>() {
+                        public File[] run() {
                             return libfiles.listFiles();
                         }
                     });
@@ -728,38 +717,6 @@ public class Utils {
     }
 
     /**
-     * Get names of all *.jar files inside the lib/ directory of a given jar URL
-     *
-     * @param url base URL of a JAR to search
-     * @return a List containing file names (Strings) of all files matching "[lL]ib/*.jar"
-     */
-    public static List findLibJars(URL url) {
-        ArrayList embedded_jars = new ArrayList();
-        try {
-            ZipInputStream zin = new ZipInputStream(url.openStream());
-            ZipEntry entry;
-            String entryName;
-            while ((entry = zin.getNextEntry()) != null) {
-                entryName = entry.getName();
-                /**
-                 * if the entry name start with /lib and ends with .jar add it
-                 * to the the arraylist
-                 */
-                if (entryName != null
-                    && (entryName.startsWith("lib/") || entryName
-                        .startsWith("Lib/"))
-                    && entryName.endsWith(".jar")) {
-                    embedded_jars.add(entryName);
-                }
-            }
-            zin.close();
-        } catch (Exception e) {
-            throw new RuntimeException(e);
-        }
-        return embedded_jars;
-    }
-
-    /**
      * Add the Axis2 lifecycle / session methods to a pre-existing list of names that will be
      * excluded when generating schemas.
      *
@@ -783,35 +740,7 @@ public class Utils {
                             }
                         });
         return createDeploymentClassLoader(new URL[]{serviceFile.toURI().toURL()},
-                                           contextClassLoader, new ArrayList(), isChildFirstClassLoading);
-    }
-
-    public static ClassLoader createClassLoader(ArrayList urls,
-                                                ClassLoader serviceClassLoader,
-                                                boolean extractJars,
-                                                File tmpDir,
-                                                boolean isChildFirstClassLoading) {
-        URL url = (URL)urls.get(0);
-        if (extractJars) {
-            try {
-                URL[] urls1 = Utils.getURLsForAllJars(url, tmpDir);
-                urls.remove(0);
-                urls.addAll(0, Arrays.asList(urls1));
-                URL[] urls2 = (URL[])urls.toArray(new URL[urls.size()]);
-                return createDeploymentClassLoader(urls2, serviceClassLoader,
-                                                   null, isChildFirstClassLoading);
-            } catch (Exception e) {
-                log
-                        .warn("Exception extracting jars into temporary directory : "
-                              + e.getMessage()
-                              + " : switching to alternate class loading mechanism");
-                log.debug(e.getMessage(), e);
-            }
-        }
-        List embedded_jars = Utils.findLibJars(url);
-        URL[] urls2 = (URL[])urls.toArray(new URL[urls.size()]);
-        return createDeploymentClassLoader(urls2, serviceClassLoader,
-                                           embedded_jars, isChildFirstClassLoading);
+                                           contextClassLoader, isChildFirstClassLoading);
     }
 
     public static File toFile(URL url) throws UnsupportedEncodingException {
@@ -819,36 +748,26 @@ public class Utils {
         return new File(path.replace('/', File.separatorChar).replace('|', ':'));
     }
 
-    public static ClassLoader createClassLoader(URL[] urls,
+    public static ClassLoader createClassLoader(URL archiveUrl, URL[] extraUrls,
                                                 ClassLoader serviceClassLoader,
-                                                boolean extractJars,
                                                 File tmpDir,
                                                 boolean isChildFirstClassLoading) {
-        if (extractJars) {
-            try {
-                URL[] urls1 = Utils.getURLsForAllJars(urls[0], tmpDir);
-                return createDeploymentClassLoader(urls1, serviceClassLoader,
-                                                   null, isChildFirstClassLoading);
-            } catch (Exception e) {
-                log
-                        .warn("Exception extracting jars into temporary directory : "
-                              + e.getMessage()
-                              + " : switching to alternate class loading mechanism");
-                log.debug(e.getMessage(), e);
-            }
-        }
-        List embedded_jars = Utils.findLibJars(urls[0]);
-        return createDeploymentClassLoader(urls, serviceClassLoader,
-                                           embedded_jars, isChildFirstClassLoading);
+        List<URL> urls = new ArrayList<>();
+        urls.addAll(Arrays.asList(Utils.getURLsForAllJars(archiveUrl, tmpDir)));
+        if (extraUrls != null) {
+            urls.addAll(Arrays.asList(extraUrls));
+        }
+        return createDeploymentClassLoader(urls.toArray(new URL[urls.size()]), serviceClassLoader,
+                                           isChildFirstClassLoading);
     }
 
     private static DeploymentClassLoader createDeploymentClassLoader(
             final URL[] urls, final ClassLoader serviceClassLoader,
-            final List embeddedJars, final boolean isChildFirstClassLoading) {
-        return (DeploymentClassLoader)AccessController
-                .doPrivileged(new PrivilegedAction() {
-                    public Object run() {
-                        return new DeploymentClassLoader(urls, embeddedJars,
+            final boolean isChildFirstClassLoading) {
+        return AccessController
+                .doPrivileged(new PrivilegedAction<DeploymentClassLoader>() {
+                    public DeploymentClassLoader run() {
+                        return new DeploymentClassLoader(urls,
                                                          serviceClassLoader, isChildFirstClassLoading);
                     }
                 });
@@ -867,11 +786,11 @@ public class Utils {
         if (excludeBeanProperty != null) {
             OMElement parameterElement = excludeBeanProperty
                     .getParameterElement();
-            Iterator bneasItr = parameterElement.getChildrenWithName(new QName(
+            Iterator<OMElement> bneasItr = parameterElement.getChildrenWithName(new QName(
                     "bean"));
             ExcludeInfo excludeInfo = new ExcludeInfo();
             while (bneasItr.hasNext()) {
-                OMElement bean = (OMElement)bneasItr.next();
+                OMElement bean = bneasItr.next();
                 String clazz = bean.getAttributeValue(new QName(
                         DeploymentConstants.TAG_CLASS_NAME));
                 String excludePropertees = bean.getAttributeValue(new QName(
@@ -1253,10 +1172,10 @@ public class Utils {
                 policyComponents.add(policyRef);
             }
 
-            for (Iterator policySubjects = appliesToElem
+            for (Iterator<OMElement> policySubjects = appliesToElem
                     .getChildrenWithName(new QName("policy-subject")); policySubjects
                     .hasNext();) {
-                OMElement policySubject = (OMElement)policySubjects.next();
+                OMElement policySubject = policySubjects.next();
                 String identifier = policySubject.getAttributeValue(new QName(
                         "identifier"));
 

Modified: axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/description/AxisService2WSDL11.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/description/AxisService2WSDL11.java?rev=1800521&r1=1800520&r2=1800521&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/description/AxisService2WSDL11.java (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/description/AxisService2WSDL11.java Sat Jul  1 18:31:49 2017
@@ -1310,10 +1310,10 @@ public class AxisService2WSDL11 implemen
 			OMElement definitionElement) {
 		QName bindingName = axisBinding.getName();
 		QName name = new QName("name");
-		for (Iterator iterator = definitionElement
+		for (Iterator<OMElement> iterator = definitionElement
 				.getChildrenWithName(new QName(wsdl.getNamespaceURI(),
 						BINDING_LOCAL_NAME)); iterator.hasNext();) {
-			OMElement element = (OMElement) iterator.next();
+			OMElement element = iterator.next();
 			String value = element.getAttributeValue(name);
 			if (bindingName.getLocalPart().equals(value)) {
 				return true;

Modified: axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/description/ParameterIncludeImpl.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/description/ParameterIncludeImpl.java?rev=1800521&r1=1800520&r2=1800521&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/description/ParameterIncludeImpl.java (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/kernel/src/org/apache/axis2/description/ParameterIncludeImpl.java Sat Jul  1 18:31:49 2017
@@ -164,13 +164,13 @@ public class ParameterIncludeImpl
      * @throws AxisFault
      */
     public void deserializeParameters(OMElement parameters) throws AxisFault {
-        Iterator iterator =
+        Iterator<OMElement> iterator =
                 parameters.getChildrenWithName(new QName(DeploymentConstants.TAG_PARAMETER));
 
         while (iterator.hasNext()) {
 
             // this is to check whether some one has locked the parmeter at the top level
-            OMElement parameterElement = (OMElement) iterator.next();
+            OMElement parameterElement = iterator.next();
             Parameter parameter = new Parameter();
 
             // setting parameterElement

Modified: axis/axis2/java/core/branches/hermetic-tests/modules/kernel/test/org/apache/axis2/deployment/AddressingIdentityServiceTest.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/kernel/test/org/apache/axis2/deployment/AddressingIdentityServiceTest.java?rev=1800521&r1=1800520&r2=1800521&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/kernel/test/org/apache/axis2/deployment/AddressingIdentityServiceTest.java (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/kernel/test/org/apache/axis2/deployment/AddressingIdentityServiceTest.java Sat Jul  1 18:31:49 2017
@@ -224,8 +224,8 @@ public class AddressingIdentityServiceTe
     private OMElement findPort(OMElement serviceElement, String portName) {
         QName portQName = new QName(WSDLConstants.WSDL1_1_NAMESPACE, Java2WSDLConstants.PORT);
         
-        for (@SuppressWarnings("rawtypes")Iterator portIter = serviceElement.getChildrenWithName(portQName); portIter.hasNext(); ) {
-            OMElement portElement = (OMElement) portIter.next();
+        for (Iterator<OMElement> portIter = serviceElement.getChildrenWithName(portQName); portIter.hasNext(); ) {
+            OMElement portElement = portIter.next();
             if (portName.equals(portElement.getAttributeValue(new QName("", Java2WSDLConstants.ATTRIBUTE_NAME)))) {
                 return portElement;
             }

Modified: axis/axis2/java/core/branches/hermetic-tests/modules/mex/src/org/apache/axis2/mex/om/Metadata.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/mex/src/org/apache/axis2/mex/om/Metadata.java?rev=1800521&r1=1800520&r2=1800521&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/mex/src/org/apache/axis2/mex/om/Metadata.java (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/mex/src/org/apache/axis2/mex/om/Metadata.java Sat Jul  1 18:31:49 2017
@@ -166,13 +166,13 @@ public class Metadata extends MexOM impl
 	  if (aFactory == null) {
 	     aFactory = factory;
 	   }
-	   Iterator mexSections = mexElement.getChildrenWithName(new QName(namespaceValue, MexConstants.SPEC.METADATA_SECTION));
+	   Iterator<OMElement> mexSections = mexElement.getChildrenWithName(new QName(namespaceValue, MexConstants.SPEC.METADATA_SECTION));
         
            if (mexSections == null){
          	throw new MexOMException("Metadata element does not contain MetadataSection element.");
          }
         while (mexSections.hasNext()){
-        	OMElement aSection = (OMElement) mexSections.next();
+        	OMElement aSection = mexSections.next();
             MetadataSection metadataSection = new MetadataSection(aFactory, namespaceValue);
             addMetadatSection(metadataSection.fromOM(aSection)); 
         }

Modified: axis/axis2/java/core/branches/hermetic-tests/modules/mex/src/org/apache/axis2/mex/util/MexUtil.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/mex/src/org/apache/axis2/mex/util/MexUtil.java?rev=1800521&r1=1800520&r2=1800521&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/mex/src/org/apache/axis2/mex/util/MexUtil.java (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/mex/src/org/apache/axis2/mex/util/MexUtil.java Sat Jul  1 18:31:49 2017
@@ -241,12 +241,12 @@ public class MexUtil {
 			return forms;
 		
 		OMElement mexConfig = mexParm.getParameterElement();
-		Iterator ite = mexConfig.getChildrenWithName(new QName(
+		Iterator<OMElement> ite = mexConfig.getChildrenWithName(new QName(
 				MexConstants.MEX_CONFIG.OUTPUT_FORM_PARM));
 		String dialectForm_configured = null;
 		String serviceForm_configured = null;
 		while (ite.hasNext()) {
-			OMElement elem = (OMElement) ite.next();
+			OMElement elem = ite.next();
 			String form_value = elem.getAttributeValue(new QName(
 					MexConstants.MEX_CONFIG.FORMS_PARM));
 			String dialect_value = elem.getAttributeValue(new QName(

Modified: axis/axis2/java/core/branches/hermetic-tests/modules/osgi-tests/pom.xml
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/osgi-tests/pom.xml?rev=1800521&r1=1800520&r2=1800521&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/osgi-tests/pom.xml (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/osgi-tests/pom.xml Sat Jul  1 18:31:49 2017
@@ -44,13 +44,6 @@
             <scope>test</scope>
         </dependency>
         <dependency>
-            <!-- TODO: manage this dependency -->
-            <groupId>org.apache.geronimo.specs</groupId>
-            <artifactId>geronimo-jms_1.1_spec</artifactId>
-            <version>1.1.1</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
             <groupId>com.sun.mail</groupId>
             <artifactId>javax.mail</artifactId>
             <scope>test</scope>
@@ -133,16 +126,6 @@
                                     <version>1.2</version>
                                 </artifact>
                                 <artifact>
-                                    <groupId>org.apache.geronimo.specs</groupId>
-                                    <artifactId>geronimo-jaxrs_1.1_spec</artifactId>
-                                    <version>1.0</version>
-                                </artifact>
-                                <artifact>
-                                    <groupId>org.apache.servicemix.specs</groupId>
-                                    <artifactId>org.apache.servicemix.specs.stax-api-1.0</artifactId>
-                                    <version>2.2.0</version>
-                                </artifact>
-                                <artifact>
                                     <groupId>org.apache.servicemix.bundles</groupId>
                                     <artifactId>org.apache.servicemix.bundles.commons-httpclient</artifactId>
                                     <version>3.1_7</version>

Modified: axis/axis2/java/core/branches/hermetic-tests/modules/osgi-tests/src/test/java/OSGiTest.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/osgi-tests/src/test/java/OSGiTest.java?rev=1800521&r1=1800520&r2=1800521&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/osgi-tests/src/test/java/OSGiTest.java (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/osgi-tests/src/test/java/OSGiTest.java Sat Jul  1 18:31:49 2017
@@ -60,11 +60,9 @@ public class OSGiTest {
                 url("link:classpath:META-INF/links/org.osgi.compendium.link"),
                 url("link:classpath:org.apache.felix.configadmin.link"),
                 url("link:classpath:org.apache.servicemix.bundles.wsdl4j.link"),
-                url("link:classpath:org.apache.geronimo.specs.geronimo-jms_1.1_spec.link"), // TODO: why the heck is this required???
                 url("link:classpath:org.apache.geronimo.specs.geronimo-ws-metadata_2.0_spec.link"),
                 url("link:classpath:com.sun.mail.javax.mail.link"), // TODO: should no longer be necessary
                 url("link:classpath:org.apache.geronimo.specs.geronimo-servlet_2.5_spec.link"),
-                url("link:classpath:org.apache.geronimo.specs.geronimo-jaxrs_1.1_spec.link"), // TODO: shouldn't this be optional???
                 url("link:classpath:org.apache.james.apache-mime4j-core.link"),
                 url("link:classpath:org.apache.ws.commons.axiom.axiom-api.link"),
                 url("link:classpath:org.apache.ws.commons.axiom.axiom-impl.link"),

Modified: axis/axis2/java/core/branches/hermetic-tests/modules/osgi/pom.xml
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/osgi/pom.xml?rev=1800521&r1=1800520&r2=1800521&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/osgi/pom.xml (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/osgi/pom.xml Sat Jul  1 18:31:49 2017
@@ -80,10 +80,9 @@
                             org.apache.axis2.*;-split-package:=merge-last; version=1.5,
                         </Export-Package>
                         <Import-Package>
-                            !javax.xml.namespace,
+                            javax.xml.namespace,
                             !org.apache.axis2.*,
-                            javax.ws.rs; version=1.0,
-                            javax.xml.namespace; version=0.0.0,
+                            javax.ws.rs; resolution:=optional,
                             javax.servlet; version=2.4.0,
                             javax.servlet.http; version=2.4.0,
                             javax.transaction,
@@ -97,7 +96,6 @@
                             com.ibm.wsdl,
                             javax.activation,
                             javax.jws;version="2.0",
-                            javax.jms;version="1.1",
                             javax.mail;version="1.4",
                             javax.management,
                             javax.mail.internet;version="1.4",

Modified: axis/axis2/java/core/branches/hermetic-tests/modules/osgi/src/org/apache/axis2/osgi/deployment/OSGiServiceGroupBuilder.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/osgi/src/org/apache/axis2/osgi/deployment/OSGiServiceGroupBuilder.java?rev=1800521&r1=1800520&r2=1800521&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/osgi/src/org/apache/axis2/osgi/deployment/OSGiServiceGroupBuilder.java (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/osgi/src/org/apache/axis2/osgi/deployment/OSGiServiceGroupBuilder.java Sat Jul  1 18:31:49 2017
@@ -60,25 +60,25 @@ public class OSGiServiceGroupBuilder ext
         try {
 
             // Processing service level parameters
-            Iterator itr = serviceElement.getChildrenWithName(new QName(TAG_PARAMETER));
+            Iterator<OMElement> itr = serviceElement.getChildrenWithName(new QName(TAG_PARAMETER));
 
             processParameters(itr, axisServiceGroup, axisServiceGroup.getParent());
 
-            Iterator moduleConfigs =
+            Iterator<OMElement> moduleConfigs =
                     serviceElement.getChildrenWithName(new QName(TAG_MODULE_CONFIG));
 
             processServiceModuleConfig(moduleConfigs, axisServiceGroup.getParent(),
                                        axisServiceGroup);
 
             // processing service-wide modules which required to engage globally
-            Iterator moduleRefs = serviceElement.getChildrenWithName(new QName(TAG_MODULE));
+            Iterator<OMElement> moduleRefs = serviceElement.getChildrenWithName(new QName(TAG_MODULE));
 
             processModuleRefs(moduleRefs, axisServiceGroup);
 
-            Iterator serviceitr = serviceElement.getChildrenWithName(new QName(TAG_SERVICE));
+            Iterator<OMElement> serviceitr = serviceElement.getChildrenWithName(new QName(TAG_SERVICE));
 
             while (serviceitr.hasNext()) {
-                OMElement service = (OMElement) serviceitr.next();
+                OMElement service = serviceitr.next();
                 OMAttribute serviceNameatt = service.getAttribute(new QName(ATTRIBUTE_NAME));
                 if (serviceNameatt == null) {
                     throw new DeploymentException(

Modified: axis/axis2/java/core/branches/hermetic-tests/modules/ping/src/org/apache/axis2/ping/PingMessageReceiver.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/ping/src/org/apache/axis2/ping/PingMessageReceiver.java?rev=1800521&r1=1800520&r2=1800521&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/ping/src/org/apache/axis2/ping/PingMessageReceiver.java (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/ping/src/org/apache/axis2/ping/PingMessageReceiver.java Sat Jul  1 18:31:49 2017
@@ -95,12 +95,12 @@ public class PingMessageReceiver extends
 
         if (!serviceLevel && element != null) {
             //Operations to be pinged has been specified in the ping request
-            Iterator<?> elementIterator = pingRequestElement.getChildrenWithName(new QName(TAG_OPERATION));
+            Iterator<OMElement> elementIterator = pingRequestElement.getChildrenWithName(new QName(TAG_OPERATION));
             ArrayList<AxisOperation> operationList = new ArrayList<AxisOperation>();
             AxisOperation axisOperation;
 
             while (elementIterator.hasNext()) {
-                OMElement opElement = (OMElement) elementIterator.next();
+                OMElement opElement = elementIterator.next();
                 String operationName = opElement.getText();
                 axisOperation = inMessage.getAxisService().getOperation(new QName(operationName));
 

Modified: axis/axis2/java/core/branches/hermetic-tests/modules/saaj/src/org/apache/axis2/saaj/SOAPBodyImpl.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/saaj/src/org/apache/axis2/saaj/SOAPBodyImpl.java?rev=1800521&r1=1800520&r2=1800521&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/saaj/src/org/apache/axis2/saaj/SOAPBodyImpl.java (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/saaj/src/org/apache/axis2/saaj/SOAPBodyImpl.java Sat Jul  1 18:31:49 2017
@@ -21,9 +21,9 @@ package org.apache.axis2.saaj;
 
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMNamespace;
-import org.apache.axiom.soap.SOAP11Version;
-import org.apache.axiom.soap.SOAP12Version;
+import org.apache.axiom.om.OMNode;
 import org.apache.axiom.soap.SOAPFactory;
+import org.apache.axiom.soap.SOAPVersion;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.NamedNodeMap;
@@ -516,9 +516,9 @@ public class SOAPBodyImpl extends SOAPEl
     }
 
     public QName createQName(String localName, String prefix) throws SOAPException {
-        if (((SOAPFactory)this.omTarget.getOMFactory()).getSOAPVersion() == SOAP11Version.getSingleton()) {
+        if (((SOAPFactory)this.omTarget.getOMFactory()).getSOAPVersion() == SOAPVersion.SOAP11) {
             return super.createQName(localName, prefix);
-        } else if (((SOAPFactory)this.omTarget.getOMFactory()).getSOAPVersion() == SOAP12Version.getSingleton()) {
+        } else if (((SOAPFactory)this.omTarget.getOMFactory()).getSOAPVersion() == SOAPVersion.SOAP12) {
             if (this.omTarget.findNamespaceURI(prefix) == null) {
                 throw new SOAPException("Only Namespace Qualified elements are allowed");
             } else {
@@ -562,7 +562,7 @@ public class SOAPBodyImpl extends SOAPEl
         return super.addTextNode(text);
     }
 
-    private Iterator getChildren(Iterator childIter) {
+    private Iterator getChildren(Iterator<? extends OMNode> childIter) {
         Collection childElements = new ArrayList();
         while (childIter.hasNext()) {
             org.w3c.dom.Node domNode = (org.w3c.dom.Node)childIter.next();

Modified: axis/axis2/java/core/branches/hermetic-tests/modules/saaj/src/org/apache/axis2/saaj/SOAPElementImpl.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/saaj/src/org/apache/axis2/saaj/SOAPElementImpl.java?rev=1800521&r1=1800520&r2=1800521&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/saaj/src/org/apache/axis2/saaj/SOAPElementImpl.java (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/saaj/src/org/apache/axis2/saaj/SOAPElementImpl.java Sat Jul  1 18:31:49 2017
@@ -23,9 +23,8 @@ import org.apache.axiom.om.OMAttribute;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMNamespace;
 import org.apache.axiom.om.OMNode;
-import org.apache.axiom.soap.SOAP11Version;
-import org.apache.axiom.soap.SOAP12Version;
 import org.apache.axiom.soap.SOAPFactory;
+import org.apache.axiom.soap.SOAPVersion;
 import org.w3c.dom.Attr;
 import org.w3c.dom.DOMException;
 import org.w3c.dom.Element;
@@ -272,7 +271,7 @@ public class SOAPElementImpl<T extends O
       */
     public Iterator getChildElements(Name name) {
         QName qName = new QName(name.getURI(), name.getLocalName());
-        Iterator childIter = omTarget.getChildrenWithName(qName);
+        Iterator<OMElement> childIter = omTarget.getChildrenWithName(qName);
         Collection childElements = new ArrayList();
         while (childIter.hasNext()) {
             childElements.add(toSAAJNode((org.w3c.dom.Node)childIter.next()));
@@ -421,7 +420,7 @@ public class SOAPElementImpl<T extends O
     }
 
     public Iterator getChildElements(QName qname) {
-        Iterator childIter = omTarget.getChildrenWithName(qname);
+        Iterator<OMElement> childIter = omTarget.getChildrenWithName(qname);
         Collection childElements = new ArrayList();
         while (childIter.hasNext()) {
             childElements.add(toSAAJNode((org.w3c.dom.Node)childIter.next()));
@@ -505,7 +504,7 @@ public class SOAPElementImpl<T extends O
      *          the encodingStyle is invalid for this SOAPElement.
      */
     public void setEncodingStyle(String encodingStyle) throws SOAPException {
-        if (((SOAPFactory)this.omTarget.getOMFactory()).getSOAPVersion() == SOAP11Version.getSingleton()) {
+        if (((SOAPFactory)this.omTarget.getOMFactory()).getSOAPVersion() == SOAPVersion.SOAP11) {
             try {
                 URI uri = new URI(encodingStyle);
                 if (!(this instanceof SOAPEnvelope)) {
@@ -519,7 +518,7 @@ public class SOAPElementImpl<T extends O
                 throw new IllegalArgumentException("Invalid Encoding style : "
                         + encodingStyle + ":" + e);
             }
-        } else if (((SOAPFactory)this.omTarget.getOMFactory()).getSOAPVersion() == SOAP12Version.getSingleton()) {
+        } else if (((SOAPFactory)this.omTarget.getOMFactory()).getSOAPVersion() == SOAPVersion.SOAP12) {
             if (this instanceof SOAPHeader || this instanceof SOAPBody ||
                     this instanceof SOAPFault ||
                     this instanceof SOAPFaultElement || this instanceof SOAPEnvelope ||

Modified: axis/axis2/java/core/branches/hermetic-tests/modules/saaj/src/org/apache/axis2/saaj/SOAPEnvelopeImpl.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/saaj/src/org/apache/axis2/saaj/SOAPEnvelopeImpl.java?rev=1800521&r1=1800520&r2=1800521&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/saaj/src/org/apache/axis2/saaj/SOAPEnvelopeImpl.java (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/saaj/src/org/apache/axis2/saaj/SOAPEnvelopeImpl.java Sat Jul  1 18:31:49 2017
@@ -20,10 +20,9 @@
 package org.apache.axis2.saaj;
 
 import org.apache.axiom.om.OMNode;
-import org.apache.axiom.soap.SOAP11Version;
-import org.apache.axiom.soap.SOAP12Version;
 import org.apache.axiom.soap.SOAPEnvelope;
 import org.apache.axiom.soap.SOAPFactory;
+import org.apache.axiom.soap.SOAPVersion;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 
@@ -183,7 +182,7 @@ public class SOAPEnvelopeImpl extends SO
      * on Envelop
      */
     public SOAPElement addAttribute(Name name, String value) throws SOAPException {
-        if (((SOAPFactory)this.omTarget.getOMFactory()).getSOAPVersion() == SOAP12Version.getSingleton()) {
+        if (((SOAPFactory)this.omTarget.getOMFactory()).getSOAPVersion() == SOAPVersion.SOAP12) {
             if ("encodingStyle".equals(name.getLocalName())) {
                 throw new SOAPException(
                         "SOAP1.2 does not allow encodingStyle attribute to be set " +
@@ -198,9 +197,9 @@ public class SOAPEnvelopeImpl extends SO
      * element
      */
     public SOAPElement addChildElement(Name name) throws SOAPException {
-        if (((SOAPFactory)this.omTarget.getOMFactory()).getSOAPVersion() == SOAP12Version.getSingleton()) {
+        if (((SOAPFactory)this.omTarget.getOMFactory()).getSOAPVersion() == SOAPVersion.SOAP12) {
             throw new SOAPException("Cannot add elements after body element");
-        } else if (((SOAPFactory)this.omTarget.getOMFactory()).getSOAPVersion() == SOAP11Version.getSingleton()) {
+        } else if (((SOAPFactory)this.omTarget.getOMFactory()).getSOAPVersion() == SOAPVersion.SOAP11) {
             //Let elements to be added any where.
             return super.addChildElement(name);
         }