Fix FELIX-4508 
Update to ASM 5.0.2
Update the manipulator to reflect the API changes introduced between ASM 3.3.1 (the previously used version) and ASM 5.0.2
Update the Felix Framework version to execute the manipulator tests


git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1592340 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/ipojo/runtime/api/pom.xml b/ipojo/runtime/api/pom.xml
index f3b6c52..d484aca 100644
--- a/ipojo/runtime/api/pom.xml
+++ b/ipojo/runtime/api/pom.xml
@@ -25,6 +25,9 @@
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <packaging>bundle</packaging>
+    <properties>
+        <asm.version>5.0.2</asm.version>
+    </properties>
     <artifactId>org.apache.felix.ipojo.api</artifactId>
     <version>1.11.3-SNAPSHOT</version>
     <name>Apache Felix iPOJO API</name>
@@ -60,9 +63,9 @@
                         <Export-Package>
                             org.apache.felix.ipojo.api,
                             org.apache.felix.ipojo.api.composite,
-                            org.objectweb.asm.commons;version=3.3.1;-split-package:=merge-last,
-                            org.objectweb.asm;version=3.3.1;-split-package:=merge-last,
-                            org.objectweb.asm.signature;version=3.3.1;-split-package:=merge-last
+                            org.objectweb.asm.commons;version=${asm.version};-split-package:=merge-last,
+                            org.objectweb.asm;version=${asm.version};-split-package:=merge-last,
+                            org.objectweb.asm.signature;version=${asm.version};-split-package:=merge-last
                         </Export-Package>
                         <Private-Package>
                             org.objectweb.asm.commons,
diff --git a/ipojo/runtime/core-it/ipojo-core-declaration-test/pom.xml b/ipojo/runtime/core-it/ipojo-core-declaration-test/pom.xml
index 66b0d87..b917846 100644
--- a/ipojo/runtime/core-it/ipojo-core-declaration-test/pom.xml
+++ b/ipojo/runtime/core-it/ipojo-core-declaration-test/pom.xml
@@ -18,43 +18,49 @@
   under the License.
   -->
 
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
 
-  <parent>
-    <groupId>org.apache.felix</groupId>
-    <artifactId>org.apache.felix.ipojo.runtime.core-it</artifactId>
-    <version>1.11.3-SNAPSHOT</version>
-  </parent>
+    <parent>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>org.apache.felix.ipojo.runtime.core-it</artifactId>
+        <version>1.11.3-SNAPSHOT</version>
+    </parent>
 
-  <modelVersion>4.0.0</modelVersion>
+    <modelVersion>4.0.0</modelVersion>
 
-  <artifactId>ipojo-core-declaration-test</artifactId>
+    <artifactId>ipojo-core-declaration-test</artifactId>
 
-  <name>${project.artifactId}</name>
+    <name>${project.artifactId}</name>
 
-  <dependencies>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.api</artifactId>
-      <version>1.11.3-SNAPSHOT</version>
-      <exclusions>
-        <exclusion>
-          <groupId>org.apache.felix</groupId>
-          <artifactId>org.osgi.core</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>org.osgi</groupId>
-          <artifactId>org.osgi.core</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>org.apache.felix</groupId>
-          <artifactId>org.apache.felix.ipojo</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>asm</groupId>
-          <artifactId>asm-all</artifactId>
-        </exclusion>
-      </exclusions>
-    </dependency>
-  </dependencies>
+    <dependencies>
+        <dependency>
+            <groupId>org.ow2.asm</groupId>
+            <artifactId>asm-all</artifactId>
+            <version>5.0.1</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.ipojo.api</artifactId>
+            <version>1.11.3-SNAPSHOT</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.apache.felix</groupId>
+                    <artifactId>org.osgi.core</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.osgi</groupId>
+                    <artifactId>org.osgi.core</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.apache.felix</groupId>
+                    <artifactId>org.apache.felix.ipojo</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.apache.felix</groupId>
+                    <artifactId>org.apache.felix.ipojo.composite</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+    </dependencies>
 </project>
\ No newline at end of file
diff --git a/ipojo/runtime/core-it/ipojo-core-declaration-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/declaration/TestDeclarationBuilderService.java b/ipojo/runtime/core-it/ipojo-core-declaration-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/declaration/TestDeclarationBuilderService.java
index 35dc853..8bda8af 100644
--- a/ipojo/runtime/core-it/ipojo-core-declaration-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/declaration/TestDeclarationBuilderService.java
+++ b/ipojo/runtime/core-it/ipojo-core-declaration-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/declaration/TestDeclarationBuilderService.java
@@ -20,8 +20,6 @@
 package org.apache.felix.ipojo.runtime.core.test.declaration;

 

 import org.apache.felix.ipojo.IPojoFactory;

-//import org.apache.felix.ipojo.api.PrimitiveComponentType;

