felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clem...@apache.org
Subject svn commit: r604790 - in /felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation: ConstructorCodeAdapter.java MethodCodeAdapter.java
Date Mon, 17 Dec 2007 08:44:46 GMT
Author: clement
Date: Mon Dec 17 00:44:40 2007
New Revision: 604790

URL: http://svn.apache.org/viewvc?rev=604790&view=rev
Log:
Fix a bug on field delegation. 
The getter methods were invoked with the bad opcode (INVOKE_VIRTUAL instead of INVOKE_SPECIAL).
The setter methods were called correctly. The bug appears only on the JamVM which is more
strict than the Sun JVMs.

Modified:
    felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/ConstructorCodeAdapter.java
    felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/MethodCodeAdapter.java

Modified: felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/ConstructorCodeAdapter.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/ConstructorCodeAdapter.java?rev=604790&r1=604789&r2=604790&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/ConstructorCodeAdapter.java
(original)
+++ felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/ConstructorCodeAdapter.java
Mon Dec 17 00:44:40 2007
@@ -89,7 +89,7 @@
         if (m_fields.contains(name) && m_owner.equals(owner)) {
             if (opcode == GETFIELD) {
                 String gDesc = "()" + desc;
-                visitMethodInsn(INVOKEVIRTUAL, owner, "_get" + name, gDesc);
+                visitMethodInsn(INVOKESPECIAL, owner, "_get" + name, gDesc);
                 return;
             } else
                 if (opcode == PUTFIELD) {

Modified: felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/MethodCodeAdapter.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/MethodCodeAdapter.java?rev=604790&r1=604789&r2=604790&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/MethodCodeAdapter.java
(original)
+++ felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/MethodCodeAdapter.java
Mon Dec 17 00:44:40 2007
@@ -76,7 +76,7 @@
         if (owner.equals(m_owner) && m_fields.contains(name)) {
             if (opcode == GETFIELD) {
                 String gDesc = "()" + desc;
-                visitMethodInsn(INVOKEVIRTUAL, owner, "_get" + name, gDesc);
+                visitMethodInsn(INVOKESPECIAL, owner, "_get" + name, gDesc);
                 return;
             } else if (opcode == PUTFIELD) {
                 String sDesc = "(" + desc + ")V";



Mime
View raw message