Author: markt Date: Tue Oct 18 17:02:10 2011 New Revision: 1185756 URL: http://svn.apache.org/viewvc?rev=1185756&view=rev Log: Clean-up. No functional change.
Modified: tomcat/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java tomcat/trunk/java/org/apache/jasper/util/FastRemovalDequeue.java Modified: tomcat/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java?rev=1185756&r1=1185755&r2=1185756&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java (original) +++ tomcat/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java Tue Oct 18 17:02:10 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. @@ -68,9 +68,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<?>,WeakReference<List<AnnotationCacheEntry>>> annotationCache = new WeakHashMap<Class<?>, WeakReference<List<AnnotationCacheEntry>>>(); @@ -134,7 +134,7 @@ public class DefaultInstanceManager impl } @Override - public void newInstance(Object o) + public void newInstance(Object o) throws IllegalAccessException, InvocationTargetException, NamingException { newInstance(o, o.getClass()); } @@ -268,7 +268,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 @@ -321,7 +321,7 @@ public class DefaultInstanceManager impl } } } - + // Initialize methods annotations Method[] methods = null; if (Globals.IS_SECURITY_ENABLED) { @@ -393,7 +393,7 @@ public class DefaultInstanceManager impl } postConstruct = method; } - + if (method.isAnnotationPresent(PreDestroy.class)) { if ((preDestroy != null || method.getParameterTypes().length != 0) || @@ -415,7 +415,7 @@ public class DefaultInstanceManager impl null, 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) { @@ -528,7 +528,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)) { @@ -642,7 +644,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); Modified: tomcat/trunk/java/org/apache/jasper/util/FastRemovalDequeue.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/util/FastRemovalDequeue.java?rev=1185756&r1=1185755&r2=1185756&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/jasper/util/FastRemovalDequeue.java (original) +++ tomcat/trunk/java/org/apache/jasper/util/FastRemovalDequeue.java Tue Oct 18 17:02:10 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. @@ -17,7 +17,7 @@ package org.apache.jasper.util; /** - * + * * The FastRemovalDequeue is a Dequeue that supports constant time removal of * entries. This is achieved by using a doubly linked list and wrapping any object * added to the collection with an Entry type, that is returned to the consumer. @@ -71,7 +71,7 @@ public class FastRemovalDequeue<T> { * Retrieve the size of the list. * This method also needs to be externaly synchronized to * ensure correct publication of changes. - * + * * @return the size of the list. * */ public synchronized int getSize() { @@ -81,7 +81,7 @@ public class FastRemovalDequeue<T> { /** * Adds an object to the start of the list and returns the entry created for * said object. The entry can later be reused for moving the entry. - * + * * @param object the object to prepend to the start of the list. * @return an entry for use when the object should be moved. * */ @@ -105,7 +105,7 @@ public class FastRemovalDequeue<T> { /** * Adds an object to the end of the list and returns the entry created for * said object. The entry can later be reused for moving the entry. - * + * * @param object the object to append to the end of the list. * @return an entry for use when the object should be moved. * */ @@ -128,7 +128,7 @@ public class FastRemovalDequeue<T> { /** * Removes the first element of the list and returns its content. - * + * * @return the content of the first element of the list. **/ public synchronized T unpush() { @@ -148,7 +148,7 @@ public class FastRemovalDequeue<T> { /** * Removes the last element of the list and returns its content. - * + * * @return the content of the last element of the list. **/ public synchronized T pop() { @@ -194,7 +194,7 @@ public class FastRemovalDequeue<T> { * * Could also be implemented as remove() and * push(), but explicitely coding might be a bit faster. - * + * * @param element the entry to move in front. * */ public synchronized void moveFirst(final Entry element) { @@ -220,7 +220,7 @@ public class FastRemovalDequeue<T> { * * Could also be implemented as remove() and * unpop(), but explicitely coding might be a bit faster. - * + * * @param element the entry to move to the back. * */ public synchronized void moveLast(final Entry element) { @@ -287,7 +287,7 @@ public class FastRemovalDequeue<T> { public final void clearReplaced() { this.replaced = null; } - + private final Entry getNext() { return next; } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org