felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clem...@apache.org
Subject svn commit: r1529113 - in /felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulation: InnerClassAdapter.java Manipulator.java
Date Fri, 04 Oct 2013 09:51:03 GMT
Author: clement
Date: Fri Oct  4 09:51:03 2013
New Revision: 1529113

URL: http://svn.apache.org/r1529113
Log:
Fix frame generation error in the inner class manipulation. This commit is related to FELIX-4255
Extend the inner class manipulation to allow method interception,

Modified:
    felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/InnerClassAdapter.java
    felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/Manipulator.java

Modified: felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/InnerClassAdapter.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/InnerClassAdapter.java?rev=1529113&r1=1529112&r2=1529113&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/InnerClassAdapter.java
(original)
+++ felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/InnerClassAdapter.java
Fri Oct  4 09:51:03 2013
@@ -81,6 +81,17 @@ public class InnerClassAdapter extends C
         m_fields = manipulator.getFields().keySet();
     }
 
+    @Override
+    public void visit(int version, int access, String name, String signature, String superName,
String[] 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;
+        }
+        super.visit(theVersion, access, name, signature, superName, interfaces);
+    }
 
     /**
      * Visits a method.

Modified: felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/Manipulator.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/Manipulator.java?rev=1529113&r1=1529112&r2=1529113&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/Manipulator.java
(original)
+++ felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/Manipulator.java
Fri Oct  4 09:51:03 2013
@@ -115,7 +115,6 @@ public class Manipulator {
      * @throws IOException : if an error occurs during the manipulation.
      */
     public byte[] manipulate(byte[] origin) throws IOException {
-        ClassWriter finalWriter = null;
         if (!m_alreadyManipulated) {
             InputStream is2 = new ByteArrayInputStream(origin);
             ClassReader cr0 = new ClassReader(is2);



Mime
View raw message