aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorchibash <chiba@javassist.org>2013-07-23 21:33:46 +0900
committerchibash <chiba@javassist.org>2013-07-23 21:33:46 +0900
commit387bb5897bf5831adce68fba21439b5316ea4e19 (patch)
treef02dce93395c90512f062ed47eb6957c0dfac05c /src
parent28d3edb1bc50636bb1137d1a862f95bf02c4ffa0 (diff)
downloadjavassist-387bb5897bf5831adce68fba21439b5316ea4e19.tar.gz
javassist-387bb5897bf5831adce68fba21439b5316ea4e19.zip
fixed JASSIST-158
Diffstat (limited to 'src')
-rw-r--r--src/main/javassist/compiler/MemberCodeGen.java2
-rw-r--r--src/test/javassist/JvstTest4.java8
2 files changed, 9 insertions, 1 deletions
diff --git a/src/main/javassist/compiler/MemberCodeGen.java b/src/main/javassist/compiler/MemberCodeGen.java
index 3ea68eb1..167e4ccc 100644
--- a/src/main/javassist/compiler/MemberCodeGen.java
+++ b/src/main/javassist/compiler/MemberCodeGen.java
@@ -957,7 +957,7 @@ public class MemberCodeGen extends CodeGen {
else
className = null;
- boolean is2byte = (c == 'J' || c == 'D');
+ boolean is2byte = dim == 0 && (c == 'J' || c == 'D');
return is2byte;
}
diff --git a/src/test/javassist/JvstTest4.java b/src/test/javassist/JvstTest4.java
index 8bcbf01c..b3b04c29 100644
--- a/src/test/javassist/JvstTest4.java
+++ b/src/test/javassist/JvstTest4.java
@@ -895,4 +895,12 @@ public class JvstTest4 extends JvstTestRoot {
cc.addMethod(CtNewMethod.make(
"public int getf(test4.JIRA188 p){ return p.g; }", cc));
}
+
+ public void testJIRA158() throws Exception {
+ CtClass cc = sloader.get("test4.JIRA158");
+ cc.addMethod(CtMethod.make("public int run() { return obj.foo(jj, dd) + obj.bar(j, d); }", cc));
+ cc.writeFile();
+ Object obj = make(cc.getName());
+ assertEquals(15, invoke(obj, "run"));
+ }
}