From aad7d4277c161ddcf502b9e4bd48861450a3458d Mon Sep 17 00:00:00 2001 From: chiba Date: Wed, 19 Oct 2011 04:54:56 +0000 Subject: [PATCH] fixed JASSIST-145 git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@593 30ef5769-5b8d-40dd-aea6-55b5d6557bb3 --- src/main/javassist/bytecode/stackmap/TypeData.java | 4 ++++ src/test/javassist/JvstTest4.java | 8 ++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) 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") -- 2.39.5