Author: markt Date: Wed Oct 19 09:43:36 2011 New Revision: 1186055 URL: http://svn.apache.org/viewvc?rev=1186055&view=rev Log: Code clean-up. No functional change.
Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java?rev=1186055&r1=1186054&r2=1186055&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java Wed Oct 19 09:43:36 2011 @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -66,9 +66,9 @@ public class DefaultInstanceManager impl protected final ClassLoader containerClassLoader; protected boolean privileged; protected boolean ignoreAnnotations; - private Properties restrictedFilters = new Properties(); - private Properties restrictedListeners = new Properties(); - private Properties restrictedServlets = new Properties(); + private final Properties restrictedFilters = new Properties(); + private final Properties restrictedListeners = new Properties(); + private final Properties restrictedServlets = new Properties(); private final Map<Class<?>,List<AnnotationCacheEntry>> annotationCache = new WeakHashMap<Class<?>, List<AnnotationCacheEntry>>(); @@ -132,7 +132,7 @@ public class DefaultInstanceManager impl } @Override - public void newInstance(Object o) + public void newInstance(Object o) throws IllegalAccessException, InvocationTargetException, NamingException { newInstance(o, o.getClass()); } @@ -258,7 +258,7 @@ public class DefaultInstanceManager impl } if (annotations == null) { annotations = new ArrayList<AnnotationCacheEntry>(); - + if (context != null) { // Initialize fields annotations for resource injection if // JNDI is enabled @@ -312,7 +312,7 @@ public class DefaultInstanceManager impl } } } - + // Initialize methods annotations Method[] methods = null; if (Globals.IS_SECURITY_ENABLED) { @@ -396,7 +396,7 @@ public class DefaultInstanceManager impl } postConstruct = method; } - + if (method.isAnnotationPresent(PreDestroy.class)) { if ((preDestroy != null || method.getParameterTypes().length != 0) || @@ -422,7 +422,7 @@ public class DefaultInstanceManager impl AnnotationCacheEntryType.PRE_DESTROY)); } if (annotations.size() == 0) { - // Use common empty list to save memory + // Use common empty list to save memory annotations = Collections.emptyList(); } synchronized (annotationCache) { @@ -453,7 +453,7 @@ public class DefaultInstanceManager impl } Class<?> clazz = instance.getClass(); - + while (clazz != null) { List<AnnotationCacheEntry> annotations; synchronized (annotationCache) { @@ -526,7 +526,9 @@ public class DefaultInstanceManager impl } private void checkAccess(Class<?> clazz) { - if (privileged) return; + if (privileged) { + return; + } if (Filter.class.isAssignableFrom(clazz)) { checkAccess(clazz, restrictedFilters); } else if (Servlet.class.isAssignableFrom(clazz)) { @@ -640,7 +642,7 @@ public class DefaultInstanceManager impl return name.toString(); } - + private static String normalize(String jndiName){ if(jndiName != null && jndiName.startsWith("java:comp/env/")){ return jndiName.substring(14); --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org