You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by cl...@apache.org on 2014/05/04 14:36:11 UTC
svn commit: r1592340 [3/3] - in /felix/trunk/ipojo:
handler/temporal/temporal-dependency-handler/ manipulator/manipulator-bom/
manipulator/manipulator-it/
manipulator/manipulator-it/ipojo-manipulator-manipulation-test/src/test/java/org/apache/felix/ipo...
Modified: felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/visitor/ProvidesVisitor.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/visitor/ProvidesVisitor.java?rev=1592340&r1=1592339&r2=1592340&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/visitor/ProvidesVisitor.java (original)
+++ felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/visitor/ProvidesVisitor.java Sun May 4 12:36:09 2014
@@ -23,15 +23,16 @@ import org.apache.felix.ipojo.manipulato
import org.apache.felix.ipojo.metadata.Attribute;
import org.apache.felix.ipojo.metadata.Element;
import org.objectweb.asm.AnnotationVisitor;
+import org.objectweb.asm.Opcodes;
import org.objectweb.asm.Type;
-import org.objectweb.asm.commons.EmptyVisitor;
/**
* Parse the @Provides annotation.
- * @see org.apache.felix.ipojo.annotations.Provides
+ *
* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+ * @see org.apache.felix.ipojo.annotations.Provides
*/
-public class ProvidesVisitor extends EmptyVisitor implements AnnotationVisitor {
+public class ProvidesVisitor extends AnnotationVisitor {
private ComponentWorkbench workbench;
@@ -41,14 +42,16 @@ public class ProvidesVisitor extends Emp
private Element m_prov = new Element("provides", "");
public ProvidesVisitor(ComponentWorkbench workbench) {
+ super(Opcodes.ASM5);
this.workbench = workbench;
}
/**
* Visit @provides annotation attributes.
- * @param name : annotation attribute name
+ *
+ * @param name : annotation attribute name
* @param value : annotation attribute value
- * @see org.objectweb.asm.commons.EmptyVisitor#visit(java.lang.String, java.lang.Object)
+ * @see org.objectweb.asm.AnnotationVisitor#visit(java.lang.String, java.lang.Object)
*/
public void visit(String name, Object value) {
if (name.equals("factory")) { // Should be deprecated
@@ -61,9 +64,10 @@ public class ProvidesVisitor extends Emp
/**
* Visit specifications array.
+ *
* @param name : attribute name
* @return a visitor visiting each element of the array.
- * @see org.objectweb.asm.commons.EmptyVisitor#visitArray(java.lang.String)
+ * @see org.objectweb.asm.AnnotationVisitor#visitArray(java.lang.String)
*/
public AnnotationVisitor visitArray(String name) {
if (name.equals("specifications")) {
@@ -71,7 +75,7 @@ public class ProvidesVisitor extends Emp
} else if (name.equals("properties")) {
// Create a new simple visitor to visit the nested ServiceProperty annotations
// Collected properties are collected in m_prov
- return new EmptyVisitor() {
+ return new AnnotationVisitor(Opcodes.ASM5) {
public AnnotationVisitor visitAnnotation(String ignored, String desc) {
return new FieldPropertyVisitor(m_prov);
}
@@ -84,24 +88,31 @@ public class ProvidesVisitor extends Emp
/**
* End of the visit.
* Append to the element element the computed "provides" element.
- * @see org.objectweb.asm.commons.EmptyVisitor#visitEnd()
+ *
+ * @see org.objectweb.asm.AnnotationVisitor#visitEnd()
*/
public void visitEnd() {
workbench.getIds().put("provides", m_prov);
workbench.getElements().put(m_prov, null);
}
- private class InterfaceArrayVisitor extends EmptyVisitor {
+ private class InterfaceArrayVisitor extends AnnotationVisitor {
/**
* List of parsed interface.
*/
private String m_itfs;
+
+ public InterfaceArrayVisitor() {
+ super(Opcodes.ASM5);
+ }
+
/**
* Visit one element of the array.
+ *
* @param arg0 : null
* @param arg1 : element value.
- * @see org.objectweb.asm.commons.EmptyVisitor#visit(java.lang.String, java.lang.Object)
+ * @see org.objectweb.asm.AnnotationVisitor#visit(java.lang.String, java.lang.Object)
*/
public void visit(String arg0, Object arg1) {
if (m_itfs == null) {
@@ -114,7 +125,8 @@ public class ProvidesVisitor extends Emp
/**
* End of the array visit.
* Add the attribute to 'provides' element.
- * @see org.objectweb.asm.commons.EmptyVisitor#visitEnd()
+ *
+ * @see org.objectweb.asm.AnnotationVisitor#visitEnd()
*/
public void visitEnd() {
m_prov.addAttribute(new Attribute("specifications", m_itfs + "}"));
Modified: felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/visitor/RequiresVisitor.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/visitor/RequiresVisitor.java?rev=1592340&r1=1592339&r2=1592340&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/visitor/RequiresVisitor.java (original)
+++ felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/visitor/RequiresVisitor.java Sun May 4 12:36:09 2014
@@ -23,15 +23,15 @@ import org.apache.felix.ipojo.manipulato
import org.apache.felix.ipojo.metadata.Attribute;
import org.apache.felix.ipojo.metadata.Element;
import org.objectweb.asm.AnnotationVisitor;
+import org.objectweb.asm.Opcodes;
import org.objectweb.asm.Type;
-import org.objectweb.asm.commons.EmptyVisitor;
/**
* AnnotationVisitor parsing the @Requires annotation.
* @see org.apache.felix.ipojo.annotations.Requires
* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
*/
-public class RequiresVisitor extends EmptyVisitor implements AnnotationVisitor {
+public class RequiresVisitor extends AnnotationVisitor {
private ComponentWorkbench workbench;
@@ -106,6 +106,7 @@ public class RequiresVisitor extends Emp
* @param name : field name.
*/
public RequiresVisitor(ComponentWorkbench workbench, String name) {
+ super(Opcodes.ASM5);
this.workbench = workbench;
this.m_field = name;
}
@@ -188,7 +189,7 @@ public class RequiresVisitor extends Emp
* @see org.objectweb.asm.AnnotationVisitor#visitEnd()
*/
public void visitEnd() {
- Element requires = null;
+ Element requires;
if (m_id == null) {
requires = workbench.getIds().get(m_field);
} else {
Modified: felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/visitor/ServiceControllerVisitor.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/visitor/ServiceControllerVisitor.java?rev=1592340&r1=1592339&r2=1592340&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/visitor/ServiceControllerVisitor.java (original)
+++ felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/visitor/ServiceControllerVisitor.java Sun May 4 12:36:09 2014
@@ -22,15 +22,15 @@ package org.apache.felix.ipojo.manipulat
import org.apache.felix.ipojo.metadata.Attribute;
import org.apache.felix.ipojo.metadata.Element;
import org.objectweb.asm.AnnotationVisitor;
+import org.objectweb.asm.Opcodes;
import org.objectweb.asm.Type;
-import org.objectweb.asm.commons.EmptyVisitor;
/**
* Parses a @ServiceController annotation.
* @see org.apache.felix.ipojo.annotations.ServiceController
* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
*/
-public class ServiceControllerVisitor extends EmptyVisitor implements AnnotationVisitor {
+public class ServiceControllerVisitor extends AnnotationVisitor {
/**
* Parent element.
@@ -48,6 +48,7 @@ public class ServiceControllerVisitor ex
* @param field : field name.
*/
public ServiceControllerVisitor(String field, Element provides) {
+ super(Opcodes.ASM5);
this.provides = provides;
controller.addAttribute(new Attribute("field", field));
}
Modified: felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/visitor/UpdatedVisitor.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/visitor/UpdatedVisitor.java?rev=1592340&r1=1592339&r2=1592340&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/visitor/UpdatedVisitor.java (original)
+++ felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/visitor/UpdatedVisitor.java Sun May 4 12:36:09 2014
@@ -24,18 +24,19 @@ import org.apache.felix.ipojo.manipulato
import org.apache.felix.ipojo.metadata.Attribute;
import org.apache.felix.ipojo.metadata.Element;
import org.objectweb.asm.AnnotationVisitor;
-import org.objectweb.asm.commons.EmptyVisitor;
+import org.objectweb.asm.Opcodes;
/**
- * @see org.apache.felix.ipojo.annotations.Updated
* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+ * @see org.apache.felix.ipojo.annotations.Updated
*/
-public class UpdatedVisitor extends EmptyVisitor implements AnnotationVisitor {
+public class UpdatedVisitor extends AnnotationVisitor {
private ComponentWorkbench workbench;
private String name;
public UpdatedVisitor(ComponentWorkbench workbench, String name) {
+ super(Opcodes.ASM5);
this.workbench = workbench;
this.name = name;
}
Modified: felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/visitor/bind/AbstractBindVisitor.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/visitor/bind/AbstractBindVisitor.java?rev=1592340&r1=1592339&r2=1592340&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/visitor/bind/AbstractBindVisitor.java (original)
+++ felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/visitor/bind/AbstractBindVisitor.java Sun May 4 12:36:09 2014
@@ -24,18 +24,19 @@ import org.apache.felix.ipojo.manipulato
import org.apache.felix.ipojo.metadata.Attribute;
import org.apache.felix.ipojo.metadata.Element;
import org.objectweb.asm.AnnotationVisitor;
+import org.objectweb.asm.Opcodes;
import org.objectweb.asm.Type;
-import org.objectweb.asm.commons.EmptyVisitor;
/**
* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
*/
-public abstract class AbstractBindVisitor extends EmptyVisitor implements AnnotationVisitor {
+public abstract class AbstractBindVisitor extends AnnotationVisitor {
protected ComponentWorkbench workbench;
protected Action action;
public AbstractBindVisitor(ComponentWorkbench workbench, Action action) {
+ super(Opcodes.ASM5);
this.workbench = workbench;
this.action = action;
}
@@ -81,9 +82,9 @@ public abstract class AbstractBindVisito
/**
* Visit annotation's attributes.
*
- * @param name : annotation name
+ * @param name : annotation name
* @param value : annotation value
- * @see org.objectweb.asm.commons.EmptyVisitor#visit(String, Object)
+ * @see org.objectweb.asm.AnnotationVisitor#visit(String, Object)
*/
public void visit(String name, Object value) {
if (name.equals("filter")) {
@@ -100,7 +101,7 @@ public abstract class AbstractBindVisito
}
if (name.equals("specification")) {
// Detect whether it's an internal class name.
- if (value.toString().startsWith("L") && value.toString().endsWith(";")) {
+ if (value.toString().startsWith("L") && value.toString().endsWith(";")) {
Type type = Type.getType(value.toString());
m_specification = type.getClassName();
} else {
@@ -134,7 +135,7 @@ public abstract class AbstractBindVisito
@Override
public void visitEnum(String name, String desc, String value) {
if (name.equals("policy")) {
- m_policy = RequiresVisitor.getPolicy(value.toString());
+ m_policy = RequiresVisitor.getPolicy(value);
}
}
@@ -157,32 +158,15 @@ public abstract class AbstractBindVisito
}
protected boolean completeExistingRequires(Element requires) {
-
- if (!completeAttribute(requires, "specification", m_specification))
- return false;
-
- if (!completeAttribute(requires, "optional", m_optional))
- return false;
-
- if (!completeAttribute(requires, "aggregate", m_aggregate))
- return false;
-
- if (!completeAttribute(requires, "filter", m_filter))
- return false;
-
- if (!completeAttribute(requires, "policy", m_policy))
- return false;
-
- if (!completeAttribute(requires, "comparator", m_comparator))
- return false;
-
- if (!completeAttribute(requires, "from", m_from))
- return false;
-
- if(!completeAttribute(requires, "proxy", m_proxy))
- return false;
-
- return true;
+ return
+ completeAttribute(requires, "specification", m_specification)
+ && completeAttribute(requires, "optional", m_optional)
+ && completeAttribute(requires, "aggregate", m_aggregate)
+ && completeAttribute(requires, "filter", m_filter)
+ && completeAttribute(requires, "policy", m_policy)
+ && completeAttribute(requires, "comparator", m_comparator)
+ && completeAttribute(requires, "from", m_from)
+ && completeAttribute(requires, "proxy", m_proxy);
}
private boolean completeAttribute(Element requires, String name, String value) {
Modified: felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/visitor/generic/GenericVisitor.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/visitor/generic/GenericVisitor.java?rev=1592340&r1=1592339&r2=1592340&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/visitor/generic/GenericVisitor.java (original)
+++ felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/visitor/generic/GenericVisitor.java Sun May 4 12:36:09 2014
@@ -23,27 +23,29 @@ import org.apache.felix.ipojo.manipulato
import org.apache.felix.ipojo.metadata.Attribute;
import org.apache.felix.ipojo.metadata.Element;
import org.objectweb.asm.AnnotationVisitor;
+import org.objectweb.asm.Opcodes;
import org.objectweb.asm.Type;
-import org.objectweb.asm.commons.EmptyVisitor;
import java.lang.reflect.Array;
/**
* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
*/
-public class GenericVisitor extends EmptyVisitor implements AnnotationVisitor {
+public class GenericVisitor extends AnnotationVisitor {
protected Element element;
public GenericVisitor(Element element) {
+ super(Opcodes.ASM5);
this.element = element;
}
/**
* Visit a 'simple' annotation attribute.
* This method is used for primitive arrays too.
- * @param name : attribute name
+ *
+ * @param name : attribute name
* @param value : attribute value
- * @see org.objectweb.asm.commons.EmptyVisitor#visit(String, Object)
+ * @see org.objectweb.asm.AnnotationVisitor#visit(String, Object)
*/
public void visit(String name, Object value) {
if (value.getClass().isArray()) {
@@ -74,10 +76,11 @@ public class GenericVisitor extends Empt
/**
* Visit a sub-annotation.
- * @param name : attribute name.
+ *
+ * @param name : attribute name.
* @param descriptor : annotation description
* @return an annotation visitor which will visit the given annotation
- * @see org.objectweb.asm.commons.EmptyVisitor#visitAnnotation(String, String)
+ * @see org.objectweb.asm.AnnotationVisitor#visitAnnotation(String, String)
*/
public AnnotationVisitor visitAnnotation(String name, String descriptor) {
// Sub annotations are mapped to sub-elements
@@ -88,9 +91,10 @@ public class GenericVisitor extends Empt
/**
* Visit an array attribute.
+ *
* @param name : attribute name
* @return a visitor which will visit each element of the array
- * @see org.objectweb.asm.commons.EmptyVisitor#visitArray(String)
+ * @see org.objectweb.asm.AnnotationVisitor#visitArray(String)
*/
public AnnotationVisitor visitArray(String name) {
return new SubArrayVisitor(element, name);
@@ -98,8 +102,9 @@ public class GenericVisitor extends Empt
/**
* Visits an enumeration attribute.
- * @param name the attribute name
- * @param desc the enumeration descriptor
+ *
+ * @param name the attribute name
+ * @param desc the enumeration descriptor
* @param value the attribute value
* @see org.objectweb.asm.AnnotationVisitor#visitEnum(String, String, String)
*/
Modified: felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/visitor/generic/GenericVisitorFactory.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/visitor/generic/GenericVisitorFactory.java?rev=1592340&r1=1592339&r2=1592340&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/visitor/generic/GenericVisitorFactory.java (original)
+++ felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/visitor/generic/GenericVisitorFactory.java Sun May 4 12:36:09 2014
@@ -23,15 +23,12 @@ import org.apache.felix.ipojo.manipulato
import org.apache.felix.ipojo.manipulator.spi.BindingContext;
import org.apache.felix.ipojo.metadata.Element;
import org.objectweb.asm.AnnotationVisitor;
-import org.objectweb.asm.tree.ClassNode;
-import org.objectweb.asm.tree.FieldNode;
-import org.objectweb.asm.tree.MethodNode;
/**
-* User: guillaume
-* Date: 11/07/13
-* Time: 14:41
-*/
+ * User: guillaume
+ * Date: 11/07/13
+ * Time: 14:41
+ */
public class GenericVisitorFactory implements AnnotationVisitorFactory {
private final String m_name;
private final String m_namespace;
@@ -43,25 +40,25 @@ public class GenericVisitorFactory imple
// Need to build a new Element instance for each created visitor
public AnnotationVisitor newAnnotationVisitor(BindingContext context) {
- if (context.getNode() instanceof ClassNode) {
+ if (context.getClassNode() != null) {
return new TypeGenericVisitor(context.getWorkbench(),
- new Element(m_name, m_namespace));
- } else if (context.getNode() instanceof FieldNode) {
+ new Element(m_name, m_namespace));
+ } else if (context.getFieldNode() != null) {
return new FieldGenericVisitor(context.getWorkbench(),
- new Element(m_name, m_namespace),
- (FieldNode) context.getNode());
+ new Element(m_name, m_namespace),
+ context.getFieldNode());
- } else if ((context.getNode() instanceof MethodNode) &&
+ } else if ((context.getMethodNode() != null) &&
(context.getParameterIndex() == BindingContext.NO_INDEX)) {
return new MethodGenericVisitor(context.getWorkbench(),
- new Element(m_name, m_namespace),
- (MethodNode) context.getNode());
+ new Element(m_name, m_namespace),
+ context.getMethodNode());
} else {
// last case: method parameter annotation
return new ParameterGenericVisitor(context.getWorkbench(),
- new Element(m_name, m_namespace),
- (MethodNode) context.getNode(),
- context.getParameterIndex());
+ new Element(m_name, m_namespace),
+ context.getMethodNode(),
+ context.getParameterIndex());
}
}
Modified: felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/visitor/generic/SubArrayVisitor.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/visitor/generic/SubArrayVisitor.java?rev=1592340&r1=1592339&r2=1592340&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/visitor/generic/SubArrayVisitor.java (original)
+++ felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/visitor/generic/SubArrayVisitor.java Sun May 4 12:36:09 2014
@@ -23,13 +23,13 @@ import org.apache.felix.ipojo.manipulato
import org.apache.felix.ipojo.metadata.Attribute;
import org.apache.felix.ipojo.metadata.Element;
import org.objectweb.asm.AnnotationVisitor;
+import org.objectweb.asm.Opcodes;
import org.objectweb.asm.Type;
-import org.objectweb.asm.commons.EmptyVisitor;
/**
* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
*/
-public class SubArrayVisitor extends EmptyVisitor implements AnnotationVisitor {
+public class SubArrayVisitor extends AnnotationVisitor {
/**
* Parent element.
@@ -49,19 +49,22 @@ public class SubArrayVisitor extends Emp
/**
* Constructor.
+ *
* @param elem : element element.
* @param name : attribute name.
*/
public SubArrayVisitor(Element elem, String name) {
+ super(Opcodes.ASM5);
m_elem = elem;
m_name = name;
}
/**
* Visit a 'simple' element of the visited array.
- * @param name : null
+ *
+ * @param name : null
* @param value : element value.
- * @see org.objectweb.asm.commons.EmptyVisitor#visit(String, Object)
+ * @see org.objectweb.asm.AnnotationVisitor#visit(String, Object)
*/
public void visit(String name, Object value) {
if (m_acc == null) {
@@ -83,8 +86,9 @@ public class SubArrayVisitor extends Emp
/**
* Visits an enumeration attribute.
- * @param name the attribute name
- * @param desc the enumeration descriptor
+ *
+ * @param name the attribute name
+ * @param desc the enumeration descriptor
* @param value the attribute value
*/
public void visitEnum(String name, String desc, String value) {
@@ -98,10 +102,11 @@ public class SubArrayVisitor extends Emp
/**
* Visit an annotation element of the visited array.
+ *
* @param name : null
* @param desc : annotation to visit
* @return the visitor which will visit the annotation
- * @see org.objectweb.asm.commons.EmptyVisitor#visitAnnotation(String, String)
+ * @see org.objectweb.asm.AnnotationVisitor#visitAnnotation(String, String)
*/
public AnnotationVisitor visitAnnotation(String name, String desc) {
// Sub annotations are map to sub-elements
@@ -112,7 +117,8 @@ public class SubArrayVisitor extends Emp
/**
* End of the visit.
- * @see org.objectweb.asm.commons.EmptyVisitor#visitEnd()
+ *
+ * @see org.objectweb.asm.AnnotationVisitor#visitEnd()
*/
public void visitEnd() {
if (m_acc != null) {
Modified: felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/visitor/stereotype/FieldStereotypeVisitor.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/visitor/stereotype/FieldStereotypeVisitor.java?rev=1592340&r1=1592339&r2=1592340&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/visitor/stereotype/FieldStereotypeVisitor.java (original)
+++ felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/visitor/stereotype/FieldStereotypeVisitor.java Sun May 4 12:36:09 2014
@@ -21,20 +21,20 @@ package org.apache.felix.ipojo.manipulat
import org.apache.felix.ipojo.manipulator.metadata.annotation.model.AnnotationType;
import org.apache.felix.ipojo.manipulator.metadata.annotation.model.Playback;
+import org.objectweb.asm.AnnotationVisitor;
import org.objectweb.asm.FieldVisitor;
-import org.objectweb.asm.commons.EmptyVisitor;
+import org.objectweb.asm.Opcodes;
/**
- * User: guillaume
- * Date: 30/05/13
- * Time: 18:55
+ * Parses stereotypes for field.
*/
-public class FieldStereotypeVisitor extends EmptyVisitor {
+public class FieldStereotypeVisitor extends AnnotationVisitor {
private final FieldVisitor m_delegate;
private final AnnotationType m_annotationType;
public FieldStereotypeVisitor(final FieldVisitor delegate, AnnotationType annotationType) {
+ super(Opcodes.ASM5);
this.m_delegate = delegate;
m_annotationType = annotationType;
}
Modified: felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/visitor/stereotype/MethodStereotypeVisitor.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/visitor/stereotype/MethodStereotypeVisitor.java?rev=1592340&r1=1592339&r2=1592340&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/visitor/stereotype/MethodStereotypeVisitor.java (original)
+++ felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/visitor/stereotype/MethodStereotypeVisitor.java Sun May 4 12:36:09 2014
@@ -21,20 +21,20 @@ package org.apache.felix.ipojo.manipulat
import org.apache.felix.ipojo.manipulator.metadata.annotation.model.AnnotationType;
import org.apache.felix.ipojo.manipulator.metadata.annotation.model.Playback;
+import org.objectweb.asm.AnnotationVisitor;
import org.objectweb.asm.MethodVisitor;
-import org.objectweb.asm.commons.EmptyVisitor;
+import org.objectweb.asm.Opcodes;
/**
- * User: guillaume
- * Date: 30/05/13
- * Time: 18:55
+ * Parse stereotypes for methods.
*/
-public class MethodStereotypeVisitor extends EmptyVisitor {
+public class MethodStereotypeVisitor extends AnnotationVisitor {
private final MethodVisitor m_delegate;
private final AnnotationType m_annotationType;
public MethodStereotypeVisitor(final MethodVisitor delegate, AnnotationType annotationType) {
+ super(Opcodes.ASM5);
this.m_delegate = delegate;
m_annotationType = annotationType;
}
Modified: felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/visitor/stereotype/ParameterStereotypeVisitor.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/visitor/stereotype/ParameterStereotypeVisitor.java?rev=1592340&r1=1592339&r2=1592340&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/visitor/stereotype/ParameterStereotypeVisitor.java (original)
+++ felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/visitor/stereotype/ParameterStereotypeVisitor.java Sun May 4 12:36:09 2014
@@ -21,21 +21,23 @@ package org.apache.felix.ipojo.manipulat
import org.apache.felix.ipojo.manipulator.metadata.annotation.model.AnnotationType;
import org.apache.felix.ipojo.manipulator.metadata.annotation.model.Playback;
+import org.objectweb.asm.AnnotationVisitor;
import org.objectweb.asm.MethodVisitor;
-import org.objectweb.asm.commons.EmptyVisitor;
+import org.objectweb.asm.Opcodes;
/**
* User: guillaume
* Date: 30/05/13
* Time: 18:55
*/
-public class ParameterStereotypeVisitor extends EmptyVisitor {
+public class ParameterStereotypeVisitor extends AnnotationVisitor {
private final MethodVisitor m_delegate;
private final int index;
private final AnnotationType m_annotationType;
public ParameterStereotypeVisitor(final MethodVisitor delegate, final int index, AnnotationType annotationType) {
+ super(Opcodes.ASM5);
this.m_delegate = delegate;
this.index = index;
m_annotationType = annotationType;
Modified: felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/visitor/stereotype/StereotypeVisitorFactory.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/visitor/stereotype/StereotypeVisitorFactory.java?rev=1592340&r1=1592339&r2=1592340&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/visitor/stereotype/StereotypeVisitorFactory.java (original)
+++ felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/visitor/stereotype/StereotypeVisitorFactory.java Sun May 4 12:36:09 2014
@@ -26,9 +26,6 @@ import org.objectweb.asm.AnnotationVisit
import org.objectweb.asm.ClassVisitor;
import org.objectweb.asm.FieldVisitor;
import org.objectweb.asm.MethodVisitor;
-import org.objectweb.asm.tree.ClassNode;
-import org.objectweb.asm.tree.FieldNode;
-import org.objectweb.asm.tree.MethodNode;
/**
* User: guillaume
@@ -43,14 +40,14 @@ public class StereotypeVisitorFactory im
}
public AnnotationVisitor newAnnotationVisitor(BindingContext context) {
- if (context.getNode() instanceof ClassNode) {
+ if (context.getClassNode() != null) {
return new TypeStereotypeVisitor((ClassVisitor) context.getVisitor(),
m_annotationType);
- } else if (context.getNode() instanceof FieldNode) {
+ } else if (context.getFieldNode() != null) {
return new FieldStereotypeVisitor((FieldVisitor) context.getVisitor(),
m_annotationType);
- } else if ((context.getNode() instanceof MethodNode) &&
+ } else if ((context.getMethodNode() != null) &&
(context.getParameterIndex() == BindingContext.NO_INDEX)) {
return new MethodStereotypeVisitor((MethodVisitor) context.getVisitor(),
m_annotationType);
Modified: felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/visitor/stereotype/TypeStereotypeVisitor.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/visitor/stereotype/TypeStereotypeVisitor.java?rev=1592340&r1=1592339&r2=1592340&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/visitor/stereotype/TypeStereotypeVisitor.java (original)
+++ felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/metadata/annotation/visitor/stereotype/TypeStereotypeVisitor.java Sun May 4 12:36:09 2014
@@ -21,20 +21,22 @@ package org.apache.felix.ipojo.manipulat
import org.apache.felix.ipojo.manipulator.metadata.annotation.model.AnnotationType;
import org.apache.felix.ipojo.manipulator.metadata.annotation.model.Playback;
+import org.objectweb.asm.AnnotationVisitor;
import org.objectweb.asm.ClassVisitor;
-import org.objectweb.asm.commons.EmptyVisitor;
+import org.objectweb.asm.Opcodes;
/**
* User: guillaume
* Date: 30/05/13
* Time: 18:55
*/
-public class TypeStereotypeVisitor extends EmptyVisitor {
+public class TypeStereotypeVisitor extends AnnotationVisitor {
private final ClassVisitor m_delegate;
private final AnnotationType m_annotationType;
public TypeStereotypeVisitor(final ClassVisitor delegate, AnnotationType annotationType) {
+ super(Opcodes.ASM5);
this.m_delegate = delegate;
m_annotationType = annotationType;
}
Modified: felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/spi/BindingContext.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/spi/BindingContext.java?rev=1592340&r1=1592339&r2=1592340&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/spi/BindingContext.java (original)
+++ felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/spi/BindingContext.java Sun May 4 12:36:09 2014
@@ -22,7 +22,9 @@ package org.apache.felix.ipojo.manipulat
import org.apache.felix.ipojo.manipulator.Reporter;
import org.apache.felix.ipojo.manipulator.metadata.annotation.ComponentWorkbench;
import org.objectweb.asm.Type;
-import org.objectweb.asm.tree.MemberNode;
+import org.objectweb.asm.tree.ClassNode;
+import org.objectweb.asm.tree.FieldNode;
+import org.objectweb.asm.tree.MethodNode;
import java.lang.annotation.ElementType;
@@ -37,24 +39,58 @@ public class BindingContext {
*
*/
private ComponentWorkbench workbench;
- private MemberNode node;
+ private FieldNode field;
+ private MethodNode method;
+ private ClassNode clazz;
private ElementType elementType;
private int parameterIndex;
private Reporter reporter;
private Type annotationType;
private Object visitor;
+
+ public BindingContext(final ComponentWorkbench workbench,
+ final Reporter reporter,
+ final Type annotationType,
+ final FieldNode node,
+ final ElementType elementType,
+ final int parameterIndex,
+ final Object visitor) {
+ this(workbench, reporter, annotationType, elementType, parameterIndex, visitor);
+ this.field = node;
+ }
+
public BindingContext(final ComponentWorkbench workbench,
final Reporter reporter,
final Type annotationType,
- final MemberNode node,
+ final MethodNode node,
final ElementType elementType,
final int parameterIndex,
final Object visitor) {
+ this(workbench, reporter, annotationType, elementType, parameterIndex, visitor);
+ this.method = node;
+ }
+
+ public BindingContext(final ComponentWorkbench workbench,
+ final Reporter reporter,
+ final Type annotationType,
+ final ClassNode node,
+ final ElementType elementType,
+ final int parameterIndex,
+ final Object visitor) {
+ this(workbench, reporter, annotationType, elementType, parameterIndex, visitor);
+ this.clazz = node;
+ }
+
+ private BindingContext(final ComponentWorkbench workbench,
+ final Reporter reporter,
+ final Type annotationType,
+ final ElementType elementType,
+ final int parameterIndex,
+ final Object visitor) {
this.workbench = workbench;
this.reporter = reporter;
this.annotationType = annotationType;
- this.node = node;
this.elementType = elementType;
this.parameterIndex = parameterIndex;
this.visitor = visitor;
@@ -64,8 +100,16 @@ public class BindingContext {
return workbench;
}
- public MemberNode getNode() {
- return node;
+ public FieldNode getFieldNode() {
+ return field;
+ }
+
+ public MethodNode getMethodNode() {
+ return method;
+ }
+
+ public ClassNode getClassNode() {
+ return clazz;
}
public ElementType getElementType() {
Modified: felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/spi/helper/Predicates.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/spi/helper/Predicates.java?rev=1592340&r1=1592339&r2=1592340&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/spi/helper/Predicates.java (original)
+++ felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/spi/helper/Predicates.java Sun May 4 12:36:09 2014
@@ -198,18 +198,18 @@ public class Predicates {
public Predicate named(final String expected) {
return new Predicate() {
public boolean matches(BindingContext context) {
- if (context.getNode() instanceof FieldNode) {
- FieldNode field = (FieldNode) context.getNode();
+ if (context.getFieldNode() != null) {
+ FieldNode field = context.getFieldNode();
return field.name.equals(expected);
}
- if (context.getNode() instanceof MethodNode) {
- MethodNode method = (MethodNode) context.getNode();
+ if (context.getMethodNode() != null) {
+ MethodNode method = context.getMethodNode();
return method.name.equals(expected);
}
- if (context.getNode() instanceof ClassNode) {
- ClassNode clazz = (ClassNode) context.getNode();
+ if (context.getClassNode() != null) {
+ ClassNode clazz = context.getClassNode();
return clazz.name.equals(expected);
}
Modified: felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/util/ChainedAnnotationVisitor.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/util/ChainedAnnotationVisitor.java?rev=1592340&r1=1592339&r2=1592340&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/util/ChainedAnnotationVisitor.java (original)
+++ felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/util/ChainedAnnotationVisitor.java Sun May 4 12:36:09 2014
@@ -19,21 +19,25 @@
package org.apache.felix.ipojo.manipulator.util;
+import org.objectweb.asm.AnnotationVisitor;
+import org.objectweb.asm.Opcodes;
+
import java.util.ArrayList;
import java.util.List;
-import org.apache.felix.ipojo.manipulator.metadata.annotation.model.discovery.ChainedAnnotationDiscovery;
-import org.objectweb.asm.AnnotationVisitor;
-
/**
* User: guillaume
* Date: 10/07/13
* Time: 16:43
*/
-public class ChainedAnnotationVisitor implements AnnotationVisitor {
+public class ChainedAnnotationVisitor extends AnnotationVisitor {
private List<AnnotationVisitor> m_visitors = new ArrayList<AnnotationVisitor>();
+ public ChainedAnnotationVisitor() {
+ super(Opcodes.ASM5);
+ }
+
public List<AnnotationVisitor> getVisitors() {
return m_visitors;
}
Modified: felix/trunk/ipojo/manipulator/manipulator/src/test/java/org/apache/felix/ipojo/manipulation/ClassCheckerTestCase.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator/src/test/java/org/apache/felix/ipojo/manipulation/ClassCheckerTestCase.java?rev=1592340&r1=1592339&r2=1592340&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/manipulator/src/test/java/org/apache/felix/ipojo/manipulation/ClassCheckerTestCase.java (original)
+++ felix/trunk/ipojo/manipulator/manipulator/src/test/java/org/apache/felix/ipojo/manipulation/ClassCheckerTestCase.java Sun May 4 12:36:09 2014
@@ -19,20 +19,17 @@
package org.apache.felix.ipojo.manipulation;
+import junit.framework.TestCase;
+import org.apache.felix.ipojo.manipulator.util.Streams;
+import org.objectweb.asm.*;
+import org.osgi.framework.BundleContext;
+
import java.io.ByteArrayInputStream;
import java.io.File;
import java.util.Collection;
import java.util.List;
import java.util.Map;
-import junit.framework.TestCase;
-import org.apache.felix.ipojo.manipulator.util.Streams;
-import org.objectweb.asm.ClassReader;
-import org.objectweb.asm.MethodVisitor;
-import org.objectweb.asm.Type;
-import org.objectweb.asm.commons.EmptyVisitor;
-import org.osgi.framework.BundleContext;
-
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
@@ -94,7 +91,7 @@ public class ClassCheckerTestCase extend
assertEquals(1, annotations.size());
ClassChecker.AnnotationDescriptor annotationDescriptor = annotations.get(0);
MethodVisitor mv = mock(MethodVisitor.class);
- when(mv.visitAnnotation(desc, true)).thenReturn(new EmptyVisitor());
+ when(mv.visitAnnotation(desc, true)).thenReturn(new AnnotationVisitor(Opcodes.ASM5) {});
annotationDescriptor.visitAnnotation(mv);
}
Modified: felix/trunk/ipojo/manipulator/manipulator/src/test/java/org/apache/felix/ipojo/manipulation/InnerClassAdapterTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator/src/test/java/org/apache/felix/ipojo/manipulation/InnerClassAdapterTest.java?rev=1592340&r1=1592339&r2=1592340&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/manipulator/src/test/java/org/apache/felix/ipojo/manipulation/InnerClassAdapterTest.java (original)
+++ felix/trunk/ipojo/manipulator/manipulator/src/test/java/org/apache/felix/ipojo/manipulation/InnerClassAdapterTest.java Sun May 4 12:36:09 2014
@@ -224,12 +224,12 @@ public class InnerClassAdapterTest {
boolean found = false;
Constructor cst = null;
Constructor[] csts = cl.getDeclaredConstructors();
- for (int i = 0; i < csts.length; i++) {
- System.out.println(Arrays.asList(csts[i].getParameterTypes()));
- if (csts[i].getParameterTypes().length == 1 &&
- csts[i].getParameterTypes()[0].equals(InstanceManager.class)) {
+ for (Constructor cst2 : csts) {
+ System.out.println(Arrays.asList(cst2.getParameterTypes()));
+ if (cst2.getParameterTypes().length == 1 &&
+ cst2.getParameterTypes()[0].equals(InstanceManager.class)) {
found = true;
- cst = csts[i];
+ cst = cst2;
}
}
Assert.assertTrue(found);
Modified: felix/trunk/ipojo/manipulator/manipulator/src/test/java/org/apache/felix/ipojo/manipulator/metadata/annotation/registry/LegacyGenericBindingRegistryTestCase.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator/src/test/java/org/apache/felix/ipojo/manipulator/metadata/annotation/registry/LegacyGenericBindingRegistryTestCase.java?rev=1592340&r1=1592339&r2=1592340&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/manipulator/src/test/java/org/apache/felix/ipojo/manipulator/metadata/annotation/registry/LegacyGenericBindingRegistryTestCase.java (original)
+++ felix/trunk/ipojo/manipulator/manipulator/src/test/java/org/apache/felix/ipojo/manipulator/metadata/annotation/registry/LegacyGenericBindingRegistryTestCase.java Sun May 4 12:36:09 2014
@@ -40,9 +40,9 @@ import junit.framework.TestCase;
*/
public class LegacyGenericBindingRegistryTestCase extends TestCase {
- public static final String AN_IGNORED_ANNOTATION = "[an.ignored.Annotation;";
- public static final String RECOGNISED_IPOJO_ANNOTATION = "[a.recognised.ipojo.Annotation;";
- public static final String RECOGNISED_HANDLER_ANNOTATION = "[a.recognised.handler.Annotation;";
+ public static final String AN_IGNORED_ANNOTATION = "[Lan.ignored.Annotation;";
+ public static final String RECOGNISED_IPOJO_ANNOTATION = "[La.recognised.ipojo.Annotation;";
+ public static final String RECOGNISED_HANDLER_ANNOTATION = "[La.recognised.handler.Annotation;";
@Mock
private BindingRegistry delegate;
Modified: felix/trunk/ipojo/manipulator/manipulator/src/test/java/org/apache/felix/ipojo/manipulator/metadata/annotation/registry/MetaAnnotationBindingRegistryTestCase.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator/src/test/java/org/apache/felix/ipojo/manipulator/metadata/annotation/registry/MetaAnnotationBindingRegistryTestCase.java?rev=1592340&r1=1592339&r2=1592340&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/manipulator/src/test/java/org/apache/felix/ipojo/manipulator/metadata/annotation/registry/MetaAnnotationBindingRegistryTestCase.java (original)
+++ felix/trunk/ipojo/manipulator/manipulator/src/test/java/org/apache/felix/ipojo/manipulator/metadata/annotation/registry/MetaAnnotationBindingRegistryTestCase.java Sun May 4 12:36:09 2014
@@ -54,7 +54,7 @@ import junit.framework.TestCase;
*/
public class MetaAnnotationBindingRegistryTestCase extends TestCase {
- public static final String DESCRIPTOR = "[unknown;";
+ public static final String DESCRIPTOR = "[Lunknown;";
public static final Type TYPE = Type.getType(DESCRIPTOR);
@Mock
Modified: felix/trunk/ipojo/manipulator/online-manipulator/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/online-manipulator/pom.xml?rev=1592340&r1=1592339&r2=1592340&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/online-manipulator/pom.xml (original)
+++ felix/trunk/ipojo/manipulator/online-manipulator/pom.xml Sun May 4 12:36:09 2014
@@ -16,173 +16,174 @@
specific language governing permissions and limitations
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/maven-v4_0_0.xsd">
- <parent>
- <groupId>org.apache.felix</groupId>
- <artifactId>felix-parent</artifactId>
- <version>2.1</version>
- <relativePath>../../../pom/pom.xml</relativePath>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <packaging>bundle</packaging>
- <name>Apache Felix iPOJO - Online Manipulator</name>
- <artifactId>org.apache.felix.ipojo.manipulator.online</artifactId>
- <version>1.11.3-SNAPSHOT</version>
-
- <description>
- iPOJO online manipulator allowing install time manipulation of iPOJO bundle.
- </description>
- <url>
- http://felix.apache.org/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-tools/apache-felix-ipojo-online-manipulator.html
- </url>
+<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/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>felix-parent</artifactId>
+ <version>2.1</version>
+ <relativePath>../../../pom/pom.xml</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <packaging>bundle</packaging>
+ <name>Apache Felix iPOJO - Online Manipulator</name>
+ <artifactId>org.apache.felix.ipojo.manipulator.online</artifactId>
+ <version>1.11.3-SNAPSHOT</version>
- <properties>
- <ipojo.import.packages>[1.11.0,2.0.0)</ipojo.import.packages>
- <ipojo.manipulator.version>${project.version}</ipojo.manipulator.version>
- </properties>
+ <description>
+ iPOJO online manipulator allowing install time manipulation of iPOJO bundle.
+ </description>
+ <url>
+ http://felix.apache.org/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-tools/apache-felix-ipojo-online-manipulator.html
+ </url>
- <dependencies>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
- <version>4.3.1</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.compendium</artifactId>
- <version>4.0.0</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.ipojo.metadata</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.ipojo.manipulator</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.ipojo.annotations</artifactId>
- </dependency>
- <dependency>
- <groupId>asm</groupId>
- <artifactId>asm-all</artifactId>
- </dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-all</artifactId>
- <version>1.9.5</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
+ <properties>
+ <ipojo.import.packages>[1.11.0,2.0.0)</ipojo.import.packages>
+ <ipojo.manipulator.version>${project.version}</ipojo.manipulator.version>
+ </properties>
- <dependencyManagement>
<dependencies>
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>ipojo-manipulator-bom</artifactId>
- <version>${project.version}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.core</artifactId>
+ <version>4.3.1</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.compendium</artifactId>
+ <version>4.0.0</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.ipojo.metadata</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.ipojo.manipulator</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.ipojo.annotations</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.ow2.asm</groupId>
+ <artifactId>asm-all</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-all</artifactId>
+ <version>1.9.5</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
- </dependencyManagement>
- <build>
- <resources>
- <resource>
- <directory>src/main/resources</directory>
- <filtering>true</filtering>
- </resource>
- </resources>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>3.0</version>
- <configuration>
- <target>1.5</target>
- <source>1.5</source>
- <testTarget>1.5</testTarget>
- <testSource>1.5</testSource>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <version>2.3.7</version>
- <extensions>true</extensions>
- <configuration>
- <instructions>
- <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
- <Private-Package>org.apache.felix.ipojo.online.manipulator</Private-Package>
- <Bundle-DocURL>
- http://felix.apache.org/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-tools/apache-felix-ipojo-online-manipulator.html
- </Bundle-DocURL>
- <Export-Package>
- org.apache.felix.ipojo.manipulation*; version="${ipojo.manipulator.version}",
- org.apache.felix.ipojo.xml.parser; version="${ipojo.manipulator.version}",
- org.apache.felix.ipojo.manipulator*; version="${ipojo.manipulator.version}",
- org.apache.felix.ipojo.annotations*; version="${ipojo.manipulator.version}",
- </Export-Package>
- <Private-Package>
- org.objectweb.asm,
- org.objectweb.asm.commons,
- org.objectweb.asm.signature,
- org.objectweb.asm.tree,
- org.apache.felix.ipojo.online.manipulator
- </Private-Package>
- <Import-Package>!sun.io, org.osgi.framework;version=1.3, *
- </Import-Package>
- </instructions>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-ipojo-plugin</artifactId>
- <version>${project.version}</version>
- <executions>
- <execution>
- <goals>
- <goal>ipojo-bundle</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-checkstyle-plugin</artifactId>
- <version>2.10</version>
- <configuration>
- <enableRulesSummary>false</enableRulesSummary>
- <violationSeverity>warning</violationSeverity>
- <configLocation>http://felix.apache.org/ipojo/dev/checkstyle_ipojo.xml</configLocation>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.rat</groupId>
- <artifactId>apache-rat-plugin</artifactId>
- <executions>
- <execution>
- <phase>verify</phase>
- <goals>
- <goal>check</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <!-- check src only (except remote resources additions) -->
- <includes>
- <include>src/**</include>
- </includes>
- <excludes>
- <exclude>src/main/appended-resources/**</exclude>
- <exclude>src/main/resources/META-INF/**</exclude>
- </excludes>
- </configuration>
- </plugin>
- </plugins>
- </build>
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>ipojo-manipulator-bom</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <build>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.0</version>
+ <configuration>
+ <target>1.5</target>
+ <source>1.5</source>
+ <testTarget>1.5</testTarget>
+ <testSource>1.5</testSource>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <version>2.3.7</version>
+ <extensions>true</extensions>
+ <configuration>
+ <instructions>
+ <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
+ <Private-Package>org.apache.felix.ipojo.online.manipulator</Private-Package>
+ <Bundle-DocURL>
+ http://felix.apache.org/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-tools/apache-felix-ipojo-online-manipulator.html
+ </Bundle-DocURL>
+ <Export-Package>
+ org.apache.felix.ipojo.manipulation*; version="${ipojo.manipulator.version}",
+ org.apache.felix.ipojo.xml.parser; version="${ipojo.manipulator.version}",
+ org.apache.felix.ipojo.manipulator*; version="${ipojo.manipulator.version}",
+ org.apache.felix.ipojo.annotations*; version="${ipojo.manipulator.version}",
+ </Export-Package>
+ <Private-Package>
+ org.objectweb.asm,
+ org.objectweb.asm.commons,
+ org.objectweb.asm.signature,
+ org.objectweb.asm.tree,
+ org.apache.felix.ipojo.online.manipulator
+ </Private-Package>
+ <Import-Package>!sun.io, org.osgi.framework;version=1.3, *
+ </Import-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-ipojo-plugin</artifactId>
+ <version>${project.version}</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>ipojo-bundle</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <version>2.10</version>
+ <configuration>
+ <enableRulesSummary>false</enableRulesSummary>
+ <violationSeverity>warning</violationSeverity>
+ <configLocation>http://felix.apache.org/ipojo/dev/checkstyle_ipojo.xml</configLocation>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.rat</groupId>
+ <artifactId>apache-rat-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>verify</phase>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <!-- check src only (except remote resources additions) -->
+ <includes>
+ <include>src/**</include>
+ </includes>
+ <excludes>
+ <exclude>src/main/appended-resources/**</exclude>
+ <exclude>src/main/resources/META-INF/**</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project>
Modified: felix/trunk/ipojo/runtime/api/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/api/pom.xml?rev=1592340&r1=1592339&r2=1592340&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/api/pom.xml (original)
+++ felix/trunk/ipojo/runtime/api/pom.xml Sun May 4 12:36:09 2014
@@ -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,
Modified: felix/trunk/ipojo/runtime/core-it/ipojo-core-declaration-test/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/ipojo-core-declaration-test/pom.xml?rev=1592340&r1=1592339&r2=1592340&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/ipojo-core-declaration-test/pom.xml (original)
+++ felix/trunk/ipojo/runtime/core-it/ipojo-core-declaration-test/pom.xml Sun May 4 12:36:09 2014
@@ -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>
-
- <modelVersion>4.0.0</modelVersion>
-
- <artifactId>ipojo-core-declaration-test</artifactId>
-
- <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>
+ <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>
+
+ <artifactId>ipojo-core-declaration-test</artifactId>
+
+ <name>${project.artifactId}</name>
+
+ <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
Modified: felix/trunk/ipojo/runtime/core-it/ipojo-core-declaration-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/declaration/TestDeclarationBuilderService.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/ipojo-core-declaration-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/declaration/TestDeclarationBuilderService.java?rev=1592340&r1=1592339&r2=1592340&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/ipojo-core-declaration-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/declaration/TestDeclarationBuilderService.java (original)
+++ felix/trunk/ipojo/runtime/core-it/ipojo-core-declaration-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/declaration/TestDeclarationBuilderService.java Sun May 4 12:36:09 2014
@@ -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.junit.Test;
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 @@ public class TestDeclarationBuilderServi
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();
Modified: felix/trunk/ipojo/runtime/core-it/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/pom.xml?rev=1592340&r1=1592339&r2=1592340&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/pom.xml (original)
+++ felix/trunk/ipojo/runtime/core-it/pom.xml Sun May 4 12:36:09 2014
@@ -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>
Modified: felix/trunk/ipojo/runtime/core/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core/pom.xml?rev=1592340&r1=1592339&r2=1592340&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/core/pom.xml (original)
+++ felix/trunk/ipojo/runtime/core/pom.xml Sun May 4 12:36:09 2014
@@ -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>
Modified: felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/extender/internal/processor/ConfigurationAnnotationScanner.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/extender/internal/processor/ConfigurationAnnotationScanner.java?rev=1592340&r1=1592339&r2=1592340&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/extender/internal/processor/ConfigurationAnnotationScanner.java (original)
+++ felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/extender/internal/processor/ConfigurationAnnotationScanner.java Sun May 4 12:36:09 2014
@@ -21,9 +21,9 @@ package org.apache.felix.ipojo.extender.
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 @@ import org.objectweb.asm.commons.EmptyVi
* {@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 class ConfigurationAnnotationScan
}
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("/", ".");