felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1787142 - in /felix/trunk/osgi-r7/scr/src: main/java/org/apache/felix/scr/impl/inject/Annotations.java test/java/org/apache/felix/scr/impl/inject/AnnotationTest.java
Date Thu, 16 Mar 2017 08:42:19 GMT
Author: cziegeler
Date: Thu Mar 16 08:42:19 2017
New Revision: 1787142

URL: http://svn.apache.org/viewvc?rev=1787142&view=rev
Log:
FELIX-5557 : Updates to section 112.8.2.2 Coercing Component Property Values

Modified:
    felix/trunk/osgi-r7/scr/src/main/java/org/apache/felix/scr/impl/inject/Annotations.java
    felix/trunk/osgi-r7/scr/src/test/java/org/apache/felix/scr/impl/inject/AnnotationTest.java

Modified: felix/trunk/osgi-r7/scr/src/main/java/org/apache/felix/scr/impl/inject/Annotations.java
URL: http://svn.apache.org/viewvc/felix/trunk/osgi-r7/scr/src/main/java/org/apache/felix/scr/impl/inject/Annotations.java?rev=1787142&r1=1787141&r2=1787142&view=diff
==============================================================================
--- felix/trunk/osgi-r7/scr/src/main/java/org/apache/felix/scr/impl/inject/Annotations.java
(original)
+++ felix/trunk/osgi-r7/scr/src/main/java/org/apache/felix/scr/impl/inject/Annotations.java
Thu Mar 16 08:42:19 2017
@@ -281,7 +281,7 @@ public class Annotations
     {
         if (raw == null)
         {
-            return null;
+            return Array.newInstance(componentType, 0);
         }
         if (raw.getClass().isArray())
         {

Modified: felix/trunk/osgi-r7/scr/src/test/java/org/apache/felix/scr/impl/inject/AnnotationTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/osgi-r7/scr/src/test/java/org/apache/felix/scr/impl/inject/AnnotationTest.java?rev=1787142&r1=1787141&r2=1787142&view=diff
==============================================================================
--- felix/trunk/osgi-r7/scr/src/test/java/org/apache/felix/scr/impl/inject/AnnotationTest.java
(original)
+++ felix/trunk/osgi-r7/scr/src/test/java/org/apache/felix/scr/impl/inject/AnnotationTest.java
Thu Mar 16 08:42:19 2017
@@ -226,7 +226,7 @@ public class AnnotationTest extends Test
         assertEquals(0, a.lon());
         assertEquals((short)0, a.shor());
         assertEquals(null, a.string());
-        assertEquals(null, a.array());
+        assertEquals(0, a.array().length);
     }
 
     public @interface A1Arrays {
@@ -251,17 +251,17 @@ public class AnnotationTest extends Test
         assertTrue("expected an A1Arrays", o instanceof A1Arrays);
 
         A1Arrays a = (A1Arrays) o;
-        assertEquals(null, a.bool());
-        assertEquals(null, a.byt());
-        assertEquals(null, a.cha());
-        assertEquals(null, a.clas());
-        assertEquals(null, a.e1());
-        assertEquals(null, a.doubl());
-        assertEquals(null, a.floa());
-        assertEquals(null, a.integer());
-        assertEquals(null,  a.lon());
-        assertEquals(null, a.shor());
-        assertEquals(null, a.string());
+        assertEquals(0, a.bool().length);
+        assertEquals(0, a.byt().length);
+        assertEquals(0, a.cha().length);
+        assertEquals(0, a.clas().length);
+        assertEquals(0, a.e1().length);
+        assertEquals(0, a.doubl().length);
+        assertEquals(0, a.floa().length);
+        assertEquals(0, a.integer().length);
+        assertEquals(0,  a.lon().length);
+        assertEquals(0, a.shor().length);
+        assertEquals(0, a.string().length);
     }
 
     public void testA1Array() throws Exception



Mime
View raw message