From 387bb5897bf5831adce68fba21439b5316ea4e19 Mon Sep 17 00:00:00 2001 From: chibash Date: Tue, 23 Jul 2013 21:33:46 +0900 Subject: fixed JASSIST-158 --- src/main/javassist/compiler/MemberCodeGen.java | 2 +- src/test/javassist/JvstTest4.java | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'src') 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")); + } } -- cgit v1.2.3