felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r572587 - /felix/trunk/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/qdox/QDoxJavaClassDescription.java
Date Tue, 04 Sep 2007 09:07:38 GMT
Author: cziegeler
Date: Tue Sep  4 02:07:37 2007
New Revision: 572587

URL: http://svn.apache.org/viewvc?rev=572587&view=rev
Log:
Correct byte code generation: calculate max frames and locals by hand (they're constant anyway)
to avoid altering the existing byte code; fix putfield operation.

Modified:
    felix/trunk/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/qdox/QDoxJavaClassDescription.java

Modified: felix/trunk/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/qdox/QDoxJavaClassDescription.java
URL: http://svn.apache.org/viewvc/felix/trunk/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/qdox/QDoxJavaClassDescription.java?rev=572587&r1=572586&r2=572587&view=diff
==============================================================================
--- felix/trunk/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/qdox/QDoxJavaClassDescription.java
(original)
+++ felix/trunk/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/qdox/QDoxJavaClassDescription.java
Tue Sep  4 02:07:37 2007
@@ -247,7 +247,7 @@
             final ClassReader reader = new ClassReader(new FileInputStream(fileName));
             reader.accept(cn, 0);
 
-            final ClassWriter writer = new ClassWriter(ClassWriter.COMPUTE_FRAMES);
+            final ClassWriter writer = new ClassWriter(0);
             cn.accept(writer);
             if ( createBind ) {
                 this.createMethod(writer, propertyName, className, true);
@@ -274,9 +274,9 @@
         } else {
             mv.visitInsn(Opcodes.ACONST_NULL);
         }
-        mv.visitFieldInsn(Opcodes.PUTFIELD, this.getName(), propertyName, type.toString());
+        mv.visitFieldInsn(Opcodes.PUTFIELD, this.getName().replace('.', '/'), propertyName,
type.toString());
         mv.visitInsn(Opcodes.RETURN);
-        mv.visitMaxs(0, 0);
+        mv.visitMaxs(2, 2);
         // add to qdox
         final JavaParameter param = new JavaParameter(new Type(typeName), "param");
         final JavaParameter[] params = new JavaParameter[] {param};



Mime
View raw message