You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by tv...@apache.org on 2014/02/19 16:48:09 UTC

svn commit: r1569795 [3/35] - in /tomee/tomee/trunk/container/openejb-core/src/main: config/pmd/ java/javax/xml/ws/ java/javax/xml/ws/wsaddressing/ java/org/apache/openejb/ java/org/apache/openejb/assembler/ java/org/apache/openejb/assembler/classic/ j...

Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/EnterpriseBeanBuilder.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/EnterpriseBeanBuilder.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/EnterpriseBeanBuilder.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/EnterpriseBeanBuilder.java Wed Feb 19 15:47:58 2014
@@ -53,7 +53,7 @@ class EnterpriseBeanBuilder {
     private final ModuleContext moduleContext;
     private final List<Injection> moduleInjections;
 
-    public EnterpriseBeanBuilder(EnterpriseBeanInfo bean, ModuleContext moduleContext, List<Injection> moduleInjections) {
+    public EnterpriseBeanBuilder(final EnterpriseBeanInfo bean, final ModuleContext moduleContext, final List<Injection> moduleInjections) {
         this.moduleContext = moduleContext;
         this.bean = bean;
         this.moduleInjections = moduleInjections;
@@ -69,7 +69,7 @@ class EnterpriseBeanBuilder {
         } else if (bean.type == EnterpriseBeanInfo.MESSAGE) {
             ejbType = BeanType.MESSAGE_DRIVEN;
         } else if (bean.type == EnterpriseBeanInfo.ENTITY) {
-            String persistenceType = ((EntityBeanInfo) bean).persistenceType;
+            final String persistenceType = ((EntityBeanInfo) bean).persistenceType;
             ejbType = persistenceType.equalsIgnoreCase("Container") ? BeanType.CMP_ENTITY : BeanType.BMP_ENTITY;
         } else {
             throw new UnsupportedOperationException("No building support for bean type: " + bean);
@@ -102,13 +102,13 @@ class EnterpriseBeanBuilder {
             local = loadClass(bean.local, "classNotFound.local");
         }
 
-        List<Class> businessLocals = new ArrayList<Class>();
-        for (String businessLocal : bean.businessLocal) {
+        final List<Class> businessLocals = new ArrayList<Class>();
+        for (final String businessLocal : bean.businessLocal) {
             businessLocals.add(loadClass(businessLocal, "classNotFound.businessLocal"));
         }
 
-        List<Class> businessRemotes = new ArrayList<Class>();
-        for (String businessRemote : bean.businessRemote) {
+        final List<Class> businessRemotes = new ArrayList<Class>();
+        for (final String businessRemote : bean.businessRemote) {
             businessRemotes.add(loadClass(businessRemote, "classNotFound.businessRemote"));
         }
 
@@ -121,44 +121,44 @@ class EnterpriseBeanBuilder {
 
         Class primaryKey = null;
         if (ejbType.isEntity() && ((EntityBeanInfo) bean).primKeyClass != null) {
-            String className = ((EntityBeanInfo) bean).primKeyClass;
+            final String className = ((EntityBeanInfo) bean).primKeyClass;
             primaryKey = loadClass(className, "classNotFound.primaryKey");
         }
 
         final String transactionType = bean.transactionType;
 
         // determine the injections
-        InjectionBuilder injectionBuilder = new InjectionBuilder(moduleContext.getClassLoader());
-        List<Injection> injections = injectionBuilder.buildInjections(bean.jndiEnc);
-        Set<Class<?>> relevantClasses = new HashSet<Class<?>>();
+        final InjectionBuilder injectionBuilder = new InjectionBuilder(moduleContext.getClassLoader());
+        final List<Injection> injections = injectionBuilder.buildInjections(bean.jndiEnc);
+        final Set<Class<?>> relevantClasses = new HashSet<Class<?>>();
         Class c = ejbClass;
         do {
             relevantClasses.add(c);
             c = c.getSuperclass();
         } while (c != null && c != Object.class);
 
-        for (Injection injection: moduleInjections) {
+        for (final Injection injection: moduleInjections) {
             if (relevantClasses.contains(injection.getTarget())) {
                 injections.add(injection);
             }
         }
 
         // build the enc
-        JndiEncBuilder jndiEncBuilder = new JndiEncBuilder(bean.jndiEnc, injections, transactionType, moduleContext.getId(), null, moduleContext.getUniqueId(), moduleContext.getClassLoader());
-        Context compJndiContext = jndiEncBuilder.build(JndiEncBuilder.JndiScope.comp);
+        final JndiEncBuilder jndiEncBuilder = new JndiEncBuilder(bean.jndiEnc, injections, transactionType, moduleContext.getId(), null, moduleContext.getUniqueId(), moduleContext.getClassLoader());
+        final Context compJndiContext = jndiEncBuilder.build(JndiEncBuilder.JndiScope.comp);
         bind(compJndiContext, "module", moduleContext.getModuleJndiContext());
         bind(compJndiContext, "app", moduleContext.getAppContext().getAppJndiContext());
         bind(compJndiContext, "global", moduleContext.getAppContext().getGlobalJndiContext());
 
-        BeanContext deployment;
+        final BeanContext deployment;
         if (BeanType.MESSAGE_DRIVEN != ejbType) {
             deployment = new BeanContext(bean.ejbDeploymentId, compJndiContext, moduleContext, ejbClass, home, remote, localhome, local, proxy, serviceEndpoint, businessLocals, businessRemotes, primaryKey, ejbType, bean.localbean && ejbType.isSession());
             if (bean instanceof ManagedBeanInfo) {
                 deployment.setHidden(((ManagedBeanInfo) bean).hidden);
             }
         } else {
-            MessageDrivenBeanInfo messageDrivenBeanInfo = (MessageDrivenBeanInfo) bean;
-            Class mdbInterface = loadClass(messageDrivenBeanInfo.mdbInterface, "classNotFound.mdbInterface");
+            final MessageDrivenBeanInfo messageDrivenBeanInfo = (MessageDrivenBeanInfo) bean;
+            final Class mdbInterface = loadClass(messageDrivenBeanInfo.mdbInterface, "classNotFound.mdbInterface");
             deployment = new BeanContext(bean.ejbDeploymentId, compJndiContext, moduleContext, ejbClass, mdbInterface, messageDrivenBeanInfo.activationProperties);
             deployment.setDestinationId(messageDrivenBeanInfo.destinationId);
         }
@@ -180,16 +180,16 @@ class EnterpriseBeanBuilder {
         }
 
         if (bean instanceof StatefulBeanInfo) {
-            StatefulBeanInfo statefulBeanInfo = (StatefulBeanInfo) bean;
+            final StatefulBeanInfo statefulBeanInfo = (StatefulBeanInfo) bean;
 
-            for (InitMethodInfo init : statefulBeanInfo.initMethods) {
-                Method beanMethod = MethodInfoUtil.toMethod(ejbClass, init.beanMethod);
-                List<Method> methods = new ArrayList<Method>();
+            for (final InitMethodInfo init : statefulBeanInfo.initMethods) {
+                final Method beanMethod = MethodInfoUtil.toMethod(ejbClass, init.beanMethod);
+                final List<Method> methods = new ArrayList<Method>();
 
                 if (home != null) methods.addAll(Arrays.asList(home.getMethods()));
                 if (localhome != null) methods.addAll(Arrays.asList(localhome.getMethods()));
 
-                for (Method homeMethod : methods) {
+                for (final Method homeMethod : methods) {
                     if (init.createMethod != null && !init.createMethod.methodName.equals(homeMethod.getName())) continue;
 
                     if (!homeMethod.getName().startsWith("create")) continue;
@@ -200,37 +200,37 @@ class EnterpriseBeanBuilder {
                 }
             }
 
-            for (RemoveMethodInfo removeMethod : statefulBeanInfo.removeMethods) {
+            for (final RemoveMethodInfo removeMethod : statefulBeanInfo.removeMethods) {
                 
                 if (removeMethod.beanMethod.methodParams == null) {
 
-                    MethodInfo methodInfo = new MethodInfo();
+                    final MethodInfo methodInfo = new MethodInfo();
                     methodInfo.methodName = removeMethod.beanMethod.methodName;
                     methodInfo.methodParams = removeMethod.beanMethod.methodParams;
                     methodInfo.className = removeMethod.beanMethod.className;
-                    List<Method> methods = MethodInfoUtil.matchingMethods(methodInfo, ejbClass);
+                    final List<Method> methods = MethodInfoUtil.matchingMethods(methodInfo, ejbClass);
 
-                    for (Method method : methods) {
+                    for (final Method method : methods) {
                         deployment.getRemoveMethods().add(method);
                         deployment.setRetainIfExeption(method, removeMethod.retainIfException);
                     }
 
                 } else {
-                    Method method = MethodInfoUtil.toMethod(ejbClass, removeMethod.beanMethod);
+                    final Method method = MethodInfoUtil.toMethod(ejbClass, removeMethod.beanMethod);
                     deployment.getRemoveMethods().add(method);
                     deployment.setRetainIfExeption(method, removeMethod.retainIfException);
                 }
                 
             }
 
-            Map<EntityManagerFactory, Map> extendedEntityManagerFactories = new HashMap<EntityManagerFactory, Map>();
-            for (PersistenceContextReferenceInfo info : statefulBeanInfo.jndiEnc.persistenceContextRefs) {
+            final Map<EntityManagerFactory, Map> extendedEntityManagerFactories = new HashMap<EntityManagerFactory, Map>();
+            for (final PersistenceContextReferenceInfo info : statefulBeanInfo.jndiEnc.persistenceContextRefs) {
                 if (info.extended) {
                     try {
-                        ContainerSystem containerSystem = SystemInstance.get().getComponent(ContainerSystem.class);
-                        Object o = containerSystem.getJNDIContext().lookup(PersistenceBuilder.getOpenEJBJndiName(info.unitId));
+                        final ContainerSystem containerSystem = SystemInstance.get().getComponent(ContainerSystem.class);
+                        final Object o = containerSystem.getJNDIContext().lookup(PersistenceBuilder.getOpenEJBJndiName(info.unitId));
                         extendedEntityManagerFactories.put((EntityManagerFactory) o, info.properties);
-                    } catch (NamingException e) {
+                    } catch (final NamingException e) {
                         throw new OpenEJBException("PersistenceUnit '" + info.unitId + "' not found for EXTENDED ref '" + info.referenceName + "'");
                     }
 
@@ -255,27 +255,27 @@ class EnterpriseBeanBuilder {
         }
 
         if (ejbType.isEntity()) {
-            EntityBeanInfo entity = (EntityBeanInfo) bean;
+            final EntityBeanInfo entity = (EntityBeanInfo) bean;
 
             deployment.setCmp2(entity.cmpVersion == 2);
             deployment.setIsReentrant(entity.reentrant.equalsIgnoreCase("true"));
 
             if (ejbType == BeanType.CMP_ENTITY) {
                 Class cmpImplClass = null;
-                String cmpImplClassName = CmpUtil.getCmpImplClassName(entity.abstractSchemaName, entity.ejbClass);
+                final String cmpImplClassName = CmpUtil.getCmpImplClassName(entity.abstractSchemaName, entity.ejbClass);
                 cmpImplClass = loadClass(cmpImplClassName, "classNotFound.cmpImplClass");
                 deployment.setCmpImplClass(cmpImplClass);
                 deployment.setAbstractSchemaName(entity.abstractSchemaName);
 
-                for (QueryInfo query : entity.queries) {
+                for (final QueryInfo query : entity.queries) {
 
                     if (query.remoteResultType) {
-                        StringBuilder methodSignature = new StringBuilder();
+                        final StringBuilder methodSignature = new StringBuilder();
                         methodSignature.append(query.method.methodName);
                         if (query.method.methodParams != null && !query.method.methodParams.isEmpty()) {
                             methodSignature.append('(');
                             boolean first = true;
-                            for (String methodParam : query.method.methodParams) {
+                            for (final String methodParam : query.method.methodParams) {
                                 if (!first) methodSignature.append(",");
                                 methodSignature.append(methodParam);
                                 first = false;
@@ -298,11 +298,11 @@ class EnterpriseBeanBuilder {
         //Configure asynchronous tag after the method map is created, so while we check whether the method is asynchronous,
         //we could directly check the matching bean method.
         if (ejbType == BeanType.STATELESS || ejbType == BeanType.SINGLETON || ejbType == BeanType.STATEFUL) {
-            for (NamedMethodInfo methodInfo : bean.asynchronous) {
-                Method method = MethodInfoUtil.toMethod(ejbClass, methodInfo);
+            for (final NamedMethodInfo methodInfo : bean.asynchronous) {
+                final Method method = MethodInfoUtil.toMethod(ejbClass, methodInfo);
                 deployment.getMethodContext(deployment.getMatchingBeanMethod(method)).setAsynchronous(true);
             }
-            for (String className : bean.asynchronousClasses) {
+            for (final String className : bean.asynchronousClasses) {
                 deployment.getAsynchronousClasses().add(loadClass(className, "classNotFound.ejbClass"));
             }
             deployment.createAsynchronousMethodSet();
@@ -311,29 +311,29 @@ class EnterpriseBeanBuilder {
         return deployment;
     }
 
-    private void bind(Context compJndiContext, String s, Context moduleJndiContext) throws OpenEJBException {
-        Context c;
+    private void bind(final Context compJndiContext, final String s, final Context moduleJndiContext) throws OpenEJBException {
+        final Context c;
         try {
             c = (Context) moduleJndiContext.lookup(s);
-        } catch (NamingException e) {
+        } catch (final NamingException e) {
             //ok, nothing there....
             return;
         }
         try {
             compJndiContext.bind(s, c);
-        } catch (NamingException e) {
+        } catch (final NamingException e) {
             throw new OpenEJBException("Could not bind context at " + s, e);
         }
     }
 
-    public static boolean paramsMatch(Method methodA, Method methodB) {
+    public static boolean paramsMatch(final Method methodA, final Method methodB) {
         if (methodA.getParameterTypes().length != methodB.getParameterTypes().length){
             return false;
         }
 
         for (int i = 0; i < methodA.getParameterTypes().length; i++) {
-            Class<?> a = methodA.getParameterTypes()[i];
-            Class<?> b = methodB.getParameterTypes()[i];
+            final Class<?> a = methodA.getParameterTypes()[i];
+            final Class<?> b = methodB.getParameterTypes()[i];
             if (!a.equals(b)) return false;
         }
         return true;
@@ -343,7 +343,7 @@ class EnterpriseBeanBuilder {
         return warnings;
     }
 
-    private Method getTimeout(Class ejbClass, NamedMethodInfo info) {
+    private Method getTimeout(final Class ejbClass, final NamedMethodInfo info) {
         Method timeout = null;
         try {
             if (TimedObject.class.isAssignableFrom(ejbClass)) {
@@ -351,7 +351,7 @@ class EnterpriseBeanBuilder {
             } else if (info != null){
                 try {
                     timeout = MethodInfoUtil.toMethod(ejbClass, info);
-                } catch (IllegalStateException e) {
+                } catch (final IllegalStateException e) {
                     //Spec 18.2.5.3 [102] For the compatibility of timeout method signature, if method-params is  not set, it is also required to search the method signaure below :
                     //void <METHOD> (Timer timer)
 
@@ -360,7 +360,7 @@ class EnterpriseBeanBuilder {
                     // get a validation failure.  Then we can explicitly add the (Timer) param
                     // if the fallback method does exist.
                     if (info.methodParams == null) {
-                        NamedMethodInfo candidateInfo = new NamedMethodInfo();
+                        final NamedMethodInfo candidateInfo = new NamedMethodInfo();
                         candidateInfo.className = info.className;
                         candidateInfo.id = info.id;
                         candidateInfo.methodName = info.methodName;
@@ -369,7 +369,7 @@ class EnterpriseBeanBuilder {
                     }
                 }
             }
-        } catch (Exception e) {
+        } catch (final Exception e) {
             warnings.add(e);
         }
 
@@ -377,30 +377,30 @@ class EnterpriseBeanBuilder {
     }
 
 
-    private Class loadClass(String className, String messageCode) throws OpenEJBException {
-        Class clazz = load(className, messageCode);
+    private Class loadClass(final String className, final String messageCode) throws OpenEJBException {
+        final Class clazz = load(className, messageCode);
         try {
 //            clazz.getDeclaredMethods();
 //            clazz.getDeclaredFields();
 //            clazz.getDeclaredConstructors();
 //            clazz.getInterfaces();
             return clazz;
-        } catch (NoClassDefFoundError e) {
+        } catch (final NoClassDefFoundError e) {
             if (clazz.getClassLoader() != moduleContext.getClassLoader()) {
-                String message = SafeToolkit.messages.format("cl0008", className, clazz.getClassLoader(), moduleContext.getClassLoader(), e.getMessage());
+                final String message = SafeToolkit.messages.format("cl0008", className, clazz.getClassLoader(), moduleContext.getClassLoader(), e.getMessage());
                 throw new OpenEJBException(AssemblerTool.messages.format(messageCode, className, bean.ejbDeploymentId, message), e);
             } else {
-                String message = SafeToolkit.messages.format("cl0009", className, clazz.getClassLoader(), e.getMessage());
+                final String message = SafeToolkit.messages.format("cl0009", className, clazz.getClassLoader(), e.getMessage());
                 throw new OpenEJBException(AssemblerTool.messages.format(messageCode, className, bean.ejbDeploymentId, message), e);
             }
         }
     }
 
-    private Class load(String className, String messageCode) throws OpenEJBException {
+    private Class load(final String className, final String messageCode) throws OpenEJBException {
         try {
             return Class.forName(className, true, moduleContext.getClassLoader());
-        } catch (ClassNotFoundException e) {
-            String message = SafeToolkit.messages.format("cl0007", className, bean.codebase);
+        } catch (final ClassNotFoundException e) {
+            final String message = SafeToolkit.messages.format("cl0007", className, bean.codebase);
             throw new OpenEJBException(AssemblerTool.messages.format(messageCode, className, bean.ejbDeploymentId, message));
         }
     }

Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/EntityManagerFactoryCallable.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/EntityManagerFactoryCallable.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/EntityManagerFactoryCallable.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/EntityManagerFactoryCallable.java Wed Feb 19 15:47:58 2014
@@ -33,7 +33,7 @@ public class EntityManagerFactoryCallabl
     private final PersistenceUnitInfoImpl unitInfo;
     private ClassLoader appClassLoader;
 
-    public EntityManagerFactoryCallable(String persistenceProviderClassName, PersistenceUnitInfoImpl unitInfo, ClassLoader cl) {
+    public EntityManagerFactoryCallable(final String persistenceProviderClassName, final PersistenceUnitInfoImpl unitInfo, final ClassLoader cl) {
         this.persistenceProviderClassName = persistenceProviderClassName;
         this.unitInfo = unitInfo;
         this.appClassLoader = cl;
@@ -45,14 +45,14 @@ public class EntityManagerFactoryCallabl
         Thread.currentThread().setContextClassLoader(appClassLoader);
         try {
             final Class<?> clazz = appClassLoader.loadClass(persistenceProviderClassName);
-            PersistenceProvider persistenceProvider = (PersistenceProvider) clazz.newInstance();
+            final PersistenceProvider persistenceProvider = (PersistenceProvider) clazz.newInstance();
 
             // Create entity manager factories with the validator factory
             final Map<String, Object> properties = new HashMap<String, Object>();
             if (!ValidationMode.NONE.equals(unitInfo.getValidationMode())) {
                 properties.put("javax.persistence.validator.ValidatorFactory", new ValidatorFactoryWrapper());
             }
-            EntityManagerFactory emf = persistenceProvider.createContainerEntityManagerFactory(unitInfo, properties);
+            final EntityManagerFactory emf = persistenceProvider.createContainerEntityManagerFactory(unitInfo, properties);
 
             if (unitInfo.getProperties() != null
                     && "true".equalsIgnoreCase(unitInfo.getProperties().getProperty(OPENEJB_JPA_INIT_ENTITYMANAGER))

Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/ImportSql.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/ImportSql.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/ImportSql.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/ImportSql.java Wed Feb 19 15:47:58 2014
@@ -55,7 +55,7 @@ public class ImportSql {
 
         try {
             imports = cl.getResources(IMPORT_FILE_PREFIX.concat(resource).concat(IMPORT_FILE_EXTENSION));
-        } catch (IOException e) {
+        } catch (final IOException e) {
             throw new OpenEJBRuntimeException("can't look for init sql script", e);
         }
     }
@@ -65,18 +65,18 @@ public class ImportSql {
     }
 
     public void doImport() {
-        Statement statement;
+        final Statement statement;
         if (hasSomethingToImport()) {
             Connection connection = null;
             try {
                 connection = dataSource.getConnection();
                 statement = connection.createStatement();
-            } catch (SQLException e) {
+            } catch (final SQLException e) {
                 LOGGER.error("can't create a statement, import scripts will be ignored", e);
                 if (connection != null) {
                     try {
                         connection.close();
-                    } catch (SQLException ignored) {
+                    } catch (final SQLException ignored) {
                         // no-op
                     }
                 }
@@ -93,7 +93,7 @@ public class ImportSql {
             } finally {
                 try {
                     connection.close();
-                } catch (SQLException e) {
+                } catch (final SQLException e) {
                     // ignored
                 }
                 done = true;
@@ -105,7 +105,7 @@ public class ImportSql {
         final BufferedReader bufferedReader;
         try {
             bufferedReader = new BufferedReader(new InputStreamReader(new BufferedInputStream(script.openStream())));
-        } catch (IOException e) {
+        } catch (final IOException e) {
             LOGGER.error("can't open " + script.toExternalForm(), e);
             return;
         }
@@ -135,11 +135,11 @@ public class ImportSql {
                         LOGGER.warning(warnings.getMessage());
                         warnings = warnings.getNextWarning();
                     }
-                } catch (SQLException e) {
+                } catch (final SQLException e) {
                     LOGGER.error("error importing script " + script.toExternalForm(), e);
                 }
             }
-        } catch (IOException e) {
+        } catch (final IOException e) {
             LOGGER.error("can't import " + script.toExternalForm(), e);
         }
     }

Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Info.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Info.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Info.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Info.java Wed Feb 19 15:47:58 2014
@@ -37,33 +37,33 @@ public class Info {
     static {
         try {
             JAXB_CONTEXT = JAXBContext.newInstance(Info.class);
-        } catch (JAXBException e) {
+        } catch (final JAXBException e) {
             throw new OpenEJBRuntimeException("can't create jaxbcontext for Info class");
         }
     }
 
     public AppInfo appInfo;
 
-    public Info(AppInfo appInfo) {
+    public Info(final AppInfo appInfo) {
         this.appInfo = appInfo;
     }
 
     public Info() {
     }
 
-    public static void marshal(AppInfo appInfo) throws JAXBException {
+    public static void marshal(final AppInfo appInfo) throws JAXBException {
         marshal(appInfo, System.out);
     }
 
-    public static void marshal(AppInfo appInfo, OutputStream out) throws JAXBException {
+    public static void marshal(final AppInfo appInfo, final OutputStream out) throws JAXBException {
         marshaller().marshal(new Info(appInfo), out);
     }
 
-    public static void marshal(AppInfo appInfo, Writer out) throws JAXBException {
+    public static void marshal(final AppInfo appInfo, final Writer out) throws JAXBException {
         marshaller().marshal(new Info(appInfo), out);
     }
 
-    public static AppInfo unmarshal(InputStream in) throws JAXBException {
+    public static AppInfo unmarshal(final InputStream in) throws JAXBException {
         return ((Info) unmarshaller().unmarshal(in)).appInfo;
     }
 

Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/InjectionBuilder.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/InjectionBuilder.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/InjectionBuilder.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/InjectionBuilder.java Wed Feb 19 15:47:58 2014
@@ -25,65 +25,65 @@ import java.util.List;
 public class InjectionBuilder {
     private final ClassLoader classLoader;
 
-    public InjectionBuilder(ClassLoader classLoader) {
+    public InjectionBuilder(final ClassLoader classLoader) {
         this.classLoader = classLoader;
     }
 
     // TODO: check we can really skip the loadClass exception (TCKs)
-    public List<Injection> buildInjections(JndiEncInfo jndiEnc) throws OpenEJBException {
-        List<Injection> injections = new ArrayList<Injection>();
-        for (EnvEntryInfo info : jndiEnc.envEntries) {
-            for (InjectionInfo target : info.targets) {
-                Injection injection = injection(info.referenceName, target.propertyName, target.className);
+    public List<Injection> buildInjections(final JndiEncInfo jndiEnc) throws OpenEJBException {
+        final List<Injection> injections = new ArrayList<Injection>();
+        for (final EnvEntryInfo info : jndiEnc.envEntries) {
+            for (final InjectionInfo target : info.targets) {
+                final Injection injection = injection(info.referenceName, target.propertyName, target.className);
                 injections.add(injection);
             }
         }
 
-        for (EjbReferenceInfo info : jndiEnc.ejbReferences) {
-            for (InjectionInfo target : info.targets) {
-                Injection injection = injection(info.referenceName, target.propertyName, target.className);
+        for (final EjbReferenceInfo info : jndiEnc.ejbReferences) {
+            for (final InjectionInfo target : info.targets) {
+                final Injection injection = injection(info.referenceName, target.propertyName, target.className);
                 injections.add(injection);
             }
         }
 
-        for (EjbReferenceInfo info : jndiEnc.ejbLocalReferences) {
-            for (InjectionInfo target : info.targets) {
-                Injection injection = injection(info.referenceName, target.propertyName, target.className);
+        for (final EjbReferenceInfo info : jndiEnc.ejbLocalReferences) {
+            for (final InjectionInfo target : info.targets) {
+                final Injection injection = injection(info.referenceName, target.propertyName, target.className);
                 injections.add(injection);
             }
         }
 
-        for (PersistenceUnitReferenceInfo info : jndiEnc.persistenceUnitRefs) {
-            for (InjectionInfo target : info.targets) {
-                Injection injection = injection(info.referenceName, target.propertyName, target.className);
+        for (final PersistenceUnitReferenceInfo info : jndiEnc.persistenceUnitRefs) {
+            for (final InjectionInfo target : info.targets) {
+                final Injection injection = injection(info.referenceName, target.propertyName, target.className);
                 injections.add(injection);
             }
         }
 
-        for (PersistenceContextReferenceInfo info : jndiEnc.persistenceContextRefs) {
-            for (InjectionInfo target : info.targets) {
-                Injection injection = injection(info.referenceName, target.propertyName, target.className);
+        for (final PersistenceContextReferenceInfo info : jndiEnc.persistenceContextRefs) {
+            for (final InjectionInfo target : info.targets) {
+                final Injection injection = injection(info.referenceName, target.propertyName, target.className);
                 injections.add(injection);
             }
         }
 
-        for (ResourceReferenceInfo info : jndiEnc.resourceRefs) {
-            for (InjectionInfo target : info.targets) {
-                Injection injection = injection(info.referenceName, target.propertyName, target.className);
+        for (final ResourceReferenceInfo info : jndiEnc.resourceRefs) {
+            for (final InjectionInfo target : info.targets) {
+                final Injection injection = injection(info.referenceName, target.propertyName, target.className);
                 injections.add(injection);
             }
         }
 
-        for (ResourceEnvReferenceInfo info : jndiEnc.resourceEnvRefs) {
-            for (InjectionInfo target : info.targets) {
-                Injection injection = injection(info.referenceName, target.propertyName, target.className);
+        for (final ResourceEnvReferenceInfo info : jndiEnc.resourceEnvRefs) {
+            for (final InjectionInfo target : info.targets) {
+                final Injection injection = injection(info.referenceName, target.propertyName, target.className);
                 injections.add(injection);
             }
         }
 
-        for (ServiceReferenceInfo info : jndiEnc.serviceRefs) {
-            for (InjectionInfo target : info.targets) {
-                Injection injection = injection(info.referenceName, target.propertyName, target.className);
+        for (final ServiceReferenceInfo info : jndiEnc.serviceRefs) {
+            for (final InjectionInfo target : info.targets) {
+                final Injection injection = injection(info.referenceName, target.propertyName, target.className);
                 injections.add(injection);
             }
         }
@@ -91,11 +91,11 @@ public class InjectionBuilder {
         return injections;
     }
 
-    private Injection injection(String referenceName, String propertyName, String className) {
+    private Injection injection(final String referenceName, final String propertyName, final String className) {
         Class<?> targetClass;
         try {
             targetClass = loadClass(className);
-        } catch (OpenEJBException ex) {
+        } catch (final OpenEJBException ex) {
             targetClass = null;
         }
 
@@ -105,15 +105,15 @@ public class InjectionBuilder {
         return new Injection(referenceName, propertyName, targetClass);
     }
 
-    private Class loadClass(String className) throws OpenEJBException {
+    private Class loadClass(final String className) throws OpenEJBException {
         try {
-            Class clazz = Class.forName(className, true, classLoader);
+            final Class clazz = Class.forName(className, true, classLoader);
 //            clazz.getDeclaredMethods();
 //            clazz.getDeclaredFields();
 //            clazz.getDeclaredConstructors();
 //            clazz.getInterfaces();
             return clazz;
-        } catch (Throwable e) {
+        } catch (final Throwable e) {
             throw new OpenEJBException("Unable to load class " + className);
         }
     }

Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/InterceptorBindingBuilder.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/InterceptorBindingBuilder.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/InterceptorBindingBuilder.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/InterceptorBindingBuilder.java Wed Feb 19 15:47:58 2014
@@ -54,27 +54,27 @@ public class InterceptorBindingBuilder {
     private final ArrayList<InterceptorBindingInfo> bindings;
     private final Map<String, InterceptorData> interceptors =  new HashMap<String, InterceptorData>();
 
-    public InterceptorBindingBuilder(ClassLoader cl, EjbJarInfo ejbJarInfo) throws OpenEJBException {
+    public InterceptorBindingBuilder(final ClassLoader cl, final EjbJarInfo ejbJarInfo) throws OpenEJBException {
         bindings = new ArrayList<InterceptorBindingInfo>(ejbJarInfo.interceptorBindings);
         Collections.sort(bindings, new IntercpetorBindingComparator());
         Collections.reverse(bindings);
 
         packageAndClassBindings = new ArrayList<InterceptorBindingInfo>();
-        for (InterceptorBindingInfo binding : bindings) {
-            Level level = level(binding);
+        for (final InterceptorBindingInfo binding : bindings) {
+            final Level level = level(binding);
             if (level == Level.PACKAGE || level == Level.CLASS || level == Level.ANNOTATION_CLASS){
                 packageAndClassBindings.add(binding);
             }
         }
 
-        for (InterceptorInfo info : ejbJarInfo.interceptors) {
+        for (final InterceptorInfo info : ejbJarInfo.interceptors) {
             Class<?> clazz = null;
             try {
                 clazz = Class.forName(info.clazz, true, cl);
-            } catch (ClassNotFoundException e) {
+            } catch (final ClassNotFoundException e) {
                 throw new OpenEJBException("Interceptor class cannot be loaded: "+info.clazz);
             }
-            InterceptorData interceptor = new InterceptorData(clazz);
+            final InterceptorData interceptor = new InterceptorData(clazz);
 
             toMethods(clazz, info.aroundInvoke, interceptor.getAroundInvoke());
             toMethods(clazz, info.postActivate, interceptor.getPostActivate());
@@ -89,10 +89,10 @@ public class InterceptorBindingBuilder {
         }
     }
 
-    public void build(BeanContext beanContext, EnterpriseBeanInfo beanInfo) {
+    public void build(final BeanContext beanContext, final EnterpriseBeanInfo beanInfo) {
         Class<?> clazz = beanContext.getBeanClass();
 
-        InterceptorData beanAsInterceptor = new InterceptorData(clazz);
+        final InterceptorData beanAsInterceptor = new InterceptorData(clazz);
         
         
 
@@ -104,20 +104,20 @@ public class InterceptorBindingBuilder {
              *  and, in this case, the PostConstruct annotation (or deployment descriptor metadata)
              *  can only be applied to the bean’s ejbCreate method.
              */
-            NamedMethodInfo info = new NamedMethodInfo();
+            final NamedMethodInfo info = new NamedMethodInfo();
             info.className = clazz.getName();
             info.methodName = "ejbCreate";
             info.methodParams = new ArrayList<String>();
             
             try {
-                Method ejbcreate = MethodInfoUtil.toMethod(clazz, info);
+                final Method ejbcreate = MethodInfoUtil.toMethod(clazz, info);
                 if (ejbcreate != null) {
-                    CallbackInfo ejbcreateAsPostConstruct = new CallbackInfo();
+                    final CallbackInfo ejbcreateAsPostConstruct = new CallbackInfo();
                     ejbcreateAsPostConstruct.className = ejbcreate.getDeclaringClass().getName();
                     ejbcreateAsPostConstruct.method = "ejbCreate";
                     beanInfo.postConstruct.add(ejbcreateAsPostConstruct);
                 }
-            } catch (IllegalStateException e) {
+            } catch (final IllegalStateException e) {
                 // there's no ejbCreate method in stateless bean.
             }
 
@@ -128,7 +128,7 @@ public class InterceptorBindingBuilder {
         toCallback(clazz, beanInfo.preDestroy, beanAsInterceptor.getPreDestroy());
 
         if (beanInfo instanceof StatefulBeanInfo) {
-            StatefulBeanInfo stateful = (StatefulBeanInfo) beanInfo;
+            final StatefulBeanInfo stateful = (StatefulBeanInfo) beanInfo;
             toCallback(clazz, stateful.postActivate, beanAsInterceptor.getPostActivate());
             toCallback(clazz, stateful.prePassivate, beanAsInterceptor.getPrePassivate());
 
@@ -141,8 +141,8 @@ public class InterceptorBindingBuilder {
 
        
         while (clazz != null && clazz != Object.class) {
-            for (Method method : clazz.getDeclaredMethods()) {
-                List<InterceptorData> methodInterceptors = createInterceptorDatas(method, beanInfo.ejbName, this.bindings);
+            for (final Method method : clazz.getDeclaredMethods()) {
+                final List<InterceptorData> methodInterceptors = createInterceptorDatas(method, beanInfo.ejbName, this.bindings);
                 // The bean itself gets to intercept too and is always last.
                 methodInterceptors.add(beanAsInterceptor);
                 beanContext.setMethodInterceptors(method, methodInterceptors);
@@ -151,7 +151,7 @@ public class InterceptorBindingBuilder {
         }
         
 
-        List<InterceptorData> callbackInterceptorDatas = createInterceptorDatas(null, beanInfo.ejbName, this.packageAndClassBindings);
+        final List<InterceptorData> callbackInterceptorDatas = createInterceptorDatas(null, beanInfo.ejbName, this.packageAndClassBindings);
 
         // The bean itself gets to intercept too and is always last.
         callbackInterceptorDatas.add(beanAsInterceptor);
@@ -159,15 +159,15 @@ public class InterceptorBindingBuilder {
         beanContext.setCallbackInterceptors(callbackInterceptorDatas);
     }
 
-    private List<InterceptorData> createInterceptorDatas(Method method, String ejbName, List<InterceptorBindingInfo> bindings) {
-        List<InterceptorBindingInfo> methodBindings = processBindings(method, ejbName, bindings);
+    private List<InterceptorData> createInterceptorDatas(final Method method, final String ejbName, final List<InterceptorBindingInfo> bindings) {
+        final List<InterceptorBindingInfo> methodBindings = processBindings(method, ejbName, bindings);
         Collections.reverse(methodBindings);
-        List<InterceptorData> methodInterceptors = new ArrayList<InterceptorData>();
+        final List<InterceptorData> methodInterceptors = new ArrayList<InterceptorData>();
 
-        for (InterceptorBindingInfo info : methodBindings) {
-            List<String> classes = info.interceptorOrder.size() > 0 ? info.interceptorOrder : info.interceptors;
-            for (String interceptorClassName : classes) {
-                InterceptorData interceptorData = interceptors.get(interceptorClassName);
+        for (final InterceptorBindingInfo info : methodBindings) {
+            final List<String> classes = info.interceptorOrder.size() > 0 ? info.interceptorOrder : info.interceptors;
+            for (final String interceptorClassName : classes) {
+                final InterceptorData interceptorData = interceptors.get(interceptorClassName);
                 if (interceptorData == null){
                     logger.warning("InterceptorBinding references non-existent (undeclared) interceptor: " + interceptorClassName);
                     continue;
@@ -179,8 +179,8 @@ public class InterceptorBindingBuilder {
     }
 
 
-    private List<InterceptorBindingInfo> processBindings(Method method, String ejbName, List<InterceptorBindingInfo> bindings){
-        List<InterceptorBindingInfo> methodBindings = new ArrayList<InterceptorBindingInfo>();
+    private List<InterceptorBindingInfo> processBindings(final Method method, final String ejbName, final List<InterceptorBindingInfo> bindings){
+        final List<InterceptorBindingInfo> methodBindings = new ArrayList<InterceptorBindingInfo>();
 
         // The only critical thing to understand in this loop is that
         // the bindings have already been sorted high to low (first to last)
@@ -205,13 +205,13 @@ public class InterceptorBindingBuilder {
         //    - Any addition for current level and/or exclusion for a lower level
         //   (lowest)
         //
-        Set<Level> excludes = new HashSet<Level>();
-        for (InterceptorBindingInfo info : bindings) {
-            Level level = level(info);
+        final Set<Level> excludes = new HashSet<Level>();
+        for (final InterceptorBindingInfo info : bindings) {
+            final Level level = level(info);
 
             if (!implies(method, ejbName, level, info)) continue;
 
-            Type type = type(level, info);
+            final Type type = type(level, info);
 
             if (type == Type.EXPLICIT_ORDERING && !excludes.contains(level)){
 
@@ -246,12 +246,12 @@ public class InterceptorBindingBuilder {
         return methodBindings;
     }
 
-    private boolean implies(Method method, String ejbName, Level level, InterceptorBindingInfo info) {
+    private boolean implies(final Method method, final String ejbName, final Level level, final InterceptorBindingInfo info) {
         if (level == Level.PACKAGE) return true;
         if (!ejbName.equals(info.ejbName)) return false;
         if (level == Level.CLASS || level == Level.ANNOTATION_CLASS) return true;
 
-        NamedMethodInfo methodInfo = info.method;
+        final NamedMethodInfo methodInfo = info.method;
         return MethodInfoUtil.matches(method, methodInfo);
     }
 
@@ -270,10 +270,10 @@ public class InterceptorBindingBuilder {
      * @param callbackInfos the raw CallbackInfo objects
      * @param callbacks the collection where the created methods will be placed
      */
-    private void toMethods(Class<?> clazz, List<CallbackInfo> callbackInfos, Set<Method> callbacks) {
-        List<Method> methods = new ArrayList<Method>();
+    private void toMethods(final Class<?> clazz, final List<CallbackInfo> callbackInfos, final Set<Method> callbacks) {
+        final List<Method> methods = new ArrayList<Method>();
 
-        for (CallbackInfo callbackInfo : callbackInfos) {
+        for (final CallbackInfo callbackInfo : callbackInfos) {
             try {
                 Method method = getMethod(clazz, callbackInfo.method, InvocationContext.class);
                 if (callbackInfo.className == null && method.getDeclaringClass().equals(clazz) && !methods.contains(method)){
@@ -297,12 +297,12 @@ public class InterceptorBindingBuilder {
                                 SetAccessible.on(method);
                                 methods.add(method);
                             }
-                        } catch (NoSuchMethodException e) {
+                        } catch (final NoSuchMethodException e) {
                             // no-op
                         }
                     }
                 }
-            } catch (NoSuchMethodException e) {
+            } catch (final NoSuchMethodException e) {
                 logger.warning("Interceptor method not found (skipping): public Object " + callbackInfo.method + "(InvocationContext); in class " + clazz.getName());
             }
         }
@@ -329,15 +329,15 @@ public class InterceptorBindingBuilder {
      * @param callbackInfos
      * @param callbacks
      */
-    private void toCallback(Class<?> clazz, List<CallbackInfo> callbackInfos, Set<Method> callbacks, Class<?>... parameterTypes) {
-        List<Method> methods = new ArrayList<Method>();
+    private void toCallback(final Class<?> clazz, final List<CallbackInfo> callbackInfos, final Set<Method> callbacks, final Class<?>... parameterTypes) {
+        final List<Method> methods = new ArrayList<Method>();
 
-        for (CallbackInfo callbackInfo : callbackInfos) {
+        for (final CallbackInfo callbackInfo : callbackInfos) {
             Class<?> usedClazz = clazz;
             if (clazz.isInterface() && !callbackInfo.className.equals(clazz.getName())) { // dynamic mbean for instance
                 try {
                     usedClazz = clazz.getClassLoader().loadClass(callbackInfo.className);
-                } catch (ClassNotFoundException e) {
+                } catch (final ClassNotFoundException e) {
                     // ignored
                 }
             }
@@ -364,13 +364,13 @@ public class InterceptorBindingBuilder {
                                 SetAccessible.on(method);
                                 methods.add(method);
                             }
-                        } catch (NoSuchMethodException e) {
+                        } catch (final NoSuchMethodException e) {
                             // no-op
                         }
                     }
                 }
-            } catch (NoSuchMethodException e) {
-                String message = "Bean Callback method not found (skipping): public void " + callbackInfo.method + "(); in class " + clazz.getName();
+            } catch (final NoSuchMethodException e) {
+                final String message = "Bean Callback method not found (skipping): public void " + callbackInfo.method + "(); in class " + clazz.getName();
                 logger.warning(message);
                 throw new IllegalStateException(message, e);
             }
@@ -392,13 +392,13 @@ public class InterceptorBindingBuilder {
      * @return
      * @throws NoSuchMethodException if the method is not found in this class or any of its parent classes
      */
-    private Method getMethod(Class<?> clazz, String methodName, Class<?>... parameterTypes) throws NoSuchMethodException {
+    private Method getMethod(Class<?> clazz, final String methodName, final Class<?>... parameterTypes) throws NoSuchMethodException {
         NoSuchMethodException original = null;
         while (clazz != null){
             try {
-                Method method = clazz.getDeclaredMethod(methodName, parameterTypes);
+                final Method method = clazz.getDeclaredMethod(methodName, parameterTypes);
                 return SetAccessible.on(method);
-            } catch (NoSuchMethodException e) {
+            } catch (final NoSuchMethodException e) {
                 if (original == null) original = e;
             }
             clazz = clazz.getSuperclass();
@@ -411,9 +411,9 @@ public class InterceptorBindingBuilder {
     // -------------------------------------------------------------------
 
     public static class IntercpetorBindingComparator implements Comparator<InterceptorBindingInfo> {
-        public int compare(InterceptorBindingInfo a, InterceptorBindingInfo b) {
-            Level levelA = level(a);
-            Level levelB = level(b);
+        public int compare(final InterceptorBindingInfo a, final InterceptorBindingInfo b) {
+            final Level levelA = level(a);
+            final Level levelB = level(b);
 
             if (levelA != levelB) return levelA.ordinal() - levelB.ordinal();
 
@@ -423,7 +423,7 @@ public class InterceptorBindingBuilder {
         }
     }
 
-    private static Level level(InterceptorBindingInfo info) {
+    private static Level level(final InterceptorBindingInfo info) {
         if (info.ejbName.equals("*")) {
             return Level.PACKAGE;
         }
@@ -439,7 +439,7 @@ public class InterceptorBindingBuilder {
         return info.className == null ? Level.EXACT_METHOD : Level.ANNOTATION_METHOD;
     }
 
-    private static Type type(Level level, InterceptorBindingInfo info) {
+    private static Type type(final Level level, final InterceptorBindingInfo info) {
         if (info.interceptorOrder.size() > 0) {
             return Type.EXPLICIT_ORDERING;
         }
@@ -456,9 +456,9 @@ public class InterceptorBindingBuilder {
     }
 
     public static class MethodCallbackComparator implements Comparator<Method> {
-        public int compare(Method m1, Method m2) {
-            Class<?> c1 = m1.getDeclaringClass();
-            Class<?> c2 = m2.getDeclaringClass();
+        public int compare(final Method m1, final Method m2) {
+            final Class<?> c1 = m1.getDeclaringClass();
+            final Class<?> c2 = m2.getDeclaringClass();
             if (c1.equals(c2)) return 0;
             if (c1.isAssignableFrom(c2)) return -1;
             return 1;

Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/JaccPermissionsBuilder.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/JaccPermissionsBuilder.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/JaccPermissionsBuilder.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/JaccPermissionsBuilder.java Wed Feb 19 15:47:58 2014
@@ -67,9 +67,9 @@ public class JaccPermissionsBuilder {
             }
 
             policy.commit();
-        } catch (ClassNotFoundException e) {
+        } catch (final ClassNotFoundException e) {
             throw new OpenEJBException("PolicyConfigurationFactory class not found", e);
-        } catch (PolicyContextException e) {
+        } catch (final PolicyContextException e) {
             throw new OpenEJBException("JACC PolicyConfiguration failed: ContextId=" + policyContext.getContextID(), e);
         }
     }
@@ -322,7 +322,7 @@ public class JaccPermissionsBuilder {
     private PermissionCollection cullPermissions(final PermissionCollection toBeChecked, final Permission permission) {
         final PermissionCollection result = DelegatePermissionCollection.getPermissionCollection();
 
-        for (Enumeration e = toBeChecked.elements(); e.hasMoreElements(); ) {
+        for (final Enumeration e = toBeChecked.elements(); e.hasMoreElements(); ) {
             final Permission test = (Permission) e.nextElement();
             if (!permission.implies(test)) {
                 result.add(test);

Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/JndiBuilder.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/JndiBuilder.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/JndiBuilder.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/JndiBuilder.java Wed Feb 19 15:47:58 2014
@@ -71,7 +71,7 @@ public class JndiBuilder {
     private static final String JNDINAME_FAILONCOLLISION = "openejb.jndiname.failoncollision";
     private final boolean failOnCollision;
 
-    public JndiBuilder(Context openejbContext) {
+    public JndiBuilder(final Context openejbContext) {
         this.openejbContext = openejbContext;
 
         final Options options = SystemInstance.get().getOptions();
@@ -80,12 +80,12 @@ public class JndiBuilder {
         embeddedEjbContainerApi = options.get(EJBContainer.class.getName(), false);
     }
 
-    public void build(EjbJarInfo ejbJar, HashMap<String, BeanContext> deployments) {
+    public void build(final EjbJarInfo ejbJar, final HashMap<String, BeanContext> deployments) {
 
-        JndiNameStrategy strategy = createStrategy(ejbJar, deployments);
+        final JndiNameStrategy strategy = createStrategy(ejbJar, deployments);
 
-        for (EnterpriseBeanInfo beanInfo : ejbJar.enterpriseBeans) {
-            BeanContext beanContext = deployments.get(beanInfo.ejbDeploymentId);
+        for (final EnterpriseBeanInfo beanInfo : ejbJar.enterpriseBeans) {
+            final BeanContext beanContext = deployments.get(beanInfo.ejbDeploymentId);
             strategy.begin(beanContext);
             try {
                 bind(ejbJar, beanContext, beanInfo, strategy);
@@ -95,28 +95,28 @@ public class JndiBuilder {
         }
     }
 
-    public static JndiNameStrategy createStrategy(EjbJarInfo ejbJar, Map<String, BeanContext> deployments) {
-        Options options = new Options(ejbJar.properties, SystemInstance.get().getOptions());
+    public static JndiNameStrategy createStrategy(final EjbJarInfo ejbJar, final Map<String, BeanContext> deployments) {
+        final Options options = new Options(ejbJar.properties, SystemInstance.get().getOptions());
 
-        Class strategyClass = options.get(JNDINAME_STRATEGY_CLASS, TemplatedStrategy.class);
+        final Class strategyClass = options.get(JNDINAME_STRATEGY_CLASS, TemplatedStrategy.class);
 
-        String strategyClassName = strategyClass.getName();
+        final String strategyClassName = strategyClass.getName();
 
         try {
             try {
-                Constructor constructor = strategyClass.getConstructor(EjbJarInfo.class, Map.class);
+                final Constructor constructor = strategyClass.getConstructor(EjbJarInfo.class, Map.class);
                 return (JndiNameStrategy) constructor.newInstance(ejbJar, deployments);
-            } catch (NoSuchMethodException e) {
+            } catch (final NoSuchMethodException e) {
                 // no-op
             }
 
-            Constructor constructor = strategyClass.getConstructor();
+            final Constructor constructor = strategyClass.getConstructor();
             return (JndiNameStrategy) constructor.newInstance();
-        } catch (InstantiationException e) {
+        } catch (final InstantiationException e) {
             throw new IllegalStateException("Could not instantiate JndiNameStrategy: " + strategyClassName, e);
-        } catch (IllegalAccessException e) {
+        } catch (final IllegalAccessException e) {
             throw new IllegalStateException("Could not access JndiNameStrategy: " + strategyClassName, e);
-        } catch (Throwable t) {
+        } catch (final Throwable t) {
             throw new IllegalStateException("Could not create JndiNameStrategy: " + strategyClassName, t);
         }
     }
@@ -138,7 +138,7 @@ public class JndiBuilder {
             private final String xmlNameCc;
             private final String openejbLegacy;
 
-            Interface(InterfaceType type, String annotatedName, String xmlName, String openejbLegacy) {
+            Interface(final InterfaceType type, final String annotatedName, final String xmlName, final String openejbLegacy) {
                 this.type = type;
                 this.annotatedName = annotatedName;
                 this.xmlName = xmlName;
@@ -196,13 +196,13 @@ public class JndiBuilder {
         private Map<String, String> appContext;
         private HashMap<String, String> beanContext;
 
-        public TemplatedStrategy(EjbJarInfo ejbJarInfo, Map<String, BeanContext> deployments) {
-            Options options = new Options(ejbJarInfo.properties, SystemInstance.get().getOptions());
+        public TemplatedStrategy(final EjbJarInfo ejbJarInfo, final Map<String, BeanContext> deployments) {
+            final Options options = new Options(ejbJarInfo.properties, SystemInstance.get().getOptions());
 
             format = options.get(JNDINAME_FORMAT, "{deploymentId}{interfaceType.annotationName}");
 
             { // illegal format check
-                int index = format.indexOf(":");
+                final int index = format.indexOf(":");
                 if (index > -1) {
                     logger.error("Illegal " + JNDINAME_FORMAT + " contains a colon ':'.  Everything before the colon will be removed, '" + format + "' ");
                     format = format.substring(index + 1);
@@ -212,7 +212,7 @@ public class JndiBuilder {
             this.template = new StringTemplate(format);
 
             beanInfos = new HashMap<String, EnterpriseBeanInfo>();
-            for (EnterpriseBeanInfo beanInfo : ejbJarInfo.enterpriseBeans) {
+            for (final EnterpriseBeanInfo beanInfo : ejbJarInfo.enterpriseBeans) {
                 beanInfos.put(beanInfo.ejbDeploymentId, beanInfo);
             }
 
@@ -234,8 +234,8 @@ public class JndiBuilder {
             appContext.put("moduleId", moduleContext.getId());
         }
 
-        private void putAll(Map<String, String> map, Properties properties) {
-            for (Map.Entry<Object, Object> e : properties.entrySet()) {
+        private void putAll(final Map<String, String> map, final Properties properties) {
+            for (final Map.Entry<Object, Object> e : properties.entrySet()) {
                 if (!(e.getValue() instanceof String)) continue;
                 if (!(e.getKey() instanceof String)) continue;
 
@@ -243,7 +243,7 @@ public class JndiBuilder {
             }
         }
 
-        private Map<String, StringTemplate> addTemplate(Map<String, StringTemplate> map, String key, StringTemplate template) {
+        private Map<String, StringTemplate> addTemplate(final Map<String, StringTemplate> map, final String key, final StringTemplate template) {
             Map<String, StringTemplate> m = map;
             if (m == null) {
                 m = new TreeMap<String, StringTemplate>();
@@ -252,15 +252,15 @@ public class JndiBuilder {
             return m;
         }
 
-        public void begin(BeanContext bean) {
+        public void begin(final BeanContext bean) {
             this.bean = bean;
 
-            EnterpriseBeanInfo beanInfo = beanInfos.get(bean.getDeploymentID());
+            final EnterpriseBeanInfo beanInfo = beanInfos.get(bean.getDeploymentID());
 
             templates = new HashMap<String, Map<String, StringTemplate>>();
             templates.put("", addTemplate(null, DEFAULT_NAME_KEY, template));
 
-            for (JndiNameInfo nameInfo : beanInfo.jndiNamess) {
+            for (final JndiNameInfo nameInfo : beanInfo.jndiNamess) {
                 String intrface = nameInfo.intrface;
                 if (intrface == null) intrface = "";
                 templates.put(intrface, addTemplate(templates.get(intrface), getType(nameInfo.name), new StringTemplate(nameInfo.name)));
@@ -278,12 +278,12 @@ public class JndiBuilder {
             this.beanContext.put("deploymentId", bean.getDeploymentID().toString());
         }
 
-        private static String getType(String name) {
+        private static String getType(final String name) {
             int start = 0;
             if (name.charAt(0) == '/') {
                 start = 1;
             }
-            int end = name.substring(start).indexOf('/');
+            final int end = name.substring(start).indexOf('/');
             if (end < 0) {
                 return DEFAULT_NAME_KEY;
             }
@@ -293,12 +293,12 @@ public class JndiBuilder {
         public void end() {
         }
 
-        public String getName(Class interfce, String key, Interface type) {
+        public String getName(final Class interfce, final String key, final Interface type) {
             Map<String, StringTemplate> template = templates.get(interfce.getName());
             if (template == null) template = templates.get(type.getAnnotationName());
             if (template == null) template = templates.get("");
 
-            Map<String, String> contextData = new HashMap<String, String>(beanContext);
+            final Map<String, String> contextData = new HashMap<String, String>(beanContext);
             contextData.put("interfaceType", type.getAnnotationName());
             contextData.put("interfaceType.annotationName", type.getAnnotationName());
             contextData.put("interfaceType.annotationNameLC", type.getAnnotationName().toLowerCase());
@@ -326,9 +326,9 @@ public class JndiBuilder {
         }
 
         @Override
-        public Map<String, String> getNames(Class interfce, Interface type) {
-            Map<String, String> names = new HashMap<String, String>();
-            for (String key : KEYS.split(",")) {
+        public Map<String, String> getNames(final Class interfce, final Interface type) {
+            final Map<String, String> names = new HashMap<String, String>();
+            for (final String key : KEYS.split(",")) {
                 names.put(key, getName(interfce, key, type));
             }
             return names;
@@ -338,14 +338,14 @@ public class JndiBuilder {
     public static class LegacyAddedSuffixStrategy implements JndiNameStrategy {
         private BeanContext beanContext;
 
-        public void begin(BeanContext beanContext) {
+        public void begin(final BeanContext beanContext) {
             this.beanContext = beanContext;
         }
 
         public void end() {
         }
 
-        public String getName(Class interfce, String key, Interface type) {
+        public String getName(final Class interfce, final String key, final Interface type) {
             String id = beanContext.getDeploymentID() + "";
             if (id.charAt(0) == '/') {
                 id = id.substring(1);
@@ -365,14 +365,14 @@ public class JndiBuilder {
         }
 
         @Override
-        public Map<String, String> getNames(Class interfce, Interface type) {
-            Map<String, String> names = new HashMap<String, String>();
+        public Map<String, String> getNames(final Class interfce, final Interface type) {
+            final Map<String, String> names = new HashMap<String, String>();
             names.put("", getName(interfce, DEFAULT_NAME_KEY, type));
             return names;
         }
     }
 
-    public void bind(EjbJarInfo ejbJarInfo, BeanContext bean, EnterpriseBeanInfo beanInfo, JndiNameStrategy strategy) {
+    public void bind(final EjbJarInfo ejbJarInfo, final BeanContext bean, final EnterpriseBeanInfo beanInfo, final JndiNameStrategy strategy) {
 
         // in an ear ejbmodule, webmodule etc can get the same name so avoid Comp binding issue
         // and we shouldn't need it
@@ -380,12 +380,12 @@ public class JndiBuilder {
             return;
         }
 
-        Bindings bindings = new Bindings();
+        final Bindings bindings = new Bindings();
         bean.set(Bindings.class, bindings);
 
         Reference simpleNameRef = null;
 
-        Object id = bean.getDeploymentID();
+        final Object id = bean.getDeploymentID();
 
         // Our openejb.jndiname.format concept works such that there doesn't need to be one explicit jndi name
         // for each view that the bean may offer.  If the user configured a name that results in few possible
@@ -405,10 +405,10 @@ public class JndiBuilder {
 
         try {
             if (bean.isLocalbean()) {
-                Class beanClass = bean.getBeanClass();
+                final Class beanClass = bean.getBeanClass();
 
-                BeanContext.BusinessLocalBeanHome home = bean.getBusinessLocalBeanHome();
-                BusinessLocalBeanReference ref = new BusinessLocalBeanReference(home);
+                final BeanContext.BusinessLocalBeanHome home = bean.getBusinessLocalBeanHome();
+                final BusinessLocalBeanReference ref = new BusinessLocalBeanReference(home);
 
                 optionalBind(bindings, ref, "openejb/Deployment/" + format(id, beanClass.getName(), InterfaceType.LOCALBEAN));
 
@@ -419,10 +419,10 @@ public class JndiBuilder {
                     }
                 }
 
-                String internalName = "openejb/Deployment/" + format(id, beanClass.getName(), InterfaceType.BUSINESS_LOCALBEAN_HOME);
+                final String internalName = "openejb/Deployment/" + format(id, beanClass.getName(), InterfaceType.BUSINESS_LOCALBEAN_HOME);
                 bind(internalName, ref, bindings, beanInfo, beanClass);
 
-                String name = strategy.getName(beanClass, DEFAULT_NAME_KEY, JndiNameStrategy.Interface.LOCALBEAN);
+                final String name = strategy.getName(beanClass, DEFAULT_NAME_KEY, JndiNameStrategy.Interface.LOCALBEAN);
                 bind("openejb/local/" + name, ref, bindings, beanInfo, beanClass);
                 bindJava(bean, beanClass, ref, bindings, beanInfo);
                 if (USE_OLD_JNDI_NAMES) {
@@ -431,20 +431,20 @@ public class JndiBuilder {
 
                 simpleNameRef = ref;
             }
-        } catch (NamingException e) {
+        } catch (final NamingException e) {
             throw new OpenEJBRuntimeException("Unable to bind business remote deployment in jndi.", e);
         }
 
         try {
 
-            for (Class interfce : bean.getBusinessLocalInterfaces()) {
+            for (final Class interfce : bean.getBusinessLocalInterfaces()) {
 
-                BeanContext.BusinessLocalHome home = bean.getBusinessLocalHome(interfce);
-                BusinessLocalReference ref = new BusinessLocalReference(home);
+                final BeanContext.BusinessLocalHome home = bean.getBusinessLocalHome(interfce);
+                final BusinessLocalReference ref = new BusinessLocalReference(home);
 
                 optionalBind(bindings, ref, "openejb/Deployment/" + format(id, interfce.getName()));
 
-                String internalName = "openejb/Deployment/" + format(id, interfce.getName(), InterfaceType.BUSINESS_LOCAL);
+                final String internalName = "openejb/Deployment/" + format(id, interfce.getName(), InterfaceType.BUSINESS_LOCAL);
                 bind(internalName, ref, bindings, beanInfo, interfce);
 
                 final String name = strategy.getName(interfce, DEFAULT_NAME_KEY, JndiNameStrategy.Interface.BUSINESS_LOCAL);
@@ -457,23 +457,23 @@ public class JndiBuilder {
 
                 if (simpleNameRef == null) simpleNameRef = ref;
             }
-        } catch (NamingException e) {
+        } catch (final NamingException e) {
             throw new OpenEJBRuntimeException("Unable to bind business local interface for deployment " + id, e);
         }
 
         try {
 
-            for (Class interfce : bean.getBusinessRemoteInterfaces()) {
+            for (final Class interfce : bean.getBusinessRemoteInterfaces()) {
 
-                BeanContext.BusinessRemoteHome home = bean.getBusinessRemoteHome(interfce);
-                BusinessRemoteReference ref = new BusinessRemoteReference(home);
+                final BeanContext.BusinessRemoteHome home = bean.getBusinessRemoteHome(interfce);
+                final BusinessRemoteReference ref = new BusinessRemoteReference(home);
 
                 optionalBind(bindings, ref, "openejb/Deployment/" + format(id, interfce.getName(), null));
 
-                String internalName = "openejb/Deployment/" + format(id, interfce.getName(), InterfaceType.BUSINESS_REMOTE);
+                final String internalName = "openejb/Deployment/" + format(id, interfce.getName(), InterfaceType.BUSINESS_REMOTE);
                 bind(internalName, ref, bindings, beanInfo, interfce);
 
-                String name = strategy.getName(interfce, DEFAULT_NAME_KEY, JndiNameStrategy.Interface.BUSINESS_REMOTE);
+                final String name = strategy.getName(interfce, DEFAULT_NAME_KEY, JndiNameStrategy.Interface.BUSINESS_REMOTE);
                 bind("openejb/local/" + name, ref, bindings, beanInfo, interfce);
                 bind("openejb/remote/" + name, ref, bindings, beanInfo, interfce);
                 bind("openejb/remote/" + computeGlobalName(bean, interfce), ref, bindings, beanInfo, interfce);
@@ -484,15 +484,15 @@ public class JndiBuilder {
 
                 if (simpleNameRef == null) simpleNameRef = ref;
             }
-        } catch (NamingException e) {
+        } catch (final NamingException e) {
             throw new OpenEJBRuntimeException("Unable to bind business remote deployment in jndi.", e);
         }
 
         try {
-            Class localHomeInterface = bean.getLocalHomeInterface();
+            final Class localHomeInterface = bean.getLocalHomeInterface();
             if (localHomeInterface != null) {
 
-                ObjectReference ref = new ObjectReference(bean.getEJBLocalHome());
+                final ObjectReference ref = new ObjectReference(bean.getEJBLocalHome());
 
                 String name = strategy.getName(bean.getLocalHomeInterface(), DEFAULT_NAME_KEY, JndiNameStrategy.Interface.LOCAL_HOME);
                 bind("openejb/local/" + name, ref, bindings, beanInfo, localHomeInterface);
@@ -508,15 +508,15 @@ public class JndiBuilder {
 
                 if (simpleNameRef == null) simpleNameRef = ref;
             }
-        } catch (NamingException e) {
+        } catch (final NamingException e) {
             throw new OpenEJBRuntimeException("Unable to bind local home interface for deployment " + id, e);
         }
 
         try {
-            Class homeInterface = bean.getHomeInterface();
+            final Class homeInterface = bean.getHomeInterface();
             if (homeInterface != null) {
 
-                ObjectReference ref = new ObjectReference(bean.getEJBHome());
+                final ObjectReference ref = new ObjectReference(bean.getEJBHome());
 
                 String name = strategy.getName(homeInterface, DEFAULT_NAME_KEY, JndiNameStrategy.Interface.REMOTE_HOME);
                 bind("openejb/local/" + name, ref, bindings, beanInfo, homeInterface);
@@ -533,7 +533,7 @@ public class JndiBuilder {
 
                 if (simpleNameRef == null) simpleNameRef = ref;
             }
-        } catch (NamingException e) {
+        } catch (final NamingException e) {
             throw new OpenEJBRuntimeException("Unable to bind remote home interface for deployment " + id, e);
         }
 
@@ -541,53 +541,53 @@ public class JndiBuilder {
             if (simpleNameRef != null) {
                 bindJava(bean, null, simpleNameRef, bindings, beanInfo);
             }
-        } catch (NamingException e) {
+        } catch (final NamingException e) {
             throw new OpenEJBRuntimeException("Unable to bind simple java:global name in jndi", e);
         }
 
         try {
             if (MessageListener.class.equals(bean.getMdbInterface())) {
 
-                String destinationId = bean.getDestinationId();
-                String jndiName = "openejb/Resource/" + destinationId;
-                Reference reference = new IntraVmJndiReference(jndiName);
+                final String destinationId = bean.getDestinationId();
+                final String jndiName = "openejb/Resource/" + destinationId;
+                final Reference reference = new IntraVmJndiReference(jndiName);
 
-                String deploymentId = id.toString();
+                final String deploymentId = id.toString();
                 bind("openejb/local/" + deploymentId, reference, bindings, beanInfo, MessageListener.class);
                 bind("openejb/remote/" + deploymentId, reference, bindings, beanInfo, MessageListener.class);
             }
-        } catch (NamingException e) {
+        } catch (final NamingException e) {
             throw new OpenEJBRuntimeException("Unable to bind mdb destination in jndi.", e);
         }
     }
 
-    private void optionalBind(Bindings bindings, Reference ref, String name) throws NamingException {
+    private void optionalBind(final Bindings bindings, final Reference ref, final String name) throws NamingException {
         try {
             openejbContext.bind(name, ref);
             logger.debug("bound ejb at name: " + name + ", ref: " + ref);
             bindings.add(name);
-        } catch (NamingException okIfBindFails) {
+        } catch (final NamingException okIfBindFails) {
             logger.debug("failed to bind ejb at name: " + name + ", ref: " + ref);
         }
     }
 
-    public static String format(Object deploymentId, String interfaceClassName) {
+    public static String format(final Object deploymentId, final String interfaceClassName) {
         return format((String) deploymentId, interfaceClassName, null);
     }
 
-    public static String format(Object deploymentId, String interfaceClassName, InterfaceType interfaceType) {
+    public static String format(final Object deploymentId, final String interfaceClassName, final InterfaceType interfaceType) {
         return format((String) deploymentId, interfaceClassName, interfaceType);
     }
 
-    public static String format(String deploymentId, String interfaceClassName, InterfaceType interfaceType) {
+    public static String format(final String deploymentId, final String interfaceClassName, final InterfaceType interfaceType) {
         return deploymentId + "/" + interfaceClassName + (interfaceType == null ? "" : "!" + interfaceType.getSpecName());
     }
 
-    private void bind(String name, Reference ref, Bindings bindings, EnterpriseBeanInfo beanInfo, Class intrface) throws NamingException {
+    private void bind(final String name, final Reference ref, final Bindings bindings, final EnterpriseBeanInfo beanInfo, final Class intrface) throws NamingException {
 
         if (name.startsWith("openejb/local/") || name.startsWith("openejb/remote/") || name.startsWith("openejb/localbean/") || name.startsWith("openejb/global/")) {
 
-            String externalName = name.replaceFirst("openejb/[^/]+/", "");
+            final String externalName = name.replaceFirst("openejb/[^/]+/", "");
 
             if (bindings.contains(name)) {
                 // We bind under two sections of jndi, only warn once.. the user doesn't need to be bothered with that detail
@@ -604,7 +604,7 @@ public class JndiBuilder {
                 if (!beanInfo.jndiNames.contains(externalName)) {
                     beanInfo.jndiNames.add(externalName);
 
-                    JndiNameInfo nameInfo = new JndiNameInfo();
+                    final JndiNameInfo nameInfo = new JndiNameInfo();
                     nameInfo.intrface = intrface == null ? null : intrface.getName();
                     nameInfo.name = externalName;
                     beanInfo.jndiNamess.add(nameInfo);
@@ -615,8 +615,8 @@ public class JndiBuilder {
                         logger.info("Jndi(name=" + externalName + ") --> Ejb(deployment-id=" + beanInfo.ejbDeploymentId + ")");
                     }
                 }
-            } catch (NameAlreadyBoundException e) {
-                BeanContext deployment = findNameOwner(name);
+            } catch (final NameAlreadyBoundException e) {
+                final BeanContext deployment = findNameOwner(name);
                 if (deployment != null) {
                     logger.error("Jndi(name=" + externalName + ") cannot be bound to Ejb(deployment-id=" + beanInfo.ejbDeploymentId + ").  Name already taken by Ejb(deployment-id=" + deployment.getDeploymentID() + ")");
                 } else {
@@ -631,7 +631,7 @@ public class JndiBuilder {
                 openejbContext.bind(name, ref);
                 logger.debug("bound ejb at name: " + name + ", ref: " + ref);
                 bindings.add(name);
-            } catch (NameAlreadyBoundException e) {
+            } catch (final NameAlreadyBoundException e) {
                 logger.error("Jndi name could not be bound; it may be taken by another ejb.  Jndi(name=" + name + ")");
                 // Construct a new exception as the IvmContext doesn't include
                 // the name in the exception that it throws
@@ -657,22 +657,22 @@ public class JndiBuilder {
         return "global/" + appName + moduleName + beanName;
     }
 
-    private void bindJava(BeanContext cdi, Class intrface, Reference ref, Bindings bindings, EnterpriseBeanInfo beanInfo) throws NamingException {
+    private void bindJava(final BeanContext cdi, final Class intrface, final Reference ref, final Bindings bindings, final EnterpriseBeanInfo beanInfo) throws NamingException {
         final ModuleContext module = cdi.getModuleContext();
         final AppContext application = module.getAppContext();
 
-        Context moduleContext = module.getModuleJndiContext();
-        Context appContext = application.getAppJndiContext();
-        Context globalContext = application.getGlobalJndiContext();
+        final Context moduleContext = module.getModuleJndiContext();
+        final Context appContext = application.getAppJndiContext();
+        final Context globalContext = application.getGlobalJndiContext();
 
-        String appName = application.isStandaloneModule() ? "" : application.getId() + "/";
-        String moduleName = cdi.getModuleName() + "/";
+        final String appName = application.isStandaloneModule() ? "" : application.getId() + "/";
+        final String moduleName = cdi.getModuleName() + "/";
         String beanName = cdi.getEjbName();
         if (intrface != null) {
             beanName = beanName + "!" + intrface.getName();
         }
         try {
-            String globalName = "global/" + appName + moduleName + beanName;
+            final String globalName = "global/" + appName + moduleName + beanName;
 
             if (embeddedEjbContainerApi
                     && !(beanInfo instanceof ManagedBeanInfo && ((ManagedBeanInfo) beanInfo).hidden)) {
@@ -682,7 +682,7 @@ public class JndiBuilder {
             application.getBindings().put(globalName, ref);
 
             bind("openejb/global/" + globalName, ref, bindings, beanInfo, intrface);
-        } catch (NameAlreadyBoundException e) {
+        } catch (final NameAlreadyBoundException e) {
             //one interface in more than one role (e.g. both Local and Remote
             return;
         }
@@ -702,10 +702,10 @@ public class JndiBuilder {
      * @param name
      * @return .
      */
-    private BeanContext findNameOwner(String name) {
-        ContainerSystem containerSystem = SystemInstance.get().getComponent(ContainerSystem.class);
-        for (BeanContext beanContext : containerSystem.deployments()) {
-            Bindings bindings = beanContext.get(Bindings.class);
+    private BeanContext findNameOwner(final String name) {
+        final ContainerSystem containerSystem = SystemInstance.get().getComponent(ContainerSystem.class);
+        for (final BeanContext beanContext : containerSystem.deployments()) {
+            final Bindings bindings = beanContext.get(Bindings.class);
             if (bindings != null && bindings.getBindings().contains(name)) return beanContext;
         }
         return null;
@@ -718,20 +718,20 @@ public class JndiBuilder {
             return bindings;
         }
 
-        public boolean add(String o) {
+        public boolean add(final String o) {
             return bindings.add(o);
         }
 
-        public boolean contains(String o) {
+        public boolean contains(final String o) {
             return bindings.contains(o);
         }
     }
 
     public static class RemoteInterfaceComparator implements Comparator<Class> {
 
-        public int compare(Class a, Class b) {
-            boolean aIsRmote = Remote.class.isAssignableFrom(a);
-            boolean bIsRmote = Remote.class.isAssignableFrom(b);
+        public int compare(final Class a, final Class b) {
+            final boolean aIsRmote = Remote.class.isAssignableFrom(a);
+            final boolean bIsRmote = Remote.class.isAssignableFrom(b);
 
             if (aIsRmote == bIsRmote) return 0;
             return aIsRmote ? 1 : -1;