You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by db...@apache.org on 2011/07/07 23:09:52 UTC
svn commit: r1144037 -
/geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/GeronimoResourceInjectionService.java
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();