geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblev...@apache.org
Subject svn commit: r1144037 - /geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/GeronimoResourceInjectionService.java
Date Thu, 07 Jul 2011 21:09:52 GMT
Author: dblevins
Date: Thu Jul  7 21:09:51 2011
New Revision: 1144037

URL: http://svn.apache.org/viewvc?rev=1144037&view=rev
Log:
First part of GERONIMO-6038: testNonContextualSessionBeanReferenceIsIntercepted
Still in progress

Modified:
    geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/GeronimoResourceInjectionService.java

Modified: geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/GeronimoResourceInjectionService.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/GeronimoResourceInjectionService.java?rev=1144037&r1=1144036&r2=1144037&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/GeronimoResourceInjectionService.java
(original)
+++ geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/GeronimoResourceInjectionService.java
Thu Jul  7 21:09:51 2011
@@ -69,23 +69,22 @@ public class GeronimoResourceInjectionSe
             Field[] fields = securityService.doPrivilegedGetDeclaredFields(currentClass);
 
             for (Field field : fields) {
-                if (!field.isAnnotationPresent(Produces.class)) {
-                    if (!Modifier.isStatic(field.getModifiers())) {
-                        Annotation ann = AnnotationUtil.hasOwbInjectableResource(field.getDeclaredAnnotations());
-                        if (ann != null) {
-                            @SuppressWarnings("unchecked")
-                            ResourceReference<Object, ?> resourceRef = new ResourceReference(field.getDeclaringClass(),
field.getName(), field.getType(), ann);
-                            boolean acess = field.isAccessible();
-                            try {
-                                securityService.doPrivilegedSetAccessible(field, true);
-                                field.set(managedBeanInstance, getResourceReference(resourceRef));
-                            } catch (Exception e) {
-                                throw new WebBeansException("Unable to inject field" + field,
e);
-                            } finally {
-                                securityService.doPrivilegedSetAccessible(field, acess);
-                            }
-                        }
-                    }
+                if (Modifier.isStatic(field.getModifiers())) continue;
+
+                Annotation ann = AnnotationUtil.hasOwbInjectableResource(field.getDeclaredAnnotations());
+
+                if (ann == null) continue;
+
+                @SuppressWarnings("unchecked")
+                ResourceReference<Object, ?> resourceRef = new ResourceReference(field.getDeclaringClass(),
field.getName(), field.getType(), ann);
+                boolean acess = field.isAccessible();
+                try {
+                    securityService.doPrivilegedSetAccessible(field, true);
+                    field.set(managedBeanInstance, getResourceReference(resourceRef));
+                } catch (Exception e) {
+                    throw new WebBeansException("Unable to inject field" + field, e);
+                } finally {
+                    securityService.doPrivilegedSetAccessible(field, acess);
                 }
             }
             currentClass = currentClass.getSuperclass();



Mime
View raw message