FELIX-4631 : [DS][R6/RFC212] Implement field injection.
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1639473 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/scr/src/main/java/org/apache/felix/scr/impl/helper/FieldHandler.java b/scr/src/main/java/org/apache/felix/scr/impl/helper/FieldHandler.java
index c8e07a2..ff3cf28 100644
--- a/scr/src/main/java/org/apache/felix/scr/impl/helper/FieldHandler.java
+++ b/scr/src/main/java/org/apache/felix/scr/impl/helper/FieldHandler.java
@@ -794,6 +794,7 @@
{
logger.log( LogService.LOG_WARNING, "{0} cannot be found", new Object[]
{handler.metadata.getField()}, ex.getTargetException() );
+ field = null;
}
handler.setField( field, logger );
@@ -941,21 +942,17 @@
public InitReferenceMethod getInit()
{
- if ( metadata.isMultiple() )
+ return new InitReferenceMethod()
{
- return new InitReferenceMethod()
- {
- public boolean init(final Object componentInstance, final SimpleLogger logger)
+ public boolean init(final Object componentInstance, final SimpleLogger logger)
+ {
+ if ( fieldExists( logger) )
{
- if ( fieldExists( logger) )
- {
- return initField(componentInstance, logger);
- }
- return false;
+ return initField(componentInstance, logger);
}
- };
- }
- return null;
+ return false;
+ }
+ };
}
}