2121
2222import javax .servlet .ServletContext ;
2323
24- import org .apache .commons .logging .Log ;
25- import org .apache .commons .logging .LogFactory ;
24+ import com .ocpsoft .rewrite .logging .Logger ;
2625
2726/**
2827 * Base class for implementations of the {@link ClassFinder} interface.
@@ -36,7 +35,7 @@ public abstract class AbstractClassFinder implements ClassFinder
3635 /**
3736 * Common logger for all implementations
3837 */
39- protected final Log log = LogFactory . getLog (this .getClass ());
38+ protected final Logger log = Logger . getLogger (this .getClass ());
4039
4140 /**
4241 * The {@link ServletContext}
@@ -52,7 +51,7 @@ public abstract class AbstractClassFinder implements ClassFinder
5251 * The filter for checking which classes to process
5352 */
5453 protected final PackageFilter packageFilter ;
55-
54+
5655 /**
5756 * The filter to check bytecode for interesting annotations
5857 */
@@ -61,15 +60,12 @@ public abstract class AbstractClassFinder implements ClassFinder
6160 /**
6261 * Initialization procedure
6362 *
64- * @param servletContext
65- * The {@link ServletContext} of the web application.
66- * @param classLoader
67- * The {@link ClassLoader} to use for loading classes
68- * @param packageFilter
69- * The {@link PackageFilter} used to check if a package has to be
70- * scanned.
63+ * @param servletContext The {@link ServletContext} of the web application.
64+ * @param classLoader The {@link ClassLoader} to use for loading classes
65+ * @param packageFilter The {@link PackageFilter} used to check if a package has to be scanned.
7166 */
72- public AbstractClassFinder (ServletContext servletContext , ClassLoader classLoader , PackageFilter packageFilter )
67+ public AbstractClassFinder (final ServletContext servletContext , final ClassLoader classLoader ,
68+ final PackageFilter packageFilter )
7369 {
7470 this .servletContext = servletContext ;
7571 this .classLoader = classLoader ;
@@ -80,14 +76,11 @@ public AbstractClassFinder(ServletContext servletContext, ClassLoader classLoade
8076 /**
8177 * Strip everything up to and including a given prefix from a string.
8278 *
83- * @param str
84- * The string to process
85- * @param prefix
86- * The prefix
87- * @return the stripped string or <code>null</code> if the prefix has not
88- * been found
79+ * @param str The string to process
80+ * @param prefix The prefix
81+ * @return the stripped string or <code>null</code> if the prefix has not been found
8982 */
90- protected String stripKnownPrefix (String str , String prefix )
83+ protected String stripKnownPrefix (final String str , final String prefix )
9184 {
9285
9386 int startIndex = str .lastIndexOf (prefix );
@@ -98,18 +91,16 @@ protected String stripKnownPrefix(String str, String prefix)
9891
9992 return null ;
10093 }
101-
94+
10295 /**
10396 * <p>
104- * Creates a FQCN from an {@link URL} representing a <code>.class</code>
105- * file.
97+ * Creates a FQCN from an {@link URL} representing a <code>.class</code> file.
10698 * </p>
107- *
108- * @param url
109- * The path of the class file
99+ *
100+ * @param url The path of the class file
110101 * @return the FQCN of the class
111102 */
112- protected static String getClassName (String filename )
103+ protected static String getClassName (final String filename )
113104 {
114105
115106 // end index is just before ".class"
@@ -123,15 +114,12 @@ protected static String getClassName(String filename)
123114 }
124115
125116 /**
126- * Checks if a supplied class has to be processed by checking the package
127- * name against the {@link PackageFilter}.
117+ * Checks if a supplied class has to be processed by checking the package name against the {@link PackageFilter}.
128118 *
129- * @param className
130- * FQCN of the class
131- * @return <code>true</code> for classes to process, <code>false</code> for
132- * classes to ignore
119+ * @param className FQCN of the class
120+ * @return <code>true</code> for classes to process, <code>false</code> for classes to ignore
133121 */
134- protected boolean mustProcessClass (String className )
122+ protected boolean mustProcessClass (final String className )
135123 {
136124
137125 // the default package
@@ -151,36 +139,31 @@ protected boolean mustProcessClass(String className)
151139
152140 /**
153141 * <p>
154- * Handle a single class to process. This method should only be called if the
155- * class name is accepted by the {@link PackageFilter}.
142+ * Handle a single class to process. This method should only be called if the class name is accepted by the
143+ * {@link PackageFilter}.
156144 * </p>
157145 * <p>
158- * If <code>classFileStream</code> is not <code>null</code> the method will first
159- * try to check whether the class files may contain annotations by scanning
160- * it with the {@link ByteCodeAnnotationFilter}. If no {@link InputStream} is
161- * supplied, this check will be skipped. After that the method will create an
162- * instance of the class and then call
146+ * If <code>classFileStream</code> is not <code>null</code> the method will first try to check whether the class
147+ * files may contain annotations by scanning it with the {@link ByteCodeAnnotationFilter}. If no {@link InputStream}
148+ * is supplied, this check will be skipped. After that the method will create an instance of the class and then call
163149 * {@link PrettyAnnotationHandler#processClass(Class)}.
164150 * </p>
165151 * <p>
166- * Please not the the called of this method is responsible to close the
167- * supplied {@link InputStream}!
152+ * Please not the the called of this method is responsible to close the supplied {@link InputStream}!
168153 * </p>
169154 *
170- * @param className
171- * The FQCN of the class
172- * @param classFileStream
173- * The Java class file of the class (may be <code>null</code>)
174- * @param handler
175- * the handler to notify
155+ * @param className The FQCN of the class
156+ * @param classFileStream The Java class file of the class (may be <code>null</code>)
157+ * @param handler the handler to notify
176158 */
177- protected void processClass (String className , InputStream classFileStream , PrettyAnnotationHandler handler )
159+ protected void processClass (final String className , final InputStream classFileStream ,
160+ final PrettyAnnotationHandler handler )
178161 {
179162
180- // bytecode check is only performed if the InputStream is available
163+ // bytecode check is only performed if the InputStream is available
181164 if (classFileStream != null )
182165 {
183-
166+
184167 // we must take care of IOExceptions thrown by ByteCodeAnnotationFilter
185168 try
186169 {
@@ -199,7 +182,7 @@ protected void processClass(String className, InputStream classFileStream, Prett
199182 {
200183 log .debug ("Bytecode filter recommends to scan class: " + className );
201184 }
202-
185+
203186 }
204187 catch (IOException e )
205188 {
@@ -209,7 +192,7 @@ protected void processClass(String className, InputStream classFileStream, Prett
209192 }
210193 }
211194 }
212-
195+
213196 try
214197 {
215198 // request this class from the ClassLoader
0 commit comments