You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by ro...@apache.org on 2019/01/16 15:51:12 UTC
svn commit: r1851457 - in /felix/branches/scr-2.0.x/scr/src:
main/java/org/apache/felix/scr/impl/manager/MultiplePrototypeRefPair.java
test/java/org/apache/felix/scr/integration/ComponentTestBase.java
Author: rotty3000
Date: Wed Jan 16 15:51:12 2019
New Revision: 1851457
URL: http://svn.apache.org/viewvc?rev=1851457&view=rev
Log:
FELIX-5950 : NPE in MultiplePrototypeRefPair.unsetServiceObject
Modified:
felix/branches/scr-2.0.x/scr/src/main/java/org/apache/felix/scr/impl/manager/MultiplePrototypeRefPair.java
felix/branches/scr-2.0.x/scr/src/test/java/org/apache/felix/scr/integration/ComponentTestBase.java
Modified: felix/branches/scr-2.0.x/scr/src/main/java/org/apache/felix/scr/impl/manager/MultiplePrototypeRefPair.java
URL: http://svn.apache.org/viewvc/felix/branches/scr-2.0.x/scr/src/main/java/org/apache/felix/scr/impl/manager/MultiplePrototypeRefPair.java?rev=1851457&r1=1851456&r2=1851457&view=diff
==============================================================================
--- felix/branches/scr-2.0.x/scr/src/main/java/org/apache/felix/scr/impl/manager/MultiplePrototypeRefPair.java (original)
+++ felix/branches/scr-2.0.x/scr/src/main/java/org/apache/felix/scr/impl/manager/MultiplePrototypeRefPair.java Wed Jan 16 15:51:12 2019
@@ -20,6 +20,7 @@
package org.apache.felix.scr.impl.manager;
+import java.util.Iterator;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
@@ -64,7 +65,17 @@ public class MultiplePrototypeRefPair<S,
@Override
public T unsetServiceObject(ComponentContextImpl<S> key)
{
- return instances.get(key);
+ if ( key == null )
+ {
+ final Iterator<T> iter = instances.values().iterator();
+ while ( iter.hasNext() )
+ {
+ this.serviceObjects.ungetService(iter.next());
+ }
+ instances.clear();
+ return null ;
+ }
+ return instances.remove(key);
}
@Override
Modified: felix/branches/scr-2.0.x/scr/src/test/java/org/apache/felix/scr/integration/ComponentTestBase.java
URL: http://svn.apache.org/viewvc/felix/branches/scr-2.0.x/scr/src/test/java/org/apache/felix/scr/integration/ComponentTestBase.java?rev=1851457&r1=1851456&r2=1851457&view=diff
==============================================================================
--- felix/branches/scr-2.0.x/scr/src/test/java/org/apache/felix/scr/integration/ComponentTestBase.java (original)
+++ felix/branches/scr-2.0.x/scr/src/test/java/org/apache/felix/scr/integration/ComponentTestBase.java Wed Jan 16 15:51:12 2019
@@ -116,7 +116,7 @@ public abstract class ComponentTestBase
protected static String paxRunnerVmOption = null;
//To investigate any problems at all set to "debug"
- protected static String DS_LOGLEVEL = "debug";
+ protected static String DS_LOGLEVEL = "error";
protected static String bsnVersionUniqueness = "single";