From: chiba Date: Wed, 19 Oct 2011 04:54:56 +0000 (+0000) Subject: fixed JASSIST-145 X-Git-Tag: rel_3_17_1_ga~66 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=aad7d4277c161ddcf502b9e4bd48861450a3458d;p=javassist.git fixed JASSIST-145 git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@593 30ef5769-5b8d-40dd-aea6-55b5d6557bb3 --- diff --git a/src/main/javassist/bytecode/stackmap/TypeData.java b/src/main/javassist/bytecode/stackmap/TypeData.java index c7721b0c..65ab226e 100644 --- a/src/main/javassist/bytecode/stackmap/TypeData.java +++ b/src/main/javassist/bytecode/stackmap/TypeData.java @@ -400,6 +400,10 @@ public abstract class TypeData { return new ArrayElement(array); } + public boolean isNullType() { + return array.isNullType(); + } + protected void setType(String typeName, ClassPool cp) throws BadBytecode { super.setType(typeName, cp); array.setType(getArrayType(typeName), cp); diff --git a/src/test/javassist/JvstTest4.java b/src/test/javassist/JvstTest4.java index 9ea09743..67c229fa 100644 --- a/src/test/javassist/JvstTest4.java +++ b/src/test/javassist/JvstTest4.java @@ -495,7 +495,9 @@ public class JvstTest4 extends JvstTestRoot { for (CtClass c: tab) { System.err.println(c.getName()); } - assertEquals(4, tab.length); + + // Eclipse compiler sets tab.length to 4 but javac sets to 3. + assertTrue(tab.length == 4 || tab.length == 3); for (CtClass c: tab) { String name = c.getName(); assertTrue(name.equals("test4.NestedClass$N") @@ -512,7 +514,9 @@ public class JvstTest4 extends JvstTestRoot { public void testGetClasses() throws Exception { CtClass cc = sloader.get("test4.NestedClass"); CtClass[] tab = cc.getDeclaredClasses(); - assertEquals(4, tab.length); + + // Eclipse compiler sets tab.length to 4 but javac sets to 3. + assertTrue(tab.length == 4 || tab.length == 3); for (CtClass c: tab) { String name = c.getName(); assertTrue(name.equals("test4.NestedClass$N")