felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1620869 - in /felix/trunk/eventadmin/impl: changelog.txt src/main/java/org/apache/felix/eventadmin/impl/handler/EventHandlerTracker.java
Date Wed, 27 Aug 2014 11:52:50 GMT
Author: cziegeler
Date: Wed Aug 27 11:52:50 2014
New Revision: 1620869

URL: http://svn.apache.org/r1620869
Log:
[FELIX-4618] - NPE if config value for ignore topic or timeout is empty

Modified:
    felix/trunk/eventadmin/impl/changelog.txt
    felix/trunk/eventadmin/impl/src/main/java/org/apache/felix/eventadmin/impl/handler/EventHandlerTracker.java

Modified: felix/trunk/eventadmin/impl/changelog.txt
URL: http://svn.apache.org/viewvc/felix/trunk/eventadmin/impl/changelog.txt?rev=1620869&r1=1620868&r2=1620869&view=diff
==============================================================================
--- felix/trunk/eventadmin/impl/changelog.txt (original)
+++ felix/trunk/eventadmin/impl/changelog.txt Wed Aug 27 11:52:50 2014
@@ -2,6 +2,7 @@ Changes from 1.4.0 to 1.4.2
 ---------------------------
 ** Bug
     * [FELIX-4617] - Empty configurations for ignore topic and ignore timeout lead to error
messages in the log
+    * [FELIX-4618] - NPE if config value for ignore topic or timeout is empty
 
 
 Changes from 1.3.2 to 1.4.0

Modified: felix/trunk/eventadmin/impl/src/main/java/org/apache/felix/eventadmin/impl/handler/EventHandlerTracker.java
URL: http://svn.apache.org/viewvc/felix/trunk/eventadmin/impl/src/main/java/org/apache/felix/eventadmin/impl/handler/EventHandlerTracker.java?rev=1620869&r1=1620868&r2=1620869&view=diff
==============================================================================
--- felix/trunk/eventadmin/impl/src/main/java/org/apache/felix/eventadmin/impl/handler/EventHandlerTracker.java
(original)
+++ felix/trunk/eventadmin/impl/src/main/java/org/apache/felix/eventadmin/impl/handler/EventHandlerTracker.java
Wed Aug 27 11:52:50 2014
@@ -18,6 +18,7 @@
  */
 package org.apache.felix.eventadmin.impl.handler;
 
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashSet;
 import java.util.List;
@@ -283,7 +284,7 @@ public class EventHandlerTracker extends
         }
         else
         {
-            matchers = new Matcher[config.length];
+            final List<Matcher> list = new ArrayList<EventHandlerTracker.Matcher>();
             for(int i=0;i<config.length;i++)
             {
                 String value = config[i];
@@ -295,7 +296,7 @@ public class EventHandlerTracker extends
                 {
                     if ( value.endsWith(".") )
                     {
-                        matchers[i] = new PackageMatcher(value.substring(0, value.length()
- 1));
+                        list.add(new PackageMatcher(value.substring(0, value.length() - 1)));
                     }
                     else if ( value.endsWith("*") )
                     {
@@ -303,14 +304,22 @@ public class EventHandlerTracker extends
                         {
                             return new Matcher[] {new MatcherAll()};
                         }
-                        matchers[i] = new SubPackageMatcher(value.substring(0, value.length()
- 1));
+                        list.add(new SubPackageMatcher(value.substring(0, value.length()
- 1)));
                     }
                     else
                     {
-                        matchers[i] = new ClassMatcher(value);
+                        list.add(new ClassMatcher(value));
                     }
                 }
             }
+            if ( list.size() > 0 )
+            {
+                matchers = list.toArray(new Matcher[list.size()]);
+            }
+            else
+            {
+                matchers = null;
+            }
         }
         return matchers;
 	}



Mime
View raw message