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.
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@604790 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/ConstructorCodeAdapter.java b/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/ConstructorCodeAdapter.java
index 1a25c4e..e552072 100644
--- a/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/ConstructorCodeAdapter.java
+++ b/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/ConstructorCodeAdapter.java
@@ -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) {
diff --git a/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/MethodCodeAdapter.java b/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/MethodCodeAdapter.java
index 03b8256..d8be885 100644
--- a/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/MethodCodeAdapter.java
+++ b/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulation/MethodCodeAdapter.java
@@ -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";