felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickh...@apache.org
Subject svn commit: r910440 - in /felix/trunk/bundlerepository/src: main/java/org/apache/felix/bundlerepository/FilterImpl.java main/java/org/apache/felix/bundlerepository/StringSet.java test/java/org/apache/felix/bundlerepository/FilterImplTest.java
Date Tue, 16 Feb 2010 09:10:11 GMT
Author: rickhall
Date: Tue Feb 16 09:10:10 2010
New Revision: 910440

URL: http://svn.apache.org/viewvc?rev=910440&view=rev
Log:
Applied patch to address some NPEs. (FELIX-1809)

Modified:
    felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/FilterImpl.java
    felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/StringSet.java
    felix/trunk/bundlerepository/src/test/java/org/apache/felix/bundlerepository/FilterImplTest.java

Modified: felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/FilterImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/FilterImpl.java?rev=910440&r1=910439&r2=910440&view=diff
==============================================================================
--- felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/FilterImpl.java
(original)
+++ felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/FilterImpl.java
Tue Feb 16 09:10:10 2010
@@ -350,7 +350,7 @@
                         }
                     }
                 }
-                else if (numClass.isArray())
+                else if (numClass != null && numClass.isArray())
                 {
                     int len = Array.getLength(obj);
                     for (int i = 0; i < len; i++)
@@ -425,6 +425,7 @@
             }
             catch (Exception e)
             {
+                e.printStackTrace();
             }
             return false;
         }
@@ -660,4 +661,4 @@
             return false;
         }
     }
-}
\ No newline at end of file
+}

Modified: felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/StringSet.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/StringSet.java?rev=910440&r1=910439&r2=910440&view=diff
==============================================================================
--- felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/StringSet.java
(original)
+++ felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/StringSet.java
Tue Feb 16 09:10:10 2010
@@ -26,10 +26,13 @@
 
     public StringSet(String set)
     {
-        StringTokenizer st = new StringTokenizer(set, ",");
-        while (st.hasMoreTokens())
+        if (set != null)
         {
-            add(st.nextToken().trim());
+            StringTokenizer st = new StringTokenizer(set, ",");
+            while (st.hasMoreTokens())
+            {
+                add(st.nextToken().trim());
+            }
         }
     }
 }
\ No newline at end of file

Modified: felix/trunk/bundlerepository/src/test/java/org/apache/felix/bundlerepository/FilterImplTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundlerepository/src/test/java/org/apache/felix/bundlerepository/FilterImplTest.java?rev=910440&r1=910439&r2=910440&view=diff
==============================================================================
--- felix/trunk/bundlerepository/src/test/java/org/apache/felix/bundlerepository/FilterImplTest.java
(original)
+++ felix/trunk/bundlerepository/src/test/java/org/apache/felix/bundlerepository/FilterImplTest.java
Tue Feb 16 09:10:10 2010
@@ -70,7 +70,7 @@
         dict.put("package", "org.eclipse.core.runtime");
         dict.put("version", "0.0.0");
         dict.put("common", "split");
-        assertFalse(filterImpl.match(dict));
+        assertTrue(filterImpl.match(dict));
 
         filterImpl = new FilterImpl("(&(package=org.eclipse.core.runtime)(version>=0.0.0)(common=split)(mandatory:*>common))");
         dict = new Hashtable();
@@ -116,5 +116,4 @@
         assertFalse(filterImpl.matchCase(dict));
         
     }
-    
-}
+}
\ No newline at end of file



Mime
View raw message