Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/PersistenceUnitLinkResolver.java URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/PersistenceUnitLinkResolver.java?rev=1569795&r1=1569794&r2=1569795&view=diff ============================================================================== --- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/PersistenceUnitLinkResolver.java (original) +++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/PersistenceUnitLinkResolver.java Wed Feb 19 15:47:58 2014 @@ -62,7 +62,7 @@ public class PersistenceUnitLinkResolver final Iterator<PersistenceUnit> it = values.iterator(); while (it.hasNext()) { final PersistenceUnit next = it.next(); - for (WebModule webModule : module.getWebModules()) { + for (final WebModule webModule : module.getWebModules()) { if (isIn(next, webModule)) { it.remove(); } @@ -79,20 +79,20 @@ public class PersistenceUnitLinkResolver } final Collection<String> strUrls = new ArrayList<String>(); - for (URL url : urls) { + for (final URL url : urls) { strUrls.add(URLs.toFilePath(url)); } - for (PersistenceModule persistenceModule : module.getPersistenceModules()) { + for (final PersistenceModule persistenceModule : module.getPersistenceModules()) { final Persistence persistence = persistenceModule.getPersistence(); final String rootUrl; try { rootUrl = URLs.toFilePath(new URL(persistenceModule.getRootUrl())); - } catch (MalformedURLException e) { + } catch (final MalformedURLException e) { continue; } - for (PersistenceUnit unit : persistence.getPersistenceUnit()) { + for (final PersistenceUnit unit : persistence.getPersistenceUnit()) { if (unit == value) { if (strUrls.contains(rootUrl)) { return true;
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/QuickContextXmlParser.java URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/QuickContextXmlParser.java?rev=1569795&r1=1569794&r2=1569795&view=diff ============================================================================== --- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/QuickContextXmlParser.java (original) +++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/QuickContextXmlParser.java Wed Feb 19 15:47:58 2014 @@ -83,7 +83,7 @@ public class QuickContextXmlParser exten if (virtualClasspath != null) { final StringTokenizer tkn = new StringTokenizer(virtualClasspath, ";"); while (tkn.hasMoreTokens()) { - String token = tkn.nextToken().trim(); + final String token = tkn.nextToken().trim(); if (token.isEmpty()) { continue; } Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/ReadDescriptors.java URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/ReadDescriptors.java?rev=1569795&r1=1569794&r2=1569795&view=diff ============================================================================== --- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/ReadDescriptors.java (original) +++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/ReadDescriptors.java Wed Feb 19 15:47:58 2014 @@ -179,7 +179,7 @@ public class ReadDescriptors implements persistenceModule.getWatchedResources().add(path); } appModule.addPersistenceModule(persistenceModule); - } catch (Exception e1) { + } catch (final Exception e1) { DeploymentLoader.logger.error("Unable to load Persistence Unit from EAR: " + appModule.getJarLocation() + ", module: " + moduleName + ". Exception: " + e1.getMessage(), e1); } } @@ -233,7 +233,7 @@ public class ReadDescriptors implements } } } - } catch (Exception e1) { + } catch (final Exception e1) { DeploymentLoader.logger.error("Unable to load Persistence Unit Fragment from EAR: " + appModule.getJarLocation() + ", fragment: " + persistenceFragmentUrl.toString() + ". Exception: " + e1.getMessage(), e1); } } @@ -250,7 +250,7 @@ public class ReadDescriptors implements try { final Resources openejb = JaxbOpenejb.unmarshal(Resources.class, url.get()); module.initResources(openejb); - } catch (Exception e) { + } catch (final Exception e) { logger.warning("can't read " + url.toString() + " to load resources for module " + module.toString(), e); } } @@ -261,7 +261,7 @@ public class ReadDescriptors implements try { final Resources openejb = JSonConfigReader.read(Resources.class, url.get()); module.initResources(openejb); - } catch (Exception e) { + } catch (final Exception e) { logger.warning("can't read " + url.toString() + " to load resources for module " + module.toString(), e); } } @@ -278,7 +278,7 @@ public class ReadDescriptors implements try { final ValidationConfigType validationConfigType = JaxbOpenejb.unmarshal(ValidationConfigType.class, ((Source) value).get(), false); module.setValidationConfig(validationConfigType); - } catch (Exception e) { + } catch (final Exception e) { logger.warning("can't read validation.xml to construct a validation factory, it will be ignored"); } } @@ -325,7 +325,7 @@ public class ReadDescriptors implements } } }); - } catch (Exception dontCare) { + } catch (final Exception dontCare) { // no-op } @@ -334,7 +334,7 @@ public class ReadDescriptors implements File tempFile = null; try { tempFile = File.createTempFile("openejb-jar-", ".xml"); - } catch (Throwable e) { + } catch (final Throwable e) { final File tmp = new File("tmp"); if (!tmp.exists() && !tmp.mkdirs()) { throw new IOException("Failed to create local tmp directory: " + tmp.getAbsolutePath()); @@ -344,11 +344,11 @@ public class ReadDescriptors implements } try { IO.copy(source.get(), tempFile); - } catch (IOException e) { + } catch (final IOException e) { // no-op } filePath = tempFile.getAbsolutePath(); - } catch (IOException e) { + } catch (final IOException e) { // no-op } @@ -389,7 +389,7 @@ public class ReadDescriptors implements } ejbModule.getAltDDs().put("geronimo-openejb.xml", geronimoEjbJarType); } - } catch (Exception e) { + } catch (final Exception e) { throw new OpenEJBException("Failed parsing geronimo-openejb.xml", e); } } @@ -422,7 +422,7 @@ public class ReadDescriptors implements try { final EjbJar ejbJar = readEjbJar(data.get()); ejbModule.setEjbJar(ejbJar); - } catch (IOException e) { + } catch (final IOException e) { throw new OpenEJBException(e); } } else { @@ -458,7 +458,7 @@ public class ReadDescriptors implements final Beans beans = readBeans(data.get()); checkDuplicatedByBeansXml(beans, beans); ejbModule.setBeans(beans); - } catch (IOException e) { + } catch (final IOException e) { throw new OpenEJBException(e); } } else if (raw instanceof Beans) { @@ -475,13 +475,13 @@ public class ReadDescriptors implements try { final EntityMappings entitymappings = (EntityMappings) JaxbJavaee.unmarshalJavaee(EntityMappings.class, IO.read(url)); ejbModule.getAltDDs().put("openejb-cmp-orm.xml", entitymappings); - } catch (SAXException e) { + } catch (final SAXException e) { throw new OpenEJBException("Cannot parse the openejb-cmp-orm.xml file: " + url.toExternalForm(), e); - } catch (JAXBException e) { + } catch (final JAXBException e) { throw new OpenEJBException("Cannot unmarshall the openejb-cmp-orm.xml file: " + url.toExternalForm(), e); - } catch (IOException e) { + } catch (final IOException e) { throw new OpenEJBException("Cannot read the openejb-cmp-orm.xml file: " + url.toExternalForm(), e); - } catch (Exception e) { + } catch (final Exception e) { throw new OpenEJBException("Encountered unknown error parsing the openejb-cmp-orm.xml file: " + url.toExternalForm(), e); } } @@ -566,13 +566,13 @@ public class ReadDescriptors implements final ApplicationClient applicationClient; try { applicationClient = ApplicationClientXml.unmarshal(url); - } catch (SAXException e) { + } catch (final SAXException e) { throw new OpenEJBException("Cannot parse the application-client.xml file: " + url.toExternalForm(), e); - } catch (JAXBException e) { + } catch (final JAXBException e) { throw new OpenEJBException("Cannot unmarshall the application-client.xml file: " + url.toExternalForm(), e); - } catch (IOException e) { + } catch (final IOException e) { throw new OpenEJBException("Cannot read the application-client.xml file: " + url.toExternalForm(), e); - } catch (Exception e) { + } catch (final Exception e) { throw new OpenEJBException("Encountered unknown error parsing the application-client.xml file: " + url.toExternalForm(), e); } return applicationClient; @@ -586,11 +586,11 @@ public class ReadDescriptors implements return new EjbJar(id); } return EjbJarXml.unmarshal(new ByteArrayInputStream(content.getBytes())); - } catch (SAXException e) { + } catch (final SAXException e) { throw new OpenEJBException("Cannot parse the ejb-jar.xml"); // file: " + url.toExternalForm(), e); - } catch (IOException e) { + } catch (final IOException e) { throw new OpenEJBException("Cannot read the ejb-jar.xml"); // file: " + url.toExternalForm(), e); - } catch (Exception e) { + } catch (final Exception e) { throw new OpenEJBException("Encountered error parsing the ejb-jar.xml"); // file: " + url.toExternalForm(), e); } } @@ -600,14 +600,14 @@ public class ReadDescriptors implements final String content = IO.slurp(inputStream); if (isEmptyBeansXml(new ByteArrayInputStream(content.getBytes()))) return new Beans(); return (Beans) JaxbJavaee.unmarshalJavaee(Beans.class, new ByteArrayInputStream(content.getBytes())); - } catch (SAXException e) { + } catch (final SAXException e) { throw new OpenEJBException("Cannot parse the beans.xml");// file: " + url.toExternalForm(), e); - } catch (JAXBException e) { + } catch (final JAXBException e) { e.printStackTrace(); throw new OpenEJBException("Cannot unmarshall the beans.xml");// file: " + url.toExternalForm(), e); - } catch (IOException e) { + } catch (final IOException e) { throw new OpenEJBException("Cannot read the beans.xml");// file: " + url.toExternalForm(), e); - } catch (Exception e) { + } catch (final Exception e) { throw new OpenEJBException("Encountered unknown error parsing the beans.xml");// file: " + url.toExternalForm(), e); } } @@ -637,7 +637,7 @@ public class ReadDescriptors implements } }); return true; - } catch (SAXException e) { + } catch (final SAXException e) { return in.getLength() == 0; } } @@ -660,7 +660,7 @@ public class ReadDescriptors implements return new InputSource(new ByteArrayInputStream(new byte[0])); } }); - } catch (Exception e) { + } catch (final Exception e) { // no-op } @@ -670,13 +670,13 @@ public class ReadDescriptors implements public static Webservices readWebservices(final URL url) throws OpenEJBException { try { return WebservicesXml.unmarshal(url); - } catch (SAXException e) { + } catch (final SAXException e) { throw new OpenEJBException("Cannot parse the webservices.xml file: " + url.toExternalForm(), e); - } catch (JAXBException e) { + } catch (final JAXBException e) { throw new OpenEJBException("Cannot unmarshall the webservices.xml file: " + url.toExternalForm(), e); - } catch (IOException e) { + } catch (final IOException e) { throw new OpenEJBException("Cannot read the webservices.xml file: " + url.toExternalForm(), e); - } catch (Exception e) { + } catch (final Exception e) { throw new OpenEJBException("Encountered unknown error parsing the webservices.xml file: " + url.toExternalForm(), e); } } @@ -684,13 +684,13 @@ public class ReadDescriptors implements public static HandlerChains readHandlerChains(final URL url) throws OpenEJBException { try { return HandlerChainsXml.unmarshal(url); - } catch (SAXException e) { + } catch (final SAXException e) { throw new OpenEJBException("Cannot parse the webservices.xml file: " + url.toExternalForm(), e); - } catch (JAXBException e) { + } catch (final JAXBException e) { throw new OpenEJBException("Cannot unmarshall the webservices.xml file: " + url.toExternalForm(), e); - } catch (IOException e) { + } catch (final IOException e) { throw new OpenEJBException("Cannot read the webservices.xml file: " + url.toExternalForm(), e); - } catch (Exception e) { + } catch (final Exception e) { throw new OpenEJBException("Encountered unknown error parsing the webservices.xml file: " + url.toExternalForm(), e); } } @@ -699,13 +699,13 @@ public class ReadDescriptors implements final JavaWsdlMapping wsdlMapping; try { wsdlMapping = (JavaWsdlMapping) JaxbJavaee.unmarshalJavaee(JavaWsdlMapping.class, IO.read(url)); - } catch (SAXException e) { + } catch (final SAXException e) { throw new OpenEJBException("Cannot parse the JaxRPC mapping file: " + url.toExternalForm(), e); - } catch (JAXBException e) { + } catch (final JAXBException e) { throw new OpenEJBException("Cannot unmarshall the JaxRPC mapping file: " + url.toExternalForm(), e); - } catch (IOException e) { + } catch (final IOException e) { throw new OpenEJBException("Cannot read the JaxRPC mapping file: " + url.toExternalForm(), e); - } catch (Exception e) { + } catch (final Exception e) { throw new OpenEJBException("Encountered unknown error parsing the JaxRPC mapping file: " + url.toExternalForm(), e); } return wsdlMapping; @@ -715,24 +715,24 @@ public class ReadDescriptors implements Connector connector; try { connector = (Connector) JaxbJavaee.unmarshalJavaee(Connector.class, IO.read(url)); - } catch (JAXBException e) { + } catch (final JAXBException e) { try { final Connector10 connector10 = (Connector10) JaxbJavaee.unmarshalJavaee(Connector10.class, IO.read(url)); connector = Connector.newConnector(connector10); - } catch (ParserConfigurationException e1) { + } catch (final ParserConfigurationException e1) { throw new OpenEJBException("Cannot parse the ra.xml file: " + url.toExternalForm(), e); - } catch (SAXException e1) { + } catch (final SAXException e1) { throw new OpenEJBException("Cannot parse the ra.xml file: " + url.toExternalForm(), e); - } catch (JAXBException e1) { + } catch (final JAXBException e1) { throw new OpenEJBException("Cannot unmarshall the ra.xml file: " + url.toExternalForm(), e); - } catch (IOException e1) { + } catch (final IOException e1) { throw new OpenEJBException("Cannot read the ra.xml file: " + url.toExternalForm(), e); } - } catch (SAXException e) { + } catch (final SAXException e) { throw new OpenEJBException("Cannot parse the ra.xml file: " + url.toExternalForm(), e); - } catch (IOException e) { + } catch (final IOException e) { throw new OpenEJBException("Cannot read the ra.xml file: " + url.toExternalForm(), e); - } catch (Exception e) { + } catch (final Exception e) { throw new OpenEJBException("Encountered unknown error parsing the ra.xml file: " + url.toExternalForm(), e); } return connector; @@ -742,13 +742,13 @@ public class ReadDescriptors implements final WebApp webApp; try { webApp = (WebApp) WebXml.unmarshal(url); - } catch (SAXException e) { + } catch (final SAXException e) { throw new OpenEJBException("Cannot parse the web.xml file: " + url.toExternalForm(), e); - } catch (JAXBException e) { + } catch (final JAXBException e) { throw new OpenEJBException("Cannot unmarshall the web.xml file: " + url.toExternalForm(), e); - } catch (IOException e) { + } catch (final IOException e) { throw new OpenEJBException("Cannot read the web.xml file: " + url.toExternalForm(), e); - } catch (Exception e) { + } catch (final Exception e) { throw new OpenEJBException("Encountered unknown error parsing the web.xml file: " + url.toExternalForm(), e); } return webApp; @@ -769,19 +769,19 @@ public class ReadDescriptors implements try { return TldTaglibXml.unmarshal(url); - } catch (SAXException e) { + } catch (final SAXException e) { final String message = "Cannot parse the JSP tag library definition file: " + url.toExternalForm(); logger.warning(message); logger.debug(message, e); - } catch (JAXBException e) { + } catch (final JAXBException e) { final String message = "Cannot unmarshall the JSP tag library definition file: " + url.toExternalForm(); logger.warning(message); logger.debug(message, e); - } catch (IOException e) { + } catch (final IOException e) { final String message = "Cannot read the JSP tag library definition file: " + url.toExternalForm(); logger.warning(message); logger.debug(message, e); - } catch (Exception e) { + } catch (final Exception e) { final String message = "Encountered unknown error parsing the JSP tag library definition file: " + url.toExternalForm(); logger.warning(message); logger.debug(message, e); @@ -801,13 +801,13 @@ public class ReadDescriptors implements return new FacesConfig(); } return FacesConfigXml.unmarshal(new ByteArrayInputStream(content.getBytes())); - } catch (SAXException e) { + } catch (final SAXException e) { throw new OpenEJBException("Cannot parse the faces configuration file: " + url.toExternalForm(), e); - } catch (JAXBException e) { + } catch (final JAXBException e) { throw new OpenEJBException("Cannot unmarshall the faces configuration file: " + url.toExternalForm(), e); - } catch (IOException e) { + } catch (final IOException e) { throw new OpenEJBException("Cannot read the faces configuration file: " + url.toExternalForm(), e); - } catch (Exception e) { + } catch (final Exception e) { throw new OpenEJBException("Encountered unknown error parsing the faces configuration file: " + url.toExternalForm(), e); } } Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/RemoteServer.java URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/RemoteServer.java?rev=1569795&r1=1569794&r2=1569795&view=diff ============================================================================== --- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/RemoteServer.java (original) +++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/RemoteServer.java Wed Feb 19 15:47:58 2014 @@ -115,7 +115,7 @@ public class RemoteServer { if (server != null) { try { server.waitFor(); - } catch (InterruptedException e) { + } catch (final InterruptedException e) { // no-op } } @@ -308,7 +308,7 @@ public class RemoteServer { server.waitFor(); } - } catch (Exception e) { + } catch (final Exception e) { throw (RuntimeException) new OpenEJBRuntimeException("Cannot start the server. Exception: " + e.getClass().getName() + ": " + e.getMessage()).initCause(e); } if (checkPortAvailable) { @@ -342,11 +342,11 @@ public class RemoteServer { } server.exitValue(); end = true; - } catch (IllegalThreadStateException e) { + } catch (final IllegalThreadStateException e) { i++; try { Thread.sleep(Integer.getInteger("sleep", 5000 * 60)); - } catch (InterruptedException e1) { + } catch (final InterruptedException e1) { e1.printStackTrace(); } if (i == 5) { @@ -371,7 +371,7 @@ public class RemoteServer { f.setAccessible(true); final int pid = (Integer) f.get(server); Pipe.pipe(Runtime.getRuntime().exec("kill -3 " + pid)); - } catch (Exception e1) { + } catch (final Exception e1) { e1.printStackTrace(); } } @@ -438,7 +438,7 @@ public class RemoteServer { if (!serverHasAlreadyBeenStarted) { try { shutdown(); - } catch (Exception e) { + } catch (final Exception e) { if (verbose) { e.printStackTrace(System.err); } @@ -487,7 +487,7 @@ public class RemoteServer { if (socket != null) { try { socket.close(); - } catch (IOException e) { + } catch (final IOException e) { // Ignore } } @@ -510,7 +510,7 @@ public class RemoteServer { if (verbose) { System.out.println("[] CONNECTED IN " + (this.tries - tries)); } - } catch (Exception e) { + } catch (final Exception e) { if (tries < 2) { if (verbose) { System.out.println("[] CONNECT ATTEMPTS FAILED ( " + (this.tries - tries) + " tries)"); @@ -519,7 +519,7 @@ public class RemoteServer { } else { try { Thread.sleep(2000); - } catch (Exception e2) { + } catch (final Exception e2) { e.printStackTrace(); } return connect(--tries); @@ -528,7 +528,7 @@ public class RemoteServer { if (s != null) { try { s.close(); - } catch (Exception ignored) { + } catch (final Exception ignored) { // no-op } } @@ -560,7 +560,7 @@ public class RemoteServer { server.destroy(); server.waitFor(); } - } catch (Throwable e) { + } catch (final Throwable e) { //Ignore } } Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/RemoveWebServices.java URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/RemoveWebServices.java?rev=1569795&r1=1569794&r2=1569795&view=diff ============================================================================== --- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/RemoveWebServices.java (original) +++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/RemoveWebServices.java Wed Feb 19 15:47:58 2014 @@ -39,17 +39,17 @@ import java.util.Map; */ class RemoveWebServices implements DynamicDeployer { - public AppModule deploy(AppModule appModule) throws OpenEJBException { + public AppModule deploy(final AppModule appModule) throws OpenEJBException { - for (EjbModule ejbModule : appModule.getEjbModules()) { - EjbJar ejbJar = ejbModule.getEjbJar(); - OpenejbJar openejbJar = ejbModule.getOpenejbJar(); - Map<String, EjbDeployment> deployments = openejbJar.getDeploymentsByEjbName(); + for (final EjbModule ejbModule : appModule.getEjbModules()) { + final EjbJar ejbJar = ejbModule.getEjbJar(); + final OpenejbJar openejbJar = ejbModule.getOpenejbJar(); + final Map<String, EjbDeployment> deployments = openejbJar.getDeploymentsByEjbName(); - for (EnterpriseBean bean : ejbJar.getEnterpriseBeans()) { + for (final EnterpriseBean bean : ejbJar.getEnterpriseBeans()) { - String ejbName = bean.getEjbName(); - EjbDeployment ejbDeployment = deployments.get(ejbName); + final String ejbName = bean.getEjbName(); + final EjbDeployment ejbDeployment = deployments.get(ejbName); // Clear any <service-ref> references from ejbs bean.getServiceRef().clear(); @@ -58,7 +58,7 @@ class RemoveWebServices implements Dynam continue; } - SessionBean sessionBean = (SessionBean) bean; + final SessionBean sessionBean = (SessionBean) bean; if (sessionBean.getServiceEndpoint() == null) continue; @@ -77,10 +77,10 @@ class RemoveWebServices implements Dynam // As well, let's get rid of any transaction or security attributes // associated with the bean we just deleted. - AssemblyDescriptor assemblyDescriptor = ejbJar.getAssemblyDescriptor(); + final AssemblyDescriptor assemblyDescriptor = ejbJar.getAssemblyDescriptor(); if (assemblyDescriptor != null) { - for (MethodPermission permission : copy(assemblyDescriptor.getMethodPermission())) { - for (Method method : copy(permission.getMethod())) { + for (final MethodPermission permission : copy(assemblyDescriptor.getMethodPermission())) { + for (final Method method : copy(permission.getMethod())) { if (method.getEjbName().equals(ejbName)) { permission.getMethod().remove(method); } @@ -90,8 +90,8 @@ class RemoveWebServices implements Dynam } } - for (ContainerTransaction transaction : copy(assemblyDescriptor.getContainerTransaction())) { - for (Method method : copy(transaction.getMethod())) { + for (final ContainerTransaction transaction : copy(assemblyDescriptor.getContainerTransaction())) { + for (final Method method : copy(transaction.getMethod())) { if (method.getEjbName().equals(ejbName)) { transaction.getMethod().remove(method); } @@ -101,7 +101,7 @@ class RemoveWebServices implements Dynam } } - for (InterceptorBinding binding : copy(assemblyDescriptor.getInterceptorBinding())) { + for (final InterceptorBinding binding : copy(assemblyDescriptor.getInterceptorBinding())) { if (binding.getEjbName().equals(ejbName)) { assemblyDescriptor.getInterceptorBinding().remove(binding); } @@ -110,7 +110,7 @@ class RemoveWebServices implements Dynam } // Clear any <service-ref> references from interceptors - for (Interceptor interceptor : ejbJar.getInterceptors()) { + for (final Interceptor interceptor : ejbJar.getInterceptors()) { interceptor.getServiceRef().clear(); } @@ -118,7 +118,7 @@ class RemoveWebServices implements Dynam return appModule; } - public <T> List<T> copy(Collection<T> list) { + public <T> List<T> copy(final Collection<T> list) { return new ArrayList<T>(list); } } Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/ReportValidationResults.java URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/ReportValidationResults.java?rev=1569795&r1=1569794&r2=1569795&view=diff ============================================================================== --- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/ReportValidationResults.java (original) +++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/ReportValidationResults.java Wed Feb 19 15:47:58 2014 @@ -41,32 +41,32 @@ public class ReportValidationResults imp VERBOSE } - public AppModule deploy(AppModule appModule) throws OpenEJBException { - Level level = SystemInstance.get().getOptions().get(VALIDATION_LEVEL, Level.MEDIUM); + public AppModule deploy(final AppModule appModule) throws OpenEJBException { + final Level level = SystemInstance.get().getOptions().get(VALIDATION_LEVEL, Level.MEDIUM); - boolean hasErrors = appModule.hasErrors(); - boolean hasFailures = appModule.hasFailures(); - boolean hasWarnings = appModule.hasWarnings(); + final boolean hasErrors = appModule.hasErrors(); + final boolean hasFailures = appModule.hasFailures(); + final boolean hasWarnings = appModule.hasWarnings(); if (!hasErrors && !hasFailures && !hasWarnings) return appModule; - ValidationFailedException validationFailedException = null; + final ValidationFailedException validationFailedException = null; - List<ValidationContext> contexts = appModule.getValidationContexts(); + final List<ValidationContext> contexts = appModule.getValidationContexts(); - for (ValidationContext context : contexts) { + for (final ValidationContext context : contexts) { logResults(context, level); } - ValidationContext uberContext = new ValidationContext(appModule); - for (ValidationContext context : contexts) { - for (ValidationError error : context.getErrors()) { + final ValidationContext uberContext = new ValidationContext(appModule); + for (final ValidationContext context : contexts) { + for (final ValidationError error : context.getErrors()) { uberContext.addError(error); } - for (ValidationFailure failure : context.getFailures()) { + for (final ValidationFailure failure : context.getFailures()) { uberContext.addFailure(failure); } - for (ValidationWarning warning : context.getWarnings()) { + for (final ValidationWarning warning : context.getWarnings()) { uberContext.addWarning(warning); } } @@ -83,23 +83,23 @@ public class ReportValidationResults imp throw new ValidationFailedException("Module failed validation. " + uberContext.getModuleType() + "(name=" + uberContext.getName() + ")", uberContext, validationFailedException); } - private void logResults(ValidationContext context, Level level) { + private void logResults(final ValidationContext context, final Level level) { - for (ValidationError e : context.getErrors()) { + for (final ValidationError e : context.getErrors()) { logger.error(e.getPrefix() + " ... " + e.getComponentName() + ":\t" + e.getMessage(level.ordinal() + 1)); } - for (ValidationFailure e : context.getFailures()) { + for (final ValidationFailure e : context.getFailures()) { logger.error(e.getPrefix() + " ... " + e.getComponentName() + ":\t" + e.getMessage(level.ordinal() + 1)); } - for (ValidationWarning e : context.getWarnings()) { + for (final ValidationWarning e : context.getWarnings()) { logger.warning(e.getPrefix() + " ... " + e.getComponentName() + ":\t" + e.getMessage(level.ordinal() + 1)); } if (context.hasErrors() || context.hasFailures()) { - DeploymentModule module = context.getModule(); + final DeploymentModule module = context.getModule(); logger.error(String.format("Invalid %s(name=%s, path=%s)", context.getModuleType(), module.getModuleId(), module.getFile())); // logger.error("Validation: "+errors.length + " errors, "+failures.length+ " failures, in "+context.getModuleType()+"(path="+context.getJarPath()+")"); } else if (context.hasWarnings()) { Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/ScanUtil.java URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/ScanUtil.java?rev=1569795&r1=1569794&r2=1569795&view=diff ============================================================================== --- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/ScanUtil.java (original) +++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/ScanUtil.java Wed Feb 19 15:47:58 2014 @@ -39,7 +39,7 @@ public final class ScanUtil { final ScanHandler handler = new ScanHandler(); parser.parse(new BufferedInputStream(scanXml.openStream()), handler); return handler; - } catch (Exception e) { + } catch (final Exception e) { throw new IOException("can't parse " + scanXml.toExternalForm()); } } @@ -50,7 +50,7 @@ public final class ScanUtil { private Set<String> current = null; @Override - public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { + public void startElement(final String uri, final String localName, final String qName, final Attributes attributes) throws SAXException { if (qName.equals("class")) { current = classes; } else if (qName.equals("package")) { @@ -59,7 +59,7 @@ public final class ScanUtil { } @Override - public void characters(char[] ch, int start, int length) throws SAXException { + public void characters(final char[] ch, final int start, final int length) throws SAXException { if (current != null) { current.add(new String(ch, start, length)); } Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/ServiceUtils.java URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/ServiceUtils.java?rev=1569795&r1=1569794&r2=1569795&view=diff ============================================================================== --- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/ServiceUtils.java (original) +++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/ServiceUtils.java Wed Feb 19 15:47:58 2014 @@ -46,17 +46,17 @@ public class ServiceUtils { static { String defaultValue = "org.apache.openejb"; try { - SystemInstance system = SystemInstance.get(); + final SystemInstance system = SystemInstance.get(); if (system.getProperty("openejb.embedded") != null){ defaultValue = "org.apache.openejb.embedded"; } - } catch (Exception ignored) { + } catch (final Exception ignored) { // no-op } DEFAULT_PROVIDER_URL = defaultValue; } - private static String currentDefaultProviderUrl(String defaultValue) { + private static String currentDefaultProviderUrl(final String defaultValue) { return SystemInstance.get().getProperty("openejb.provider.default", defaultValue); } @@ -75,7 +75,7 @@ public class ServiceUtils { private final String packageName; private final String serviceName; - public ProviderInfo(String providerName, String serviceName) { + public ProviderInfo(final String providerName, final String serviceName) { this.packageName = providerName; this.serviceName = serviceName; } @@ -89,26 +89,26 @@ public class ServiceUtils { } } - public static boolean hasServiceProvider(String id) { + public static boolean hasServiceProvider(final String id) { try { - ProviderInfo info = getProviderInfo(id); + final ProviderInfo info = getProviderInfo(id); - List<ServiceProvider> services = getServiceProviders(info.getPackageName()); + final List<ServiceProvider> services = getServiceProviders(info.getPackageName()); - for (ServiceProvider service : services) { + for (final ServiceProvider service : services) { if (service.getId().equals(id)) { return true; } } - } catch (OpenEJBException ignored) { + } catch (final OpenEJBException ignored) { // someone else will load the file and get the exception - } catch (IllegalStateException ise) { + } catch (final IllegalStateException ise) { // can happen if nothing is found, same } return false; } - public static ServiceProvider getServiceProvider(String idString) throws OpenEJBException { + public static ServiceProvider getServiceProvider(final String idString) throws OpenEJBException { final ID id = ID.parse(idString, currentDefaultProviderUrl(DEFAULT_PROVIDER_URL)); { @@ -119,24 +119,24 @@ public class ServiceUtils { throw new NoSuchProviderException(messages.format("conf.4901", id.getName(), id.getNamespace())); } - public static String getServiceProviderId(String type) throws OpenEJBException { + public static String getServiceProviderId(final String type) throws OpenEJBException { return getServiceProviderId(type, null); } - public static String getServiceProviderId(String type, Properties required) throws OpenEJBException { - ServiceProvider provider = getServiceProviderByType(type, required); + public static String getServiceProviderId(final String type, final Properties required) throws OpenEJBException { + final ServiceProvider provider = getServiceProviderByType(type, required); return provider != null? provider.getId(): null; } - public static List<ServiceProvider> getServiceProvidersByServiceType(String type) throws OpenEJBException { - ArrayList<ServiceProvider> providers = new ArrayList<ServiceProvider>(); + public static List<ServiceProvider> getServiceProvidersByServiceType(final String type) throws OpenEJBException { + final ArrayList<ServiceProvider> providers = new ArrayList<ServiceProvider>(); if (type == null) return providers; - List<ServiceProvider> services = getServiceProviders(currentDefaultProviderUrl(DEFAULT_PROVIDER_URL)); + final List<ServiceProvider> services = getServiceProviders(currentDefaultProviderUrl(DEFAULT_PROVIDER_URL)); - for (ServiceProvider service : services) { + for (final ServiceProvider service : services) { if (service.getService().equals(type)) { providers.add(service); } @@ -145,13 +145,13 @@ public class ServiceUtils { return providers; } - public static ServiceProvider getServiceProviderByType(String type, Properties required) throws OpenEJBException { + public static ServiceProvider getServiceProviderByType(final String type, Properties required) throws OpenEJBException { if (type == null) return null; if (required == null) required = new Properties(); - List<ServiceProvider> services = getServiceProviders(currentDefaultProviderUrl(DEFAULT_PROVIDER_URL)); + final List<ServiceProvider> services = getServiceProviders(currentDefaultProviderUrl(DEFAULT_PROVIDER_URL)); - for (ServiceProvider service : services) { + for (final ServiceProvider service : services) { if (service.getTypes().contains(type) && implies(required, service.getProperties())) { return service; } @@ -160,12 +160,12 @@ public class ServiceUtils { return null; } - public static boolean implies(Properties required, Properties available) { + public static boolean implies(final Properties required, final Properties available) { if (available.containsKey("openejb.connector")) { // created from a connector so our JtaManaged etc can't be used return true; } - for (Map.Entry<Object, Object> entry : required.entrySet()) { + for (final Map.Entry<Object, Object> entry : required.entrySet()) { Object value = available.get(entry.getKey()); Object expected = entry.getValue(); @@ -186,12 +186,12 @@ public class ServiceUtils { } - public static ServiceProvider getServiceProviderByType(String providerType, String serviceType) throws OpenEJBException { + public static ServiceProvider getServiceProviderByType(final String providerType, final String serviceType) throws OpenEJBException { if (serviceType == null) return null; - List<ServiceProvider> services = getServiceProvidersByServiceType(providerType); + final List<ServiceProvider> services = getServiceProvidersByServiceType(providerType); - for (ServiceProvider service : services) { + for (final ServiceProvider service : services) { if (service.getTypes().contains(serviceType)) { return service; } @@ -204,15 +204,15 @@ public class ServiceUtils { return getServiceProviders(currentDefaultProviderUrl(DEFAULT_PROVIDER_URL)); } - public static List<ServiceProvider> getServiceProviders(String packageName) throws OpenEJBException { + public static List<ServiceProvider> getServiceProviders(final String packageName) throws OpenEJBException { return getManager().load(packageName); } - public static void registerServiceProvider(String packageName, ServiceProvider provider) { + public static void registerServiceProvider(final String packageName, final ServiceProvider provider) { getManager().register(packageName, provider); } - private static ProviderInfo getProviderInfo(String id) { + private static ProviderInfo getProviderInfo(final String id) { String providerName = null; String serviceName = null;