-//import org.apache.felix.ipojo.api.Service;

 import org.apache.felix.ipojo.extender.DeclarationBuilderService;

 import org.apache.felix.ipojo.extender.DeclarationHandle;

 import org.apache.felix.ipojo.extender.ExtensionDeclaration;

@@ -36,12 +34,7 @@
 import org.osgi.framework.BundleContext;

 

 import static java.lang.String.format;

-import static junit.framework.Assert.assertEquals;

-import static junit.framework.Assert.assertFalse;

-import static junit.framework.Assert.assertTrue;

-

-import java.util.Arrays;

-import java.util.List;

+import static junit.framework.Assert.*;

 

 public class TestDeclarationBuilderService extends Common {

 

@@ -70,7 +63,11 @@
         assertFalse(handle.getStatus().isBound());

         handle.publish();

 

-        osgiHelper.waitForService(HelloService.class, null, 1000);

+        // This test has been already ssen as failed.

+        HelloService hs = osgiHelper.waitForService(HelloService.class, "(factory.name=org.apache.felix.ipojo.runtime" +

+                ".core.test.components.FrenchHelloService)", 1000);

+        assertNotNull(hs);

+        System.out.println("Status: " + handle.getStatus().isBound());

 

         assertTrue(handle.getStatus().isBound());

         handle.retract();

diff --git a/ipojo/runtime/core-it/pom.xml b/ipojo/runtime/core-it/pom.xml
index 0723fc3..881a723 100644
--- a/ipojo/runtime/core-it/pom.xml
+++ b/ipojo/runtime/core-it/pom.xml
@@ -215,6 +215,12 @@
             <artifactId>tinybundles-ipojo</artifactId>
             <version>0.3.0</version>
             <scope>test</scope>
+            <exclusions>
+                <exclusion>
+                    <groupId>asm</groupId>
+                    <artifactId>asm-all</artifactId>
+                </exclusion>
+            </exclusions>
         </dependency>
 
         <dependency>
diff --git a/ipojo/runtime/core/pom.xml b/ipojo/runtime/core/pom.xml
index 4479c0e..c34a5bb 100644
--- a/ipojo/runtime/core/pom.xml
+++ b/ipojo/runtime/core/pom.xml
@@ -92,12 +92,12 @@
             <version>1.11.3-SNAPSHOT</version>
         </dependency>
         <dependency>
-            <groupId>asm</groupId>
+            <groupId>org.ow2.asm</groupId>
             <artifactId>asm-all</artifactId>
-            <version>3.3.1</version>
+            <version>5.0.2</version>
             <exclusions>
                 <exclusion>
-                    <groupId>asm</groupId>
+                    <groupId>org.ow2.asm</groupId>
                     <artifactId>asm-tree</artifactId>
                 </exclusion>
             </exclusions>
@@ -204,7 +204,7 @@
             <plugin>
                 <groupId>org.apache.felix</groupId>
                 <artifactId>maven-ipojo-plugin</artifactId>
-                <version>1.11.1</version>
+                <version>1.11.3-SNAPSHOT</version>
                 <executions>
                     <execution>
                         <goals>
diff --git a/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/extender/internal/processor/ConfigurationAnnotationScanner.java b/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/extender/internal/processor/ConfigurationAnnotationScanner.java
index 66f121d..b537e47 100644
--- a/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/extender/internal/processor/ConfigurationAnnotationScanner.java
+++ b/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/extender/internal/processor/ConfigurationAnnotationScanner.java
@@ -21,9 +21,9 @@
 
 import org.apache.felix.ipojo.configuration.Configuration;
 import org.objectweb.asm.AnnotationVisitor;
+import org.objectweb.asm.ClassVisitor;
 import org.objectweb.asm.Opcodes;
 import org.objectweb.asm.Type;
-import org.objectweb.asm.commons.EmptyVisitor;
 
 /**
  * Class visitor detecting @Configuration annotation.
@@ -33,13 +33,17 @@
  * {@literal parent} is set to the parent class if and only if it's not a java.* class (which don't contain the
  * Configuration annotation) and {@literal isConfiguration} is set to false
  */
-public class ConfigurationAnnotationScanner extends EmptyVisitor implements Opcodes {
+public class ConfigurationAnnotationScanner extends ClassVisitor implements Opcodes {
 
     private static final String CONFIGURATION_ANNOTATION_DESCRIPTOR = Type.getType(Configuration.class)
             .getDescriptor();
     private boolean m_isConfiguration = false;
     private String m_super;
 
+    public ConfigurationAnnotationScanner() {
+        super(Opcodes.ASM5);
+    }
+
 
     @Override
     public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {
@@ -59,7 +63,7 @@
     }
 
     public String getParent() {
-        if (m_super == null  || m_super.startsWith("java/") || m_isConfiguration) {
+        if (m_super == null || m_super.startsWith("java/") || m_isConfiguration) {
             return null;
         }
         return m_super.replace("/", ".");