Fixed FELIX-3359
downgrade the class version on 1.7.
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1291639 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/MethodCreator.java b/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/MethodCreator.java
index 60cff80..4bfb240 100644
--- a/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/MethodCreator.java
+++ b/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/MethodCreator.java
@@ -547,8 +547,16 @@
} else {
itfs = interfaces;
}
+
+ // If version = 1.7, use 1.6 if the ipojo.downgrade.classes system property is either
+ // not set of set to true.
+ int theVersion = version;
+ String downgrade = System.getProperty("ipojo.downgrade.classes");
+ if ((downgrade == null || "true".equals(downgrade)) && version == Opcodes.V1_7) {
+ theVersion = Opcodes.V1_6;
+ }
- cv.visit(version, access, name, signature, superName, itfs);
+ cv.visit(theVersion, access, name, signature, superName, itfs);
}
/**