geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From genspr...@apache.org
Subject svn commit: r1128553 - /geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java
Date Sat, 28 May 2011 05:06:29 GMT
Author: genspring
Date: Sat May 28 05:06:29 2011
New Revision: 1128553

URL: http://svn.apache.org/viewvc?rev=1128553&view=rev
Log:
if the type in @resource annotation is Object.class, return the filed type directly.

Modified:
    geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java?rev=1128553&r1=1128552&r2=1128553&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java
(original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java
Sat May 28 05:06:29 2011
@@ -421,7 +421,7 @@ public abstract class AbstractNamingBuil
             try {
                 Field field = clazz.getDeclaredField(fieldName);
                 Resource resource = field.getAnnotation(Resource.class);
-                if (resource != null) {
+                if (resource != null && resource.type()!=Object.class) {
                     type = chooseType(fieldName, field.getType(), resource.type());
                 } else {
                     type = field.getType();
@@ -437,7 +437,7 @@ public abstract class AbstractNamingBuil
                         String setName = Introspector.decapitalize(methodName.substring(3));
                         if (fieldName.equals(setName)) {
                             Resource resource = method.getAnnotation(Resource.class);
-                            if (resource != null) {
+                            if (resource != null && resource.type()!=Object.class)
{
                                 type = chooseType(fieldName, method.getParameterTypes()[0],
resource.type());
                             } else {
                                 type = method.getParameterTypes()[0];
@@ -446,12 +446,15 @@ public abstract class AbstractNamingBuil
                     }
                 }
             }
+            
+            if (type != null) {
+                return deprimitivize(type);
+            }
+            
             clazz = clazz.getSuperclass();
         } while (clazz != null);
         
-        if (type != null) {
-            return deprimitivize(type);
-        }
+
         
         throw new NoSuchFieldException(fieldName);
     }



Mime
View raw message