Author: richard.opalka(a)jboss.com
Date: 2009-04-03 10:17:17 -0400 (Fri, 03 Apr 2009)
New Revision: 9722
Modified:
common/trunk/src/main/java/org/jboss/wsf/common/javax/JavaxAnnotationHelper.java
Log:
[JBWS-2074] rollback
Modified:
common/trunk/src/main/java/org/jboss/wsf/common/javax/JavaxAnnotationHelper.java
===================================================================
---
common/trunk/src/main/java/org/jboss/wsf/common/javax/JavaxAnnotationHelper.java 2009-04-03
13:55:07 UTC (rev 9721)
+++
common/trunk/src/main/java/org/jboss/wsf/common/javax/JavaxAnnotationHelper.java 2009-04-03
14:17:17 UTC (rev 9722)
@@ -80,46 +80,47 @@
{
if (instance == null)
throw new IllegalArgumentException("Object instance cannot be null");
- if (injections == null)
- throw new IllegalArgumentException("Injections metadata cannot be
null");
Class<?> instanceClass = instance.getClass();
InitialContext ctx = new InitialContext();
// inject descriptor driven annotations
- Collection<InjectionMetaData> injectionMDs =
injections.getInjectionsMetaData(instanceClass);
- for (InjectionMetaData injectionMD : injectionMDs)
+ if (injections != null)
{
- Method method = getMethod(injectionMD, instanceClass);
- if (method != null)
+ Collection<InjectionMetaData> injectionMDs =
injections.getInjectionsMetaData(instanceClass);
+ for (InjectionMetaData injectionMD : injectionMDs)
{
- try
+ Method method = getMethod(injectionMD, instanceClass);
+ if (method != null)
{
- inject(instance, method, injectionMD.getEnvEntryName(), ctx);
- }
- catch (Exception e)
- {
- LOG.warn("Cannot inject method (descriptor driven injection): "
+ injectionMD, e);
- }
- }
- else
- {
- Field field = getField(injectionMD, instanceClass);
- if (field != null)
- {
try
{
- inject(instance, field, injectionMD.getEnvEntryName(), ctx);
+ inject(instance, method, injectionMD.getEnvEntryName(), ctx);
}
catch (Exception e)
{
- LOG.warn("Cannot inject field (descriptor driven injection):
" + injectionMD, e);
+ LOG.warn("Cannot inject method (descriptor driven injection):
" + injectionMD, e);
}
}
else
{
- LOG.warn("Cannot find injection target for: " + injectionMD);
+ Field field = getField(injectionMD, instanceClass);
+ if (field != null)
+ {
+ try
+ {
+ inject(instance, field, injectionMD.getEnvEntryName(), ctx);
+ }
+ catch (Exception e)
+ {
+ LOG.warn("Cannot inject field (descriptor driven injection):
" + injectionMD, e);
+ }
+ }
+ else
+ {
+ LOG.warn("Cannot find injection target for: " +
injectionMD);
+ }
}
}
}
Show replies by date