felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r911304 - in /felix/trunk/metatype/src: main/java/org/apache/felix/metatype/AD.java test/java/org/apache/felix/metatype/ADTest.java
Date Thu, 18 Feb 2010 10:05:13 GMT
Author: fmeschbe
Date: Thu Feb 18 10:05:13 2010
New Revision: 911304

URL: http://svn.apache.org/viewvc?rev=911304&view=rev
Log:
FELIX-2094 Ensure empty default value attribute in <AD> element gives String[]{ "" }.

Modified:
    felix/trunk/metatype/src/main/java/org/apache/felix/metatype/AD.java
    felix/trunk/metatype/src/test/java/org/apache/felix/metatype/ADTest.java

Modified: felix/trunk/metatype/src/main/java/org/apache/felix/metatype/AD.java
URL: http://svn.apache.org/viewvc/felix/trunk/metatype/src/main/java/org/apache/felix/metatype/AD.java?rev=911304&r1=911303&r2=911304&view=diff
==============================================================================
--- felix/trunk/metatype/src/main/java/org/apache/felix/metatype/AD.java (original)
+++ felix/trunk/metatype/src/main/java/org/apache/felix/metatype/AD.java Thu Feb 18 10:05:13
2010
@@ -372,11 +372,16 @@
 
     public static String[] splitList( String listString )
     {
-        // return nothing ...
+        // check for non-existing or empty lists
         if ( listString == null )
         {
             return null;
         }
+        else if ( listString.length() == 0 )
+        {
+            return new String[]
+                { "" };
+        }
 
         List values = new ArrayList();
         boolean escape = false;

Modified: felix/trunk/metatype/src/test/java/org/apache/felix/metatype/ADTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/metatype/src/test/java/org/apache/felix/metatype/ADTest.java?rev=911304&r1=911303&r2=911304&view=diff
==============================================================================
--- felix/trunk/metatype/src/test/java/org/apache/felix/metatype/ADTest.java (original)
+++ felix/trunk/metatype/src/test/java/org/apache/felix/metatype/ADTest.java Thu Feb 18 10:05:13
2010
@@ -1,4 +1,4 @@
-/* 
+/*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
  * distributed with this work for additional information
@@ -27,7 +27,7 @@
 /**
  * The <code>ADTest</code> class tests the static helper methods of the
  * {@link AD} class.
- * 
+ *
  * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
 public class ADTest extends TestCase
@@ -48,7 +48,9 @@
     {
         String listString = "";
         String[] list = AD.splitList( listString );
-        assertNull( list );
+        assertNotNull( list );
+        assertEquals( 1, list.length );
+        assertEquals( listString, list[0] );
     }
 
 



Mime
View raw message