tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject svn commit: r409695 - in /tomcat/tc6.0.x/trunk/java/org/apache/catalina: startup/WebAnnotationSet.java util/AnnotationProcessor.java
Date Fri, 26 May 2006 16:38:24 GMT
Author: remm
Date: Fri May 26 09:38:24 2006
New Revision: 409695

URL: http://svn.apache.org/viewvc?rev=409695&view=rev
Log:
- Fix some bugs with annotation support.

Modified:
    tomcat/tc6.0.x/trunk/java/org/apache/catalina/startup/WebAnnotationSet.java
    tomcat/tc6.0.x/trunk/java/org/apache/catalina/util/AnnotationProcessor.java

Modified: tomcat/tc6.0.x/trunk/java/org/apache/catalina/startup/WebAnnotationSet.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/startup/WebAnnotationSet.java?rev=409695&r1=409694&r2=409695&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/catalina/startup/WebAnnotationSet.java (original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/catalina/startup/WebAnnotationSet.java Fri May 26
09:38:24 2006
@@ -99,6 +99,10 @@
             if (children[i] instanceof StandardWrapper) {
                 
                 wrapper = (StandardWrapper) children[i];
+                if (wrapper.getServletClass() == null) {
+                    continue;
+                }
+                
                 try {
                     classClass = classLoader.loadClass(wrapper.getServletClass());
                 } catch (ClassNotFoundException e) {

Modified: tomcat/tc6.0.x/trunk/java/org/apache/catalina/util/AnnotationProcessor.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/util/AnnotationProcessor.java?rev=409695&r1=409694&r2=409695&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/catalina/util/AnnotationProcessor.java (original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/catalina/util/AnnotationProcessor.java Fri May 26
09:38:24 2006
@@ -30,8 +30,6 @@
 import javax.persistence.PersistenceUnit;
 import javax.xml.ws.WebServiceRef;
 
-import org.apache.tomcat.util.IntrospectionUtils;
-
 
 /**
  * Verify the annotation and Process it.
@@ -49,7 +47,7 @@
     public static void postConstruct(Object instance)
         throws IllegalAccessException, InvocationTargetException {
         
-        Method[] methods = IntrospectionUtils.findMethods(instance.getClass());
+        Method[] methods = instance.getClass().getDeclaredMethods();
         Method postConstruct = null;
         for (int i = 0; i < methods.length; i++) {
             if (methods[i].isAnnotationPresent(PostConstruct.class)) {
@@ -82,7 +80,7 @@
     public static void preDestroy(Object instance)
         throws IllegalAccessException, InvocationTargetException {
         
-        Method[] methods = IntrospectionUtils.findMethods(instance.getClass());
+        Method[] methods = instance.getClass().getDeclaredMethods();
         Method preDestroy = null;
         for (int i = 0; i < methods.length; i++) {
             if (methods[i].isAnnotationPresent(PreDestroy.class)) {
@@ -116,7 +114,7 @@
         throws IllegalAccessException, InvocationTargetException, NamingException {
         
         // Initialize fields annotations
-        Field[] fields = instance.getClass().getFields();
+        Field[] fields = instance.getClass().getDeclaredFields();
         for (int i = 0; i < fields.length; i++) {
             if (fields[i].isAnnotationPresent(Resource.class)) {
                 Resource annotation = (Resource) fields[i].getAnnotation(Resource.class);
@@ -144,7 +142,7 @@
         }
         
         // Initialize methods annotations
-        Method[] methods = IntrospectionUtils.findMethods(instance.getClass());
+        Method[] methods = instance.getClass().getDeclaredMethods();
         for (int i = 0; i < methods.length; i++) {
             if (methods[i].isAnnotationPresent(Resource.class)) {
                 Resource annotation = (Resource) methods[i].getAnnotation(Resource.class);



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message