You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2014/05/31 00:51:30 UTC

svn commit: r1598766 [12/12] - in /commons/proper/bcel/trunk/src: main/java/org/apache/bcel/ main/java/org/apache/bcel/classfile/ main/java/org/apache/bcel/generic/ main/java/org/apache/bcel/util/ main/java/org/apache/bcel/verifier/exc/ main/java/org/a...

Modified: commons/proper/bcel/trunk/src/test/java/org/apache/bcel/CounterVisitorTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/test/java/org/apache/bcel/CounterVisitorTestCase.java?rev=1598766&r1=1598765&r2=1598766&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/test/java/org/apache/bcel/CounterVisitorTestCase.java (original)
+++ commons/proper/bcel/trunk/src/test/java/org/apache/bcel/CounterVisitorTestCase.java Fri May 30 22:51:27 2014
@@ -22,194 +22,194 @@ import org.apache.bcel.classfile.JavaCla
 
 public class CounterVisitorTestCase extends AbstractCounterVisitorTestCase
 {
-	@Override
+    @Override
     protected JavaClass getTestClass() throws ClassNotFoundException
-	{
-		return getTestClass("org.apache.bcel.data.MarkedType");
-	}
-
-	public void testAnnotationsCount()
-	{
-		assertEquals("annotationCount", 2, getVisitor().annotationCount);
-	}
-
-	public void testAnnotationDefaultCount()
-	{
-		assertEquals("annotationDefaultCount", 0, getVisitor().annotationDefaultCount);
-	}
-
-	public void testAnnotationEntryCount()
-	{
-		assertEquals("annotationEntryCount", 2, getVisitor().annotationEntryCount);
-	}
-
-	public void testCodeCount()
-	{
-		assertEquals("codeCount", 1, getVisitor().codeCount);
-	}
-
-	public void testCodeExceptionCount()
-	{
-		assertEquals("codeExceptionCount", 0, getVisitor().codeExceptionCount);
-	}
-
-	public void testConstantClassCount()
-	{
-		assertEquals("constantClassCount", 2, getVisitor().constantClassCount);
-	}
-
-	public void testConstantDoubleCount()
-	{
-		assertEquals("constantDoubleCount", 0, getVisitor().constantDoubleCount);
-	}
-
-	public void testConstantFieldrefCount()
-	{
-		assertEquals("constantFieldrefCount", 0, getVisitor().constantFieldrefCount);
-	}
-
-	public void testConstantFloatCount()
-	{
-		assertEquals("constantFloatCount", 0, getVisitor().constantFloatCount);
-	}
-
-	public void testConstantIntegerCount()
-	{
-		assertEquals("constantIntegerCount", 0, getVisitor().constantIntegerCount);
-	}
-
-	public void testConstantInterfaceMethodrefCount()
-	{
-		assertEquals("constantInterfaceMethodrefCount", 0, getVisitor().constantInterfaceMethodrefCount);
-	}
-
-	public void testConstantLongCount()
-	{
-		assertEquals("constantLongCount", 0, getVisitor().constantLongCount);
-	}
-
-	public void testConstantMethodrefCount()
-	{
-		assertEquals("constantMethodrefCount", 1, getVisitor().constantMethodrefCount);
-	}
-
-	public void testConstantNameAndTypeCount()
-	{
-		assertEquals("constantNameAndTypeCount", 1, getVisitor().constantNameAndTypeCount);
-	}
-
-	public void testConstantPoolCount()
-	{
-		assertEquals("constantPoolCount", 1, getVisitor().constantPoolCount);
-	}
-
-	public void testConstantStringCount()
-	{
-		assertEquals("constantStringCount", 0, getVisitor().constantStringCount);
-	}
-
-	public void testConstantValueCount()
-	{
-		assertEquals("constantValueCount", 0, getVisitor().constantValueCount);
-	}
-    
-	public void testDeprecatedCount()
-	{
-		assertEquals("deprecatedCount", 0, getVisitor().deprecatedCount);
-	}
-
-	public void testEnclosingMethodCount()
-	{
-		assertEquals("enclosingMethodCount", 0, getVisitor().enclosingMethodCount);
-	}
-
-	public void testExceptionTableCount()
-	{
-		assertEquals("exceptionTableCount", 0, getVisitor().exceptionTableCount);
-	}
-
-	public void testFieldCount()
-	{
-		assertEquals("fieldCount", 0, getVisitor().fieldCount);
-	}
-
-	public void testInnerClassCount()
-	{
-		assertEquals("innerClassCount", 0, getVisitor().innerClassCount);
-	}
-
-	public void testInnerClassesCount()
-	{
-		assertEquals("innerClassesCount", 0, getVisitor().innerClassesCount);
-	}
-
-	public void testJavaClassCount()
-	{
-		assertEquals("javaClassCount", 1, getVisitor().javaClassCount);
-	}
-
-	public void testLineNumberCount()
-	{
-		assertEquals("lineNumberCount", 1, getVisitor().lineNumberCount);
-	}
-
-	public void testLineNumberTableCount()
-	{
-		assertEquals("lineNumberTableCount", 1, getVisitor().lineNumberTableCount);
-	}
-
-	public void testLocalVariableCount()
-	{
-		assertEquals("localVariableCount", 1, getVisitor().localVariableCount);
-	}
-
-	public void testLocalVariableTableCount()
-	{
-		assertEquals("localVariableTableCount", 1, getVisitor().localVariableTableCount);
-	}
-
-	public void testLocalVariableTypeTableCount()
-	{
-		assertEquals("localVariableTypeTableCount", 0, getVisitor().localVariableTypeTableCount);
-	}
-
-	public void testMethodCount()
-	{
-		assertEquals("methodCount", 1, getVisitor().methodCount);
-	}
-
-	public void testParameterAnnotationCount()
-	{
-		assertEquals("parameterAnnotationCount", 0, getVisitor().parameterAnnotationCount);
-	}
-
-	public void testSignatureCount()
-	{
-		assertEquals("signatureAnnotationCount", 0, getVisitor().signatureAnnotationCount);
-	}
-
-	public void testSourceFileCount()
-	{
-		assertEquals("sourceFileCount", 1, getVisitor().sourceFileCount);
-	}
-
-	public void testStackMapCount()
-	{
-		assertEquals("stackMapCount", 0, getVisitor().stackMapCount);
-	}
-
-	public void testStackMapEntryCount()
-	{
-		assertEquals("stackMapEntryCount", 0, getVisitor().stackMapEntryCount);
-	}
-
-	public void testSyntheticCount()
-	{
-		assertEquals("syntheticCount", 0, getVisitor().syntheticCount);
-	}
-
-	public void testUnknownCount()
-	{
-		assertEquals("unknownCount", 0, getVisitor().unknownCount);
-	}
+    {
+        return getTestClass("org.apache.bcel.data.MarkedType");
+    }
+
+    public void testAnnotationsCount()
+    {
+        assertEquals("annotationCount", 2, getVisitor().annotationCount);
+    }
+
+    public void testAnnotationDefaultCount()
+    {
+        assertEquals("annotationDefaultCount", 0, getVisitor().annotationDefaultCount);
+    }
+
+    public void testAnnotationEntryCount()
+    {
+        assertEquals("annotationEntryCount", 2, getVisitor().annotationEntryCount);
+    }
+
+    public void testCodeCount()
+    {
+        assertEquals("codeCount", 1, getVisitor().codeCount);
+    }
+
+    public void testCodeExceptionCount()
+    {
+        assertEquals("codeExceptionCount", 0, getVisitor().codeExceptionCount);
+    }
+
+    public void testConstantClassCount()
+    {
+        assertEquals("constantClassCount", 2, getVisitor().constantClassCount);
+    }
+
+    public void testConstantDoubleCount()
+    {
+        assertEquals("constantDoubleCount", 0, getVisitor().constantDoubleCount);
+    }
+
+    public void testConstantFieldrefCount()
+    {
+        assertEquals("constantFieldrefCount", 0, getVisitor().constantFieldrefCount);
+    }
+
+    public void testConstantFloatCount()
+    {
+        assertEquals("constantFloatCount", 0, getVisitor().constantFloatCount);
+    }
+
+    public void testConstantIntegerCount()
+    {
+        assertEquals("constantIntegerCount", 0, getVisitor().constantIntegerCount);
+    }
+
+    public void testConstantInterfaceMethodrefCount()
+    {
+        assertEquals("constantInterfaceMethodrefCount", 0, getVisitor().constantInterfaceMethodrefCount);
+    }
+
+    public void testConstantLongCount()
+    {
+        assertEquals("constantLongCount", 0, getVisitor().constantLongCount);
+    }
+
+    public void testConstantMethodrefCount()
+    {
+        assertEquals("constantMethodrefCount", 1, getVisitor().constantMethodrefCount);
+    }
+
+    public void testConstantNameAndTypeCount()
+    {
+        assertEquals("constantNameAndTypeCount", 1, getVisitor().constantNameAndTypeCount);
+    }
+
+    public void testConstantPoolCount()
+    {
+        assertEquals("constantPoolCount", 1, getVisitor().constantPoolCount);
+    }
+
+    public void testConstantStringCount()
+    {
+        assertEquals("constantStringCount", 0, getVisitor().constantStringCount);
+    }
+
+    public void testConstantValueCount()
+    {
+        assertEquals("constantValueCount", 0, getVisitor().constantValueCount);
+    }
+
+    public void testDeprecatedCount()
+    {
+        assertEquals("deprecatedCount", 0, getVisitor().deprecatedCount);
+    }
+
+    public void testEnclosingMethodCount()
+    {
+        assertEquals("enclosingMethodCount", 0, getVisitor().enclosingMethodCount);
+    }
+
+    public void testExceptionTableCount()
+    {
+        assertEquals("exceptionTableCount", 0, getVisitor().exceptionTableCount);
+    }
+
+    public void testFieldCount()
+    {
+        assertEquals("fieldCount", 0, getVisitor().fieldCount);
+    }
+
+    public void testInnerClassCount()
+    {
+        assertEquals("innerClassCount", 0, getVisitor().innerClassCount);
+    }
+
+    public void testInnerClassesCount()
+    {
+        assertEquals("innerClassesCount", 0, getVisitor().innerClassesCount);
+    }
+
+    public void testJavaClassCount()
+    {
+        assertEquals("javaClassCount", 1, getVisitor().javaClassCount);
+    }
+
+    public void testLineNumberCount()
+    {
+        assertEquals("lineNumberCount", 1, getVisitor().lineNumberCount);
+    }
+
+    public void testLineNumberTableCount()
+    {
+        assertEquals("lineNumberTableCount", 1, getVisitor().lineNumberTableCount);
+    }
+
+    public void testLocalVariableCount()
+    {
+        assertEquals("localVariableCount", 1, getVisitor().localVariableCount);
+    }
+
+    public void testLocalVariableTableCount()
+    {
+        assertEquals("localVariableTableCount", 1, getVisitor().localVariableTableCount);
+    }
+
+    public void testLocalVariableTypeTableCount()
+    {
+        assertEquals("localVariableTypeTableCount", 0, getVisitor().localVariableTypeTableCount);
+    }
+
+    public void testMethodCount()
+    {
+        assertEquals("methodCount", 1, getVisitor().methodCount);
+    }
+
+    public void testParameterAnnotationCount()
+    {
+        assertEquals("parameterAnnotationCount", 0, getVisitor().parameterAnnotationCount);
+    }
+
+    public void testSignatureCount()
+    {
+        assertEquals("signatureAnnotationCount", 0, getVisitor().signatureAnnotationCount);
+    }
+
+    public void testSourceFileCount()
+    {
+        assertEquals("sourceFileCount", 1, getVisitor().sourceFileCount);
+    }
+
+    public void testStackMapCount()
+    {
+        assertEquals("stackMapCount", 0, getVisitor().stackMapCount);
+    }
+
+    public void testStackMapEntryCount()
+    {
+        assertEquals("stackMapEntryCount", 0, getVisitor().stackMapEntryCount);
+    }
+
+    public void testSyntheticCount()
+    {
+        assertEquals("syntheticCount", 0, getVisitor().syntheticCount);
+    }
+
+    public void testUnknownCount()
+    {
+        assertEquals("unknownCount", 0, getVisitor().unknownCount);
+    }
 }

Modified: commons/proper/bcel/trunk/src/test/java/org/apache/bcel/ElementValueGenTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/test/java/org/apache/bcel/ElementValueGenTestCase.java?rev=1598766&r1=1598765&r2=1598766&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/test/java/org/apache/bcel/ElementValueGenTestCase.java (original)
+++ commons/proper/bcel/trunk/src/test/java/org/apache/bcel/ElementValueGenTestCase.java Fri May 30 22:51:27 2014
@@ -34,207 +34,207 @@ import org.apache.bcel.generic.EnumEleme
 
 public class ElementValueGenTestCase extends AbstractTestCase
 {
-	private ClassGen createClassGen(String classname)
-	{
-		return new ClassGen(classname, "java.lang.Object", "<generated>",
-				Constants.ACC_PUBLIC | Constants.ACC_SUPER, null);
-	}
-
-	/**
-	 * Create primitive element values
-	 */
-	public void testCreateIntegerElementValue()
-	{
-		ClassGen cg = createClassGen("HelloWorld");
-		ConstantPoolGen cp = cg.getConstantPool();
-		SimpleElementValueGen evg = new SimpleElementValueGen(
-				ElementValueGen.PRIMITIVE_INT, cp, 555);
-		// Creation of an element like that should leave a new entry in the
-		// cpool
-		assertTrue("Should have the same index in the constantpool but "
-				+ evg.getIndex() + "!=" + cp.lookupInteger(555),
-				evg.getIndex() == cp.lookupInteger(555));
-		checkSerialize(evg, cp);
-	}
-
-	public void testCreateFloatElementValue()
-	{
-		ClassGen cg = createClassGen("HelloWorld");
-		ConstantPoolGen cp = cg.getConstantPool();
-		SimpleElementValueGen evg = new SimpleElementValueGen(
-				ElementValueGen.PRIMITIVE_FLOAT, cp, 111.222f);
-		// Creation of an element like that should leave a new entry in the
-		// cpool
-		assertTrue("Should have the same index in the constantpool but "
-				+ evg.getIndex() + "!=" + cp.lookupFloat(111.222f), evg
-				.getIndex() == cp.lookupFloat(111.222f));
-		checkSerialize(evg, cp);
-	}
-
-	public void testCreateDoubleElementValue()
-	{
-		ClassGen cg = createClassGen("HelloWorld");
-		ConstantPoolGen cp = cg.getConstantPool();
-		SimpleElementValueGen evg = new SimpleElementValueGen(
-				ElementValueGen.PRIMITIVE_DOUBLE, cp, 333.44);
-		// Creation of an element like that should leave a new entry in the
-		// cpool
-		int idx = cp.lookupDouble(333.44);
-		assertTrue("Should have the same index in the constantpool but "
-				+ evg.getIndex() + "!=" + idx, evg.getIndex() == idx);
-		checkSerialize(evg, cp);
-	}
-
-	public void testCreateLongElementValue()
-	{
-		ClassGen cg = createClassGen("HelloWorld");
-		ConstantPoolGen cp = cg.getConstantPool();
-		SimpleElementValueGen evg = new SimpleElementValueGen(
-				ElementValueGen.PRIMITIVE_LONG, cp, 3334455L);
-		// Creation of an element like that should leave a new entry in the
-		// cpool
-		int idx = cp.lookupLong(3334455L);
-		assertTrue("Should have the same index in the constantpool but "
-				+ evg.getIndex() + "!=" + idx, evg.getIndex() == idx);
-		checkSerialize(evg, cp);
-	}
-
-	public void testCreateCharElementValue()
-	{
-		ClassGen cg = createClassGen("HelloWorld");
-		ConstantPoolGen cp = cg.getConstantPool();
-		SimpleElementValueGen evg = new SimpleElementValueGen(
-				ElementValueGen.PRIMITIVE_CHAR, cp, 't');
-		// Creation of an element like that should leave a new entry in the
-		// cpool
-		int idx = cp.lookupInteger('t');
-		assertTrue("Should have the same index in the constantpool but "
-				+ evg.getIndex() + "!=" + idx, evg.getIndex() == idx);
-		checkSerialize(evg, cp);
-	}
-
-	public void testCreateByteElementValue()
-	{
-		ClassGen cg = createClassGen("HelloWorld");
-		ConstantPoolGen cp = cg.getConstantPool();
-		SimpleElementValueGen evg = new SimpleElementValueGen(
-				ElementValueGen.PRIMITIVE_CHAR, cp, (byte) 'z');
-		// Creation of an element like that should leave a new entry in the
-		// cpool
-		int idx = cp.lookupInteger((byte) 'z');
-		assertTrue("Should have the same index in the constantpool but "
-				+ evg.getIndex() + "!=" + idx, evg.getIndex() == idx);
-		checkSerialize(evg, cp);
-	}
-
-	public void testCreateBooleanElementValue()
-	{
-		ClassGen cg = createClassGen("HelloWorld");
-		ConstantPoolGen cp = cg.getConstantPool();
-		SimpleElementValueGen evg = new SimpleElementValueGen(
-				ElementValueGen.PRIMITIVE_BOOLEAN, cp, true);
-		// Creation of an element like that should leave a new entry in the
-		// cpool
-		int idx = cp.lookupInteger(1); // 1 == true
-		assertTrue("Should have the same index in the constantpool but "
-				+ evg.getIndex() + "!=" + idx, evg.getIndex() == idx);
-		checkSerialize(evg, cp);
-	}
-
-	public void testCreateShortElementValue()
-	{
-		ClassGen cg = createClassGen("HelloWorld");
-		ConstantPoolGen cp = cg.getConstantPool();
-		SimpleElementValueGen evg = new SimpleElementValueGen(
-				ElementValueGen.PRIMITIVE_SHORT, cp, (short) 42);
-		// Creation of an element like that should leave a new entry in the
-		// cpool
-		int idx = cp.lookupInteger(42);
-		assertTrue("Should have the same index in the constantpool but "
-				+ evg.getIndex() + "!=" + idx, evg.getIndex() == idx);
-		checkSerialize(evg, cp);
-	}
-
-	// //
-	// Create string element values
-	public void testCreateStringElementValue()
-	{
-		// Create HelloWorld
-		ClassGen cg = createClassGen("HelloWorld");
-		ConstantPoolGen cp = cg.getConstantPool();
-		SimpleElementValueGen evg = new SimpleElementValueGen(
-				ElementValueGen.STRING, cp, "hello");
-		// Creation of an element like that should leave a new entry in the
-		// cpool
-		assertTrue("Should have the same index in the constantpool but "
-				+ evg.getIndex() + "!=" + cp.lookupUtf8("hello"), evg
-				.getIndex() == cp.lookupUtf8("hello"));
-		checkSerialize(evg, cp);
-	}
-
-	// //
-	// Create enum element value
-	public void testCreateEnumElementValue()
-	{
-		ClassGen cg = createClassGen("HelloWorld");
-		ConstantPoolGen cp = cg.getConstantPool();
-		ObjectType enumType = new ObjectType("SimpleEnum"); // Supports rainbow
-															// :)
-		EnumElementValueGen evg = new EnumElementValueGen(enumType, "Red", cp);
-		// Creation of an element like that should leave a new entry in the
-		// cpool
-		assertTrue(
-				"The new ElementValue value index should match the contents of the constantpool but "
-						+ evg.getValueIndex() + "!=" + cp.lookupUtf8("Red"),
-				evg.getValueIndex() == cp.lookupUtf8("Red"));
-		// BCELBUG: Should the class signature or class name be in the constant
-		// pool? (see note in ConstantPool)
-		// assertTrue("The new ElementValue type index should match the contents
-		// of the constantpool but "+
-		// evg.getTypeIndex()+"!="+cp.lookupClass(enumType.getSignature()),
-		// evg.getTypeIndex()==cp.lookupClass(enumType.getSignature()));
-		checkSerialize(evg, cp);
-	}
-
-	// //
-	// Create class element value
-	public void testCreateClassElementValue()
-	{
-		ClassGen cg = createClassGen("HelloWorld");
-		ConstantPoolGen cp = cg.getConstantPool();
-		ObjectType classType = new ObjectType("java.lang.Integer");
-		ClassElementValueGen evg = new ClassElementValueGen(classType, cp);
-		assertTrue("Unexpected value for contained class: '"
-				+ evg.getClassString() + "'", evg.getClassString().contains("Integer"));
-		checkSerialize(evg, cp);
-	}
-
-	private void checkSerialize(ElementValueGen evgBefore, ConstantPoolGen cpg)
-	{
-		try
-		{
-			String beforeValue = evgBefore.stringifyValue();
-			ByteArrayOutputStream baos = new ByteArrayOutputStream();
-			DataOutputStream dos = new DataOutputStream(baos);
-			evgBefore.dump(dos);
-			dos.flush();
-			dos.close();
-			byte[] bs = baos.toByteArray();
-			ByteArrayInputStream bais = new ByteArrayInputStream(bs);
-			DataInputStream dis = new DataInputStream(bais);
-			ElementValueGen evgAfter = ElementValueGen.readElementValue(dis,
-					cpg);
-			dis.close();
-			String afterValue = evgAfter.stringifyValue();
-			if (!beforeValue.equals(afterValue))
-			{
-				fail("Deserialization failed: before='" + beforeValue
-						+ "' after='" + afterValue + "'");
-			}
-		}
-		catch (IOException ioe)
-		{
-			fail("Unexpected exception whilst checking serialization: " + ioe);
-		}
-	}
+    private ClassGen createClassGen(String classname)
+    {
+        return new ClassGen(classname, "java.lang.Object", "<generated>",
+                Constants.ACC_PUBLIC | Constants.ACC_SUPER, null);
+    }
+
+    /**
+     * Create primitive element values
+     */
+    public void testCreateIntegerElementValue()
+    {
+        ClassGen cg = createClassGen("HelloWorld");
+        ConstantPoolGen cp = cg.getConstantPool();
+        SimpleElementValueGen evg = new SimpleElementValueGen(
+                ElementValueGen.PRIMITIVE_INT, cp, 555);
+        // Creation of an element like that should leave a new entry in the
+        // cpool
+        assertTrue("Should have the same index in the constantpool but "
+                + evg.getIndex() + "!=" + cp.lookupInteger(555),
+                evg.getIndex() == cp.lookupInteger(555));
+        checkSerialize(evg, cp);
+    }
+
+    public void testCreateFloatElementValue()
+    {
+        ClassGen cg = createClassGen("HelloWorld");
+        ConstantPoolGen cp = cg.getConstantPool();
+        SimpleElementValueGen evg = new SimpleElementValueGen(
+                ElementValueGen.PRIMITIVE_FLOAT, cp, 111.222f);
+        // Creation of an element like that should leave a new entry in the
+        // cpool
+        assertTrue("Should have the same index in the constantpool but "
+                + evg.getIndex() + "!=" + cp.lookupFloat(111.222f), evg
+                .getIndex() == cp.lookupFloat(111.222f));
+        checkSerialize(evg, cp);
+    }
+
+    public void testCreateDoubleElementValue()
+    {
+        ClassGen cg = createClassGen("HelloWorld");
+        ConstantPoolGen cp = cg.getConstantPool();
+        SimpleElementValueGen evg = new SimpleElementValueGen(
+                ElementValueGen.PRIMITIVE_DOUBLE, cp, 333.44);
+        // Creation of an element like that should leave a new entry in the
+        // cpool
+        int idx = cp.lookupDouble(333.44);
+        assertTrue("Should have the same index in the constantpool but "
+                + evg.getIndex() + "!=" + idx, evg.getIndex() == idx);
+        checkSerialize(evg, cp);
+    }
+
+    public void testCreateLongElementValue()
+    {
+        ClassGen cg = createClassGen("HelloWorld");
+        ConstantPoolGen cp = cg.getConstantPool();
+        SimpleElementValueGen evg = new SimpleElementValueGen(
+                ElementValueGen.PRIMITIVE_LONG, cp, 3334455L);
+        // Creation of an element like that should leave a new entry in the
+        // cpool
+        int idx = cp.lookupLong(3334455L);
+        assertTrue("Should have the same index in the constantpool but "
+                + evg.getIndex() + "!=" + idx, evg.getIndex() == idx);
+        checkSerialize(evg, cp);
+    }
+
+    public void testCreateCharElementValue()
+    {
+        ClassGen cg = createClassGen("HelloWorld");
+        ConstantPoolGen cp = cg.getConstantPool();
+        SimpleElementValueGen evg = new SimpleElementValueGen(
+                ElementValueGen.PRIMITIVE_CHAR, cp, 't');
+        // Creation of an element like that should leave a new entry in the
+        // cpool
+        int idx = cp.lookupInteger('t');
+        assertTrue("Should have the same index in the constantpool but "
+                + evg.getIndex() + "!=" + idx, evg.getIndex() == idx);
+        checkSerialize(evg, cp);
+    }
+
+    public void testCreateByteElementValue()
+    {
+        ClassGen cg = createClassGen("HelloWorld");
+        ConstantPoolGen cp = cg.getConstantPool();
+        SimpleElementValueGen evg = new SimpleElementValueGen(
+                ElementValueGen.PRIMITIVE_CHAR, cp, (byte) 'z');
+        // Creation of an element like that should leave a new entry in the
+        // cpool
+        int idx = cp.lookupInteger((byte) 'z');
+        assertTrue("Should have the same index in the constantpool but "
+                + evg.getIndex() + "!=" + idx, evg.getIndex() == idx);
+        checkSerialize(evg, cp);
+    }
+
+    public void testCreateBooleanElementValue()
+    {
+        ClassGen cg = createClassGen("HelloWorld");
+        ConstantPoolGen cp = cg.getConstantPool();
+        SimpleElementValueGen evg = new SimpleElementValueGen(
+                ElementValueGen.PRIMITIVE_BOOLEAN, cp, true);
+        // Creation of an element like that should leave a new entry in the
+        // cpool
+        int idx = cp.lookupInteger(1); // 1 == true
+        assertTrue("Should have the same index in the constantpool but "
+                + evg.getIndex() + "!=" + idx, evg.getIndex() == idx);
+        checkSerialize(evg, cp);
+    }
+
+    public void testCreateShortElementValue()
+    {
+        ClassGen cg = createClassGen("HelloWorld");
+        ConstantPoolGen cp = cg.getConstantPool();
+        SimpleElementValueGen evg = new SimpleElementValueGen(
+                ElementValueGen.PRIMITIVE_SHORT, cp, (short) 42);
+        // Creation of an element like that should leave a new entry in the
+        // cpool
+        int idx = cp.lookupInteger(42);
+        assertTrue("Should have the same index in the constantpool but "
+                + evg.getIndex() + "!=" + idx, evg.getIndex() == idx);
+        checkSerialize(evg, cp);
+    }
+
+    // //
+    // Create string element values
+    public void testCreateStringElementValue()
+    {
+        // Create HelloWorld
+        ClassGen cg = createClassGen("HelloWorld");
+        ConstantPoolGen cp = cg.getConstantPool();
+        SimpleElementValueGen evg = new SimpleElementValueGen(
+                ElementValueGen.STRING, cp, "hello");
+        // Creation of an element like that should leave a new entry in the
+        // cpool
+        assertTrue("Should have the same index in the constantpool but "
+                + evg.getIndex() + "!=" + cp.lookupUtf8("hello"), evg
+                .getIndex() == cp.lookupUtf8("hello"));
+        checkSerialize(evg, cp);
+    }
+
+    // //
+    // Create enum element value
+    public void testCreateEnumElementValue()
+    {
+        ClassGen cg = createClassGen("HelloWorld");
+        ConstantPoolGen cp = cg.getConstantPool();
+        ObjectType enumType = new ObjectType("SimpleEnum"); // Supports rainbow
+                                                            // :)
+        EnumElementValueGen evg = new EnumElementValueGen(enumType, "Red", cp);
+        // Creation of an element like that should leave a new entry in the
+        // cpool
+        assertTrue(
+                "The new ElementValue value index should match the contents of the constantpool but "
+                        + evg.getValueIndex() + "!=" + cp.lookupUtf8("Red"),
+                evg.getValueIndex() == cp.lookupUtf8("Red"));
+        // BCELBUG: Should the class signature or class name be in the constant
+        // pool? (see note in ConstantPool)
+        // assertTrue("The new ElementValue type index should match the contents
+        // of the constantpool but "+
+        // evg.getTypeIndex()+"!="+cp.lookupClass(enumType.getSignature()),
+        // evg.getTypeIndex()==cp.lookupClass(enumType.getSignature()));
+        checkSerialize(evg, cp);
+    }
+
+    // //
+    // Create class element value
+    public void testCreateClassElementValue()
+    {
+        ClassGen cg = createClassGen("HelloWorld");
+        ConstantPoolGen cp = cg.getConstantPool();
+        ObjectType classType = new ObjectType("java.lang.Integer");
+        ClassElementValueGen evg = new ClassElementValueGen(classType, cp);
+        assertTrue("Unexpected value for contained class: '"
+                + evg.getClassString() + "'", evg.getClassString().contains("Integer"));
+        checkSerialize(evg, cp);
+    }
+
+    private void checkSerialize(ElementValueGen evgBefore, ConstantPoolGen cpg)
+    {
+        try
+        {
+            String beforeValue = evgBefore.stringifyValue();
+            ByteArrayOutputStream baos = new ByteArrayOutputStream();
+            DataOutputStream dos = new DataOutputStream(baos);
+            evgBefore.dump(dos);
+            dos.flush();
+            dos.close();
+            byte[] bs = baos.toByteArray();
+            ByteArrayInputStream bais = new ByteArrayInputStream(bs);
+            DataInputStream dis = new DataInputStream(bais);
+            ElementValueGen evgAfter = ElementValueGen.readElementValue(dis,
+                    cpg);
+            dis.close();
+            String afterValue = evgAfter.stringifyValue();
+            if (!beforeValue.equals(afterValue))
+            {
+                fail("Deserialization failed: before='" + beforeValue
+                        + "' after='" + afterValue + "'");
+            }
+        }
+        catch (IOException ioe)
+        {
+            fail("Unexpected exception whilst checking serialization: " + ioe);
+        }
+    }
 }
\ No newline at end of file

Modified: commons/proper/bcel/trunk/src/test/java/org/apache/bcel/EnclosingMethodAttributeTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/test/java/org/apache/bcel/EnclosingMethodAttributeTestCase.java?rev=1598766&r1=1598765&r2=1598766&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/test/java/org/apache/bcel/EnclosingMethodAttributeTestCase.java (original)
+++ commons/proper/bcel/trunk/src/test/java/org/apache/bcel/EnclosingMethodAttributeTestCase.java Fri May 30 22:51:27 2014
@@ -28,80 +28,80 @@ import org.apache.bcel.util.SyntheticRep
 
 public class EnclosingMethodAttributeTestCase extends AbstractTestCase
 {
-	/**
-	 * Verify for an inner class declared inside the 'main' method that the
-	 * enclosing method attribute is set correctly.
-	 */
-	public void testCheckMethodLevelNamedInnerClass()
-			throws ClassNotFoundException
-	{
-		JavaClass clazz = getTestClass("org.apache.bcel.data.AttributeTestClassEM01$1S");
-		ConstantPool pool = clazz.getConstantPool();
-		Attribute[] encMethodAttrs = findAttribute("EnclosingMethod", clazz);
-		assertTrue("Expected 1 EnclosingMethod attribute but found "
-				+ encMethodAttrs.length, encMethodAttrs.length == 1);
-		EnclosingMethod em = (EnclosingMethod) encMethodAttrs[0];
-		String enclosingClassName = em.getEnclosingClass().getBytes(pool);
-		String enclosingMethodName = em.getEnclosingMethod().getName(pool);
-		assertTrue(
-				"Expected class name to be 'org/apache/bcel/data/AttributeTestClassEM01' but was "
-						+ enclosingClassName, enclosingClassName
-						.equals("org/apache/bcel/data/AttributeTestClassEM01"));
-		assertTrue("Expected method name to be 'main' but was "
-				+ enclosingMethodName, enclosingMethodName.equals("main"));
-	}
+    /**
+     * Verify for an inner class declared inside the 'main' method that the
+     * enclosing method attribute is set correctly.
+     */
+    public void testCheckMethodLevelNamedInnerClass()
+            throws ClassNotFoundException
+    {
+        JavaClass clazz = getTestClass("org.apache.bcel.data.AttributeTestClassEM01$1S");
+        ConstantPool pool = clazz.getConstantPool();
+        Attribute[] encMethodAttrs = findAttribute("EnclosingMethod", clazz);
+        assertTrue("Expected 1 EnclosingMethod attribute but found "
+                + encMethodAttrs.length, encMethodAttrs.length == 1);
+        EnclosingMethod em = (EnclosingMethod) encMethodAttrs[0];
+        String enclosingClassName = em.getEnclosingClass().getBytes(pool);
+        String enclosingMethodName = em.getEnclosingMethod().getName(pool);
+        assertTrue(
+                "Expected class name to be 'org/apache/bcel/data/AttributeTestClassEM01' but was "
+                        + enclosingClassName, enclosingClassName
+                        .equals("org/apache/bcel/data/AttributeTestClassEM01"));
+        assertTrue("Expected method name to be 'main' but was "
+                + enclosingMethodName, enclosingMethodName.equals("main"));
+    }
 
-	/**
-	 * Verify for an inner class declared at the type level that the
-	 * EnclosingMethod attribute is set correctly (i.e. to a null value)
-	 */
-	public void testCheckClassLevelNamedInnerClass()
-			throws ClassNotFoundException
-	{
-		JavaClass clazz = getTestClass("org.apache.bcel.data.AttributeTestClassEM02$1");
-		ConstantPool pool = clazz.getConstantPool();
-		Attribute[] encMethodAttrs = findAttribute("EnclosingMethod", clazz);
-		assertTrue("Expected 1 EnclosingMethod attribute but found "
-				+ encMethodAttrs.length, encMethodAttrs.length == 1);
-		EnclosingMethod em = (EnclosingMethod) encMethodAttrs[0];
-		String enclosingClassName = em.getEnclosingClass().getBytes(pool);
-		assertTrue(
-				"The class is not within a method, so method_index should be null, but it is "
-						+ em.getEnclosingMethodIndex(), em
-						.getEnclosingMethodIndex() == 0);
-		assertTrue(
-				"Expected class name to be 'org/apache/bcel/data/AttributeTestClassEM02' but was "
-						+ enclosingClassName, enclosingClassName
-						.equals("org/apache/bcel/data/AttributeTestClassEM02"));
-	}
+    /**
+     * Verify for an inner class declared at the type level that the
+     * EnclosingMethod attribute is set correctly (i.e. to a null value)
+     */
+    public void testCheckClassLevelNamedInnerClass()
+            throws ClassNotFoundException
+    {
+        JavaClass clazz = getTestClass("org.apache.bcel.data.AttributeTestClassEM02$1");
+        ConstantPool pool = clazz.getConstantPool();
+        Attribute[] encMethodAttrs = findAttribute("EnclosingMethod", clazz);
+        assertTrue("Expected 1 EnclosingMethod attribute but found "
+                + encMethodAttrs.length, encMethodAttrs.length == 1);
+        EnclosingMethod em = (EnclosingMethod) encMethodAttrs[0];
+        String enclosingClassName = em.getEnclosingClass().getBytes(pool);
+        assertTrue(
+                "The class is not within a method, so method_index should be null, but it is "
+                        + em.getEnclosingMethodIndex(), em
+                        .getEnclosingMethodIndex() == 0);
+        assertTrue(
+                "Expected class name to be 'org/apache/bcel/data/AttributeTestClassEM02' but was "
+                        + enclosingClassName, enclosingClassName
+                        .equals("org/apache/bcel/data/AttributeTestClassEM02"));
+    }
 
-	/**
-	 * Check that we can save and load the attribute correctly.
-	 */
-	public void testAttributeSerializtion() throws ClassNotFoundException,
-			IOException
-	{
-		JavaClass clazz = getTestClass("org.apache.bcel.data.AttributeTestClassEM02$1");
-		ConstantPool pool = clazz.getConstantPool();
-		Attribute[] encMethodAttrs = findAttribute("EnclosingMethod", clazz);
-		assertTrue("Expected 1 EnclosingMethod attribute but found "
-				+ encMethodAttrs.length, encMethodAttrs.length == 1);
-		// Write it out
-		File tfile = createTestdataFile("AttributeTestClassEM02$1.class");
-		clazz.dump(tfile);
-		// Read in the new version and check it is OK
-		SyntheticRepository repos2 = createRepos(".");
-		JavaClass clazz2 = repos2.loadClass("AttributeTestClassEM02$1");
-		EnclosingMethod em = (EnclosingMethod) encMethodAttrs[0];
-		String enclosingClassName = em.getEnclosingClass().getBytes(pool);
-		assertTrue(
-				"The class is not within a method, so method_index should be null, but it is "
-						+ em.getEnclosingMethodIndex(), em
-						.getEnclosingMethodIndex() == 0);
-		assertTrue(
-				"Expected class name to be 'org/apache/bcel/data/AttributeTestClassEM02' but was "
-						+ enclosingClassName, enclosingClassName
-						.equals("org/apache/bcel/data/AttributeTestClassEM02"));
-		tfile.deleteOnExit();
-	}
+    /**
+     * Check that we can save and load the attribute correctly.
+     */
+    public void testAttributeSerializtion() throws ClassNotFoundException,
+            IOException
+    {
+        JavaClass clazz = getTestClass("org.apache.bcel.data.AttributeTestClassEM02$1");
+        ConstantPool pool = clazz.getConstantPool();
+        Attribute[] encMethodAttrs = findAttribute("EnclosingMethod", clazz);
+        assertTrue("Expected 1 EnclosingMethod attribute but found "
+                + encMethodAttrs.length, encMethodAttrs.length == 1);
+        // Write it out
+        File tfile = createTestdataFile("AttributeTestClassEM02$1.class");
+        clazz.dump(tfile);
+        // Read in the new version and check it is OK
+        SyntheticRepository repos2 = createRepos(".");
+        JavaClass clazz2 = repos2.loadClass("AttributeTestClassEM02$1");
+        EnclosingMethod em = (EnclosingMethod) encMethodAttrs[0];
+        String enclosingClassName = em.getEnclosingClass().getBytes(pool);
+        assertTrue(
+                "The class is not within a method, so method_index should be null, but it is "
+                        + em.getEnclosingMethodIndex(), em
+                        .getEnclosingMethodIndex() == 0);
+        assertTrue(
+                "Expected class name to be 'org/apache/bcel/data/AttributeTestClassEM02' but was "
+                        + enclosingClassName, enclosingClassName
+                        .equals("org/apache/bcel/data/AttributeTestClassEM02"));
+        tfile.deleteOnExit();
+    }
 }
\ No newline at end of file

Modified: commons/proper/bcel/trunk/src/test/java/org/apache/bcel/EnumAccessFlagTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/test/java/org/apache/bcel/EnumAccessFlagTestCase.java?rev=1598766&r1=1598765&r2=1598766&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/test/java/org/apache/bcel/EnumAccessFlagTestCase.java (original)
+++ commons/proper/bcel/trunk/src/test/java/org/apache/bcel/EnumAccessFlagTestCase.java Fri May 30 22:51:27 2014
@@ -22,20 +22,20 @@ import org.apache.bcel.classfile.JavaCla
 
 public class EnumAccessFlagTestCase extends AbstractTestCase
 {
-	/**
-	 * An enumerated type, once compiled, should result in a class file that is
-	 * marked such that we can determine from the access flags (through BCEL)
-	 * that it was originally an enum type declaration.
-	 */
-	public void testEnumClassSaysItIs() throws ClassNotFoundException
-	{
-		JavaClass clazz = getTestClass("org.apache.bcel.data.SimpleEnum");
-		assertTrue(
-				"Expected SimpleEnum class to say it was an enum - but it didn't !",
-				clazz.isEnum());
-		clazz = getTestClass("org.apache.bcel.data.SimpleClass");
-		assertTrue(
-				"Expected SimpleClass class to say it was not an enum - but it didn't !",
-				!clazz.isEnum());
-	}
+    /**
+     * An enumerated type, once compiled, should result in a class file that is
+     * marked such that we can determine from the access flags (through BCEL)
+     * that it was originally an enum type declaration.
+     */
+    public void testEnumClassSaysItIs() throws ClassNotFoundException
+    {
+        JavaClass clazz = getTestClass("org.apache.bcel.data.SimpleEnum");
+        assertTrue(
+                "Expected SimpleEnum class to say it was an enum - but it didn't !",
+                clazz.isEnum());
+        clazz = getTestClass("org.apache.bcel.data.SimpleClass");
+        assertTrue(
+                "Expected SimpleClass class to say it was not an enum - but it didn't !",
+                !clazz.isEnum());
+    }
 }
\ No newline at end of file

Modified: commons/proper/bcel/trunk/src/test/java/org/apache/bcel/FieldAnnotationsTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/test/java/org/apache/bcel/FieldAnnotationsTestCase.java?rev=1598766&r1=1598765&r2=1598766&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/test/java/org/apache/bcel/FieldAnnotationsTestCase.java (original)
+++ commons/proper/bcel/trunk/src/test/java/org/apache/bcel/FieldAnnotationsTestCase.java Fri May 30 22:51:27 2014
@@ -31,138 +31,138 @@ import org.apache.bcel.util.SyntheticRep
 
 public class FieldAnnotationsTestCase extends AbstractTestCase
 {
-	/**
-	 * Check field AnnotationEntrys are retrievable.
-	 */
-	public void testFieldAnnotationEntrys() throws ClassNotFoundException
-	{
-		JavaClass clazz = getTestClass("org.apache.bcel.data.AnnotatedFields");
-		// TODO L...;?
-		checkAnnotatedField(clazz, "i", "Lorg/apache/bcel/data/SimpleAnnotation;", "id", "1");
-		checkAnnotatedField(clazz, "s", "Lorg/apache/bcel/data/SimpleAnnotation;", "id", "2");
-	}
-
-	/**
-	 * Check field AnnotationEntrys (de)serialize ok.
-	 */
-	public void testFieldAnnotationEntrysReadWrite() throws ClassNotFoundException,
-			IOException
-	{
-		JavaClass clazz = getTestClass("org.apache.bcel.data.AnnotatedFields");
-		checkAnnotatedField(clazz, "i", "Lorg/apache/bcel/data/SimpleAnnotation;", "id", "1");
-		checkAnnotatedField(clazz, "s", "Lorg/apache/bcel/data/SimpleAnnotation;", "id", "2");
-		// Write it out
-		File tfile = createTestdataFile("AnnotatedFields.class");
-		clazz.dump(tfile);
-		SyntheticRepository repos2 = createRepos(".");
-		repos2.loadClass("AnnotatedFields");
-		checkAnnotatedField(clazz, "i", "Lorg/apache/bcel/data/SimpleAnnotation;", "id", "1");
-		checkAnnotatedField(clazz, "s", "Lorg/apache/bcel/data/SimpleAnnotation;", "id", "2");
-		assertTrue(tfile.delete());
-	}
-
-	/**
-	 * Check we can load in a class, modify its field AnnotationEntrys, save it,
-	 * reload it and everything is correct.
-	 */
-	public void testFieldAnnotationModification()
-			throws ClassNotFoundException
-	{
-		boolean dbg = false;
-		JavaClass clazz = getTestClass("org.apache.bcel.data.AnnotatedFields");
-		ClassGen clg = new ClassGen(clazz);
-		Field f = clg.getFields()[0];
-		if (dbg) {
+    /**
+     * Check field AnnotationEntrys are retrievable.
+     */
+    public void testFieldAnnotationEntrys() throws ClassNotFoundException
+    {
+        JavaClass clazz = getTestClass("org.apache.bcel.data.AnnotatedFields");
+        // TODO L...;?
+        checkAnnotatedField(clazz, "i", "Lorg/apache/bcel/data/SimpleAnnotation;", "id", "1");
+        checkAnnotatedField(clazz, "s", "Lorg/apache/bcel/data/SimpleAnnotation;", "id", "2");
+    }
+
+    /**
+     * Check field AnnotationEntrys (de)serialize ok.
+     */
+    public void testFieldAnnotationEntrysReadWrite() throws ClassNotFoundException,
+            IOException
+    {
+        JavaClass clazz = getTestClass("org.apache.bcel.data.AnnotatedFields");
+        checkAnnotatedField(clazz, "i", "Lorg/apache/bcel/data/SimpleAnnotation;", "id", "1");
+        checkAnnotatedField(clazz, "s", "Lorg/apache/bcel/data/SimpleAnnotation;", "id", "2");
+        // Write it out
+        File tfile = createTestdataFile("AnnotatedFields.class");
+        clazz.dump(tfile);
+        SyntheticRepository repos2 = createRepos(".");
+        repos2.loadClass("AnnotatedFields");
+        checkAnnotatedField(clazz, "i", "Lorg/apache/bcel/data/SimpleAnnotation;", "id", "1");
+        checkAnnotatedField(clazz, "s", "Lorg/apache/bcel/data/SimpleAnnotation;", "id", "2");
+        assertTrue(tfile.delete());
+    }
+
+    /**
+     * Check we can load in a class, modify its field AnnotationEntrys, save it,
+     * reload it and everything is correct.
+     */
+    public void testFieldAnnotationModification()
+            throws ClassNotFoundException
+    {
+        boolean dbg = false;
+        JavaClass clazz = getTestClass("org.apache.bcel.data.AnnotatedFields");
+        ClassGen clg = new ClassGen(clazz);
+        Field f = clg.getFields()[0];
+        if (dbg) {
             System.err.println("Field in freshly constructed class is: " + f);
         }
-		if (dbg) {
+        if (dbg) {
             System.err.println("AnnotationEntrys on field are: "
-					+ dumpAnnotationEntries(f.getAnnotationEntries()));
+                    + dumpAnnotationEntries(f.getAnnotationEntries()));
         }
-		AnnotationEntryGen fruitBasedAnnotationEntry = createFruitAnnotationEntry(clg
-				.getConstantPool(), "Tomato", false);
-		FieldGen fg = new FieldGen(f, clg.getConstantPool());
-		if (dbg) {
+        AnnotationEntryGen fruitBasedAnnotationEntry = createFruitAnnotationEntry(clg
+                .getConstantPool(), "Tomato", false);
+        FieldGen fg = new FieldGen(f, clg.getConstantPool());
+        if (dbg) {
             System.err.println("Adding AnnotationEntry to the field");
         }
-		fg.addAnnotationEntry(fruitBasedAnnotationEntry);
-		if (dbg) {
+        fg.addAnnotationEntry(fruitBasedAnnotationEntry);
+        if (dbg) {
             System.err.println("FieldGen (mutable field) is " + fg);
         }
-		if (dbg) {
+        if (dbg) {
             System.err.println("with AnnotationEntrys: "
-					+ dumpAnnotationEntries(fg.getAnnotationEntries()));
+                    + dumpAnnotationEntries(fg.getAnnotationEntries()));
         }
-		if (dbg) {
+        if (dbg) {
             System.err
-					.println("Replacing original field with new field that has extra AnnotationEntry");
+                    .println("Replacing original field with new field that has extra AnnotationEntry");
         }
-		clg.removeField(f);
-		clg.addField(fg.getField());
-		f = clg.getFields()[1]; // there are two fields in the class, removing
-								// and readding has changed the order
-		// so this time index [1] is the 'int i' field
-		if (dbg) {
+        clg.removeField(f);
+        clg.addField(fg.getField());
+        f = clg.getFields()[1]; // there are two fields in the class, removing
+                                // and readding has changed the order
+        // so this time index [1] is the 'int i' field
+        if (dbg) {
             System.err.println("Field now looks like this: " + f);
         }
-		if (dbg) {
+        if (dbg) {
             System.err.println("With AnnotationEntrys: "
-					+ dumpAnnotationEntries(f.getAnnotationEntries()));
+                    + dumpAnnotationEntries(f.getAnnotationEntries()));
         }
-		assertTrue("Should be 2 AnnotationEntrys on this field, but there are "
-				+ f.getAnnotationEntries().length, f.getAnnotationEntries().length == 2);
-	}
-
-	// helper methods
-	public void checkAnnotatedField(JavaClass clazz, String fieldname,
-			String AnnotationEntryName, String AnnotationEntryElementName,
-			String AnnotationEntryElementValue)
-	{
-		Field[] fields = clazz.getFields();
-		for (Field f : fields) {
-			AnnotationEntry[] fieldAnnotationEntrys = f.getAnnotationEntries();
-			if (f.getName().equals(fieldname))
-			{
-				checkAnnotationEntry(fieldAnnotationEntrys[0], AnnotationEntryName,
-						AnnotationEntryElementName, AnnotationEntryElementValue);
-			}
-		}
-	}
-
-	private void checkAnnotationEntry(AnnotationEntry a, String name, String elementname,
-			String elementvalue)
-	{
-		assertTrue("Expected AnnotationEntry to have name " + name
-				+ " but it had name " + a.getAnnotationType(), a.getAnnotationType()
-				.equals(name));
-		assertTrue("Expected AnnotationEntry to have one element but it had "
-				+ a.getElementValuePairs().length, a.getElementValuePairs().length == 1);
-		ElementValuePair envp = a.getElementValuePairs()[0];
-		assertTrue("Expected element name " + elementname + " but was "
-				+ envp.getNameString(), elementname
-				.equals(envp.getNameString()));
-		assertTrue("Expected element value " + elementvalue + " but was "
-				+ envp.getValue().stringifyValue(), elementvalue.equals(envp
-				.getValue().stringifyValue()));
-	}
-
-	// helper methods
-	public void checkValue(AnnotationEntry a, String name, String tostring)
-	{
-		for (int i = 0; i < a.getElementValuePairs().length; i++)
-		{
-			ElementValuePair element = a.getElementValuePairs()[i];
-			if (element.getNameString().equals(name))
-			{
-				if (!element.getValue().stringifyValue().equals(tostring))
-				{
-					fail("Expected element " + name + " to have value "
-							+ tostring + " but it had value "
-							+ element.getValue().stringifyValue());
-				}
-				return;
-			}
-		}
-		fail("Didnt find named element " + name);
-	}
+        assertTrue("Should be 2 AnnotationEntrys on this field, but there are "
+                + f.getAnnotationEntries().length, f.getAnnotationEntries().length == 2);
+    }
+
+    // helper methods
+    public void checkAnnotatedField(JavaClass clazz, String fieldname,
+            String AnnotationEntryName, String AnnotationEntryElementName,
+            String AnnotationEntryElementValue)
+    {
+        Field[] fields = clazz.getFields();
+        for (Field f : fields) {
+            AnnotationEntry[] fieldAnnotationEntrys = f.getAnnotationEntries();
+            if (f.getName().equals(fieldname))
+            {
+                checkAnnotationEntry(fieldAnnotationEntrys[0], AnnotationEntryName,
+                        AnnotationEntryElementName, AnnotationEntryElementValue);
+            }
+        }
+    }
+
+    private void checkAnnotationEntry(AnnotationEntry a, String name, String elementname,
+            String elementvalue)
+    {
+        assertTrue("Expected AnnotationEntry to have name " + name
+                + " but it had name " + a.getAnnotationType(), a.getAnnotationType()
+                .equals(name));
+        assertTrue("Expected AnnotationEntry to have one element but it had "
+                + a.getElementValuePairs().length, a.getElementValuePairs().length == 1);
+        ElementValuePair envp = a.getElementValuePairs()[0];
+        assertTrue("Expected element name " + elementname + " but was "
+                + envp.getNameString(), elementname
+                .equals(envp.getNameString()));
+        assertTrue("Expected element value " + elementvalue + " but was "
+                + envp.getValue().stringifyValue(), elementvalue.equals(envp
+                .getValue().stringifyValue()));
+    }
+
+    // helper methods
+    public void checkValue(AnnotationEntry a, String name, String tostring)
+    {
+        for (int i = 0; i < a.getElementValuePairs().length; i++)
+        {
+            ElementValuePair element = a.getElementValuePairs()[i];
+            if (element.getNameString().equals(name))
+            {
+                if (!element.getValue().stringifyValue().equals(tostring))
+                {
+                    fail("Expected element " + name + " to have value "
+                            + tostring + " but it had value "
+                            + element.getValue().stringifyValue());
+                }
+                return;
+            }
+        }
+        fail("Didnt find named element " + name);
+    }
 }

Modified: commons/proper/bcel/trunk/src/test/java/org/apache/bcel/InstructionFinderTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/test/java/org/apache/bcel/InstructionFinderTestCase.java?rev=1598766&r1=1598765&r2=1598766&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/test/java/org/apache/bcel/InstructionFinderTestCase.java (original)
+++ commons/proper/bcel/trunk/src/test/java/org/apache/bcel/InstructionFinderTestCase.java Fri May 30 22:51:27 2014
@@ -28,36 +28,36 @@ import org.apache.bcel.util.InstructionF
 
 public class InstructionFinderTestCase extends AbstractTestCase
 {
-	public void testSearchAll() throws Exception
-	{
-		JavaClass clazz = getTestClass("org.apache.bcel.util.InstructionFinder");
-		Method[] methods = clazz.getMethods();
-		Method searchM = null;
-		for (Method m : methods)
-		{
-			if (m.getName().equals("search") && (m.getArgumentTypes().length == 3))
-			{
-				searchM = m;
-				break;
-			}
-		}
-		
-		if (searchM == null) {
+    public void testSearchAll() throws Exception
+    {
+        JavaClass clazz = getTestClass("org.apache.bcel.util.InstructionFinder");
+        Method[] methods = clazz.getMethods();
+        Method searchM = null;
+        for (Method m : methods)
+        {
+            if (m.getName().equals("search") && (m.getArgumentTypes().length == 3))
+            {
+                searchM = m;
+                break;
+            }
+        }
+
+        if (searchM == null) {
             throw new Exception("search method not found");
         }
-		
-		byte[] bytes = searchM.getCode().getCode();
-		InstructionList il = new InstructionList(bytes);
-		InstructionFinder finder = new InstructionFinder(il);
-		Iterator<?> it = finder.search(".*", il.getStart(), null);
-		
-		InstructionHandle[] ihs = (InstructionHandle[])it.next();
-		int size = 0;
-		for (InstructionHandle ih : ihs)
-		{
-			size += ih.getInstruction().getLength();
-		}
-		assertEquals(bytes.length, size);
-		
-	}
+
+        byte[] bytes = searchM.getCode().getCode();
+        InstructionList il = new InstructionList(bytes);
+        InstructionFinder finder = new InstructionFinder(il);
+        Iterator<?> it = finder.search(".*", il.getStart(), null);
+
+        InstructionHandle[] ihs = (InstructionHandle[])it.next();
+        int size = 0;
+        for (InstructionHandle ih : ihs)
+        {
+            size += ih.getInstruction().getLength();
+        }
+        assertEquals(bytes.length, size);
+
+    }
 }

Modified: commons/proper/bcel/trunk/src/test/java/org/apache/bcel/NanoTimer.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/test/java/org/apache/bcel/NanoTimer.java?rev=1598766&r1=1598765&r2=1598766&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/test/java/org/apache/bcel/NanoTimer.java (original)
+++ commons/proper/bcel/trunk/src/test/java/org/apache/bcel/NanoTimer.java Fri May 30 22:51:27 2014
@@ -20,32 +20,32 @@ package org.apache.bcel;
 
 public class NanoTimer {
 
-	private long time = 0;
+    private long time = 0;
 
-	public NanoTimer start() {
-		time -= System.nanoTime();
-		return this;
-	}
-
-	public void stop() {
-		time += System.nanoTime();
-	}
-
-	public void subtract(NanoTimer o) {
-		time -= o.time;
-	}
-
-	public void reset() {
-		time = 0;
-	}
-
-	/**
-	 * May ony be called after stop has been called as many times as start.
-	 */
-	@Override
+    public NanoTimer start() {
+        time -= System.nanoTime();
+        return this;
+    }
+
+    public void stop() {
+        time += System.nanoTime();
+    }
+
+    public void subtract(NanoTimer o) {
+        time -= o.time;
+    }
+
+    public void reset() {
+        time = 0;
+    }
+
+    /**
+     * May ony be called after stop has been called as many times as start.
+     */
+    @Override
     public String toString() {
-		return ((double) (time) / 1000000000) + " s";
-	}
+        return ((double) (time) / 1000000000) + " s";
+    }
 
 
 

Modified: commons/proper/bcel/trunk/src/test/java/org/apache/bcel/PerformanceTest.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/test/java/org/apache/bcel/PerformanceTest.java?rev=1598766&r1=1598765&r2=1598766&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/test/java/org/apache/bcel/PerformanceTest.java (original)
+++ commons/proper/bcel/trunk/src/test/java/org/apache/bcel/PerformanceTest.java Fri May 30 22:51:27 2014
@@ -36,100 +36,100 @@ import org.apache.bcel.generic.MethodGen
 
 public final class PerformanceTest extends TestCase {
 
-	private static byte[] read(final InputStream is) throws IOException {
-		if (is == null) {
-			throw new IOException("Class not found");
-		}
-		byte[] b = new byte[is.available()];
-		int len = 0;
-		while (true) {
-			int n = is.read(b, len, b.length - len);
-			if (n == -1) {
-				if (len < b.length) {
-					byte[] c = new byte[len];
-					System.arraycopy(b, 0, c, 0, len);
-					b = c;
-				}
-				return b;
-			}
-			len += n;
-			if (len == b.length) {
-				byte[] c = new byte[b.length + 1000];
-				System.arraycopy(b, 0, c, 0, len);
-				b = c;
-			}
-		}
-	}
-	
-	private static void test(int fraction) throws IOException {
-		NanoTimer total = new NanoTimer();
-		NanoTimer parseTime = new NanoTimer();
-		NanoTimer cgenTime = new NanoTimer();
-		NanoTimer mgenTime = new NanoTimer();
-		NanoTimer mserTime = new NanoTimer();
-		NanoTimer serTime = new NanoTimer();
+    private static byte[] read(final InputStream is) throws IOException {
+        if (is == null) {
+            throw new IOException("Class not found");
+        }
+        byte[] b = new byte[is.available()];
+        int len = 0;
+        while (true) {
+            int n = is.read(b, len, b.length - len);
+            if (n == -1) {
+                if (len < b.length) {
+                    byte[] c = new byte[len];
+                    System.arraycopy(b, 0, c, 0, len);
+                    b = c;
+                }
+                return b;
+            }
+            len += n;
+            if (len == b.length) {
+                byte[] c = new byte[b.length + 1000];
+                System.arraycopy(b, 0, c, 0, len);
+                b = c;
+            }
+        }
+    }
+
+    private static void test(int fraction) throws IOException {
+        NanoTimer total = new NanoTimer();
+        NanoTimer parseTime = new NanoTimer();
+        NanoTimer cgenTime = new NanoTimer();
+        NanoTimer mgenTime = new NanoTimer();
+        NanoTimer mserTime = new NanoTimer();
+        NanoTimer serTime = new NanoTimer();
 
-		total.start();
+        total.start();
 
-		String javaHome = System.getProperty("java.home");
+        String javaHome = System.getProperty("java.home");
 
         JarFile jar = new JarFile(javaHome + "/lib/dt.jar");
-		Enumeration<?> en = jar.entries();
-		int i = 0;
+        Enumeration<?> en = jar.entries();
+        int i = 0;
+
+        while (en.hasMoreElements()) {
+            JarEntry e = (JarEntry) en.nextElement();
+            if (e.getName().endsWith(".class") && i++ % fraction == 0) {
+                InputStream in = jar.getInputStream(e);
+                byte[] bytes = read(in);
+
+                parseTime.start();
+                JavaClass clazz = new ClassParser(new ByteArrayInputStream(bytes), e.getName())
+                        .parse();
+                parseTime.stop();
+
+                cgenTime.start();
+                ClassGen cg = new ClassGen(clazz);
+                cgenTime.stop();
+
+                Method[] methods = cg.getMethods();
+                for (Method m : methods) {
+                    mgenTime.start();
+                    MethodGen mg = new MethodGen(m, cg.getClassName(), cg.getConstantPool());
+                    InstructionList il = mg.getInstructionList();
+                    mgenTime.stop();
+
+                    mserTime.start();
+                    if (il != null) {
+                        mg.getInstructionList().setPositions();
+                        mg.setMaxLocals();
+                        mg.setMaxStack();
+                    }
+                    cg.replaceMethod(m, mg.getMethod());
+                    mserTime.stop();
+                }
+
+                serTime.start();
+                cg.getJavaClass().getBytes();
+                serTime.stop();
+            }
+        }
+
+        jar.close();
+        total.stop();
+        System.out.println("ClassParser.parse: " + parseTime);
+        System.out.println("ClassGen.init: " + cgenTime);
+        System.out.println("MethodGen.init: " + mgenTime);
+        System.out.println("MethodGen.getMethod: " + mserTime);
+        System.out.println("ClassGen.getJavaClass.getBytes: " + serTime);
+        System.out.println("Total: " + total);
+        System.out.println();
+    }
+
+    public void testPerformance() throws IOException {
+        test(1);
+        test(1);
+        test(1);        
+    }
 
-		while (en.hasMoreElements()) {
-			JarEntry e = (JarEntry) en.nextElement();
-			if (e.getName().endsWith(".class") && i++ % fraction == 0) {
-				InputStream in = jar.getInputStream(e);
-				byte[] bytes = read(in);
-
-				parseTime.start();
-				JavaClass clazz = new ClassParser(new ByteArrayInputStream(bytes), e.getName())
-						.parse();
-				parseTime.stop();
-
-				cgenTime.start();
-				ClassGen cg = new ClassGen(clazz);
-				cgenTime.stop();
-
-				Method[] methods = cg.getMethods();
-				for (Method m : methods) {
-					mgenTime.start();
-					MethodGen mg = new MethodGen(m, cg.getClassName(), cg.getConstantPool());
-					InstructionList il = mg.getInstructionList();
-					mgenTime.stop();
-
-					mserTime.start();
-					if (il != null) {
-						mg.getInstructionList().setPositions();
-						mg.setMaxLocals();
-						mg.setMaxStack();
-					}
-					cg.replaceMethod(m, mg.getMethod());
-					mserTime.stop();
-				}
-
-				serTime.start();
-				cg.getJavaClass().getBytes();
-				serTime.stop();
-			}
-		}
-
-		jar.close();
-		total.stop();
-		System.out.println("ClassParser.parse: " + parseTime);
-		System.out.println("ClassGen.init: " + cgenTime);
-		System.out.println("MethodGen.init: " + mgenTime);
-		System.out.println("MethodGen.getMethod: " + mserTime);
-		System.out.println("ClassGen.getJavaClass.getBytes: " + serTime);
-		System.out.println("Total: " + total);
-		System.out.println();
-	}
-
-	public void testPerformance() throws IOException {
-		test(1);
-		test(1);
-		test(1);		
-	}
-	
 }

Modified: commons/proper/bcel/trunk/src/test/java/org/apache/bcel/data/SimpleClass.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/test/java/org/apache/bcel/data/SimpleClass.java?rev=1598766&r1=1598765&r2=1598766&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/test/java/org/apache/bcel/data/SimpleClass.java (original)
+++ commons/proper/bcel/trunk/src/test/java/org/apache/bcel/data/SimpleClass.java Fri May 30 22:51:27 2014
@@ -20,8 +20,8 @@ package org.apache.bcel.data;
 
 public class SimpleClass
 {
-	public static void main(String[] argv)
-	{
-		// Nothing unusual in this class
-	}
+    public static void main(String[] argv)
+    {
+        // Nothing unusual in this class
+    }
 }

Modified: commons/proper/bcel/trunk/src/test/java/org/apache/bcel/util/InstructionFinderTest.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/test/java/org/apache/bcel/util/InstructionFinderTest.java?rev=1598766&r1=1598765&r2=1598766&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/test/java/org/apache/bcel/util/InstructionFinderTest.java (original)
+++ commons/proper/bcel/trunk/src/test/java/org/apache/bcel/util/InstructionFinderTest.java Fri May 30 22:51:27 2014
@@ -29,18 +29,18 @@ import org.apache.bcel.generic.Instructi
 
 public class InstructionFinderTest extends AbstractTestCase {
 
-	public void testSearch() {
-		InstructionList il = new InstructionList();
-		il.append(new ILOAD(1));
-		il.append(new ILOAD(2));
-		il.append(new IADD());
-		il.append(new ISTORE(3));
-		InstructionFinder finder = new InstructionFinder(il);
-		
-		Iterator<?> it = finder.search("ILOAD IADD", il.getInstructionHandles()[0], null );
-		InstructionHandle[] ihs = (InstructionHandle[])it.next();
-		assertEquals(2, ihs.length);
-		assertEquals(ihs[0].getInstruction(), new ILOAD(2));
-		assertEquals(ihs[1].getInstruction(), new IADD());
-	}
+    public void testSearch() {
+        InstructionList il = new InstructionList();
+        il.append(new ILOAD(1));
+        il.append(new ILOAD(2));
+        il.append(new IADD());
+        il.append(new ISTORE(3));
+        InstructionFinder finder = new InstructionFinder(il);
+
+        Iterator<?> it = finder.search("ILOAD IADD", il.getInstructionHandles()[0], null );
+        InstructionHandle[] ihs = (InstructionHandle[])it.next();
+        assertEquals(2, ihs.length);
+        assertEquals(ihs[0].getInstruction(), new ILOAD(2));
+        assertEquals(ihs[1].getInstruction(), new IADD());
+    }
 }

Modified: commons/proper/bcel/trunk/src/test/java/org/apache/bcel/verifier/VerifierTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/test/java/org/apache/bcel/verifier/VerifierTestCase.java?rev=1598766&r1=1598765&r2=1598766&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/test/java/org/apache/bcel/verifier/VerifierTestCase.java (original)
+++ commons/proper/bcel/trunk/src/test/java/org/apache/bcel/verifier/VerifierTestCase.java Fri May 30 22:51:27 2014
@@ -26,14 +26,14 @@ public class VerifierTestCase extends Te
 
     public void testDefaultMethodValidation() {
         String classname = Collection.class.getName();
-        
+
         Verifier verifier = VerifierFactory.getVerifier(classname);
         VerificationResult result = verifier.doPass1();
 
         assertEquals("Pass 1 verification of " + classname + " failed: " + result.getMessage(), VerificationResult.VERIFIED_OK, result.getStatus());
-        
+
         result = verifier.doPass2();
-        
+
         assertEquals("Pass 2 verification of " + classname + " failed: " + result.getMessage(), VerificationResult.VERIFIED_OK, result.getStatus());
     }
 }

Modified: commons/proper/bcel/trunk/src/test/java/org/apache/bcel/visitors/CounterVisitor.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/test/java/org/apache/bcel/visitors/CounterVisitor.java?rev=1598766&r1=1598765&r2=1598766&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/test/java/org/apache/bcel/visitors/CounterVisitor.java (original)
+++ commons/proper/bcel/trunk/src/test/java/org/apache/bcel/visitors/CounterVisitor.java Fri May 30 22:51:27 2014
@@ -64,290 +64,290 @@ import org.apache.bcel.classfile.Visitor
 
 public class CounterVisitor implements Visitor
 {
-	public int unknownCount = 0;
+    public int unknownCount = 0;
 
-	public int syntheticCount = 0;
+    public int syntheticCount = 0;
 
-	public int stackMapEntryCount = 0;
+    public int stackMapEntryCount = 0;
 
-	public int stackMapCount = 0;
+    public int stackMapCount = 0;
 
-	public int sourceFileCount = 0;
+    public int sourceFileCount = 0;
 
-	public int signatureAnnotationCount = 0;
+    public int signatureAnnotationCount = 0;
 
-	public int parameterAnnotationCount = 0;
+    public int parameterAnnotationCount = 0;
 
-	public int methodCount = 0;
+    public int methodCount = 0;
 
-	public int localVariableTypeTableCount = 0;
+    public int localVariableTypeTableCount = 0;
 
-	public int localVariableTableCount = 0;
+    public int localVariableTableCount = 0;
 
-	public int localVariableCount = 0;
+    public int localVariableCount = 0;
 
-	public int lineNumberTableCount = 0;
+    public int lineNumberTableCount = 0;
 
-	public int lineNumberCount = 0;
+    public int lineNumberCount = 0;
 
-	public int javaClassCount = 0;
+    public int javaClassCount = 0;
 
-	public int innerClassesCount = 0;
+    public int innerClassesCount = 0;
 
-	public int innerClassCount = 0;
+    public int innerClassCount = 0;
 
-	public int fieldCount = 0;
+    public int fieldCount = 0;
 
-	public int exceptionTableCount = 0;
+    public int exceptionTableCount = 0;
 
-	public int enclosingMethodCount = 0;
+    public int enclosingMethodCount = 0;
 
-	public int deprecatedCount = 0;
+    public int deprecatedCount = 0;
 
-	public int constantValueCount = 0;
+    public int constantValueCount = 0;
 
-	public int constantUtf8Count = 0;
+    public int constantUtf8Count = 0;
 
-	public int constantStringCount = 0;
+    public int constantStringCount = 0;
 
-	public int constantNameAndTypeCount = 0;
+    public int constantNameAndTypeCount = 0;
 
-	public int constantPoolCount = 0;
+    public int constantPoolCount = 0;
 
-	public int constantMethodrefCount = 0;
+    public int constantMethodrefCount = 0;
 
-	public int constantLongCount = 0;
+    public int constantLongCount = 0;
 
-	public int constantIntegerCount = 0;
+    public int constantIntegerCount = 0;
 
-	public int constantInterfaceMethodrefCount = 0;
+    public int constantInterfaceMethodrefCount = 0;
 
-	public int constantFloatCount = 0;
+    public int constantFloatCount = 0;
 
-	public int constantFieldrefCount = 0;
+    public int constantFieldrefCount = 0;
 
-	public int constantClassCount = 0;
+    public int constantClassCount = 0;
 
-	public int constantDoubleCount = 0;
+    public int constantDoubleCount = 0;
 
-	public int codeExceptionCount = 0;
+    public int codeExceptionCount = 0;
 
-	public int codeCount = 0;
+    public int codeCount = 0;
 
-	public int annotationEntryCount = 0;
+    public int annotationEntryCount = 0;
 
-	public int annotationDefaultCount = 0;
+    public int annotationDefaultCount = 0;
 
-	public int annotationCount = 0;
+    public int annotationCount = 0;
 
-	public int stackMapTableCount = 0;
+    public int stackMapTableCount = 0;
 
-	public int stackMapTableEntryCount = 0;
+    public int stackMapTableEntryCount = 0;
 
-	public int bootstrapMethodsCount = 0;
+    public int bootstrapMethodsCount = 0;
 
     public int methodParametersCount = 0;
-	
 
-	public void visitAnnotation(Annotations obj)
-	{
-		annotationCount++;
-	}
-
-	public void visitAnnotationDefault(AnnotationDefault obj)
-	{
-		annotationDefaultCount++;
-	}
-
-	public void visitAnnotationEntry(AnnotationEntry obj)
-	{
-		annotationEntryCount++;
-	}
-
-	public void visitCode(Code obj)
-	{
-		codeCount++;
-	}
-
-	public void visitCodeException(CodeException obj)
-	{
-		codeExceptionCount++;
-	}
-
-	public void visitConstantClass(ConstantClass obj)
-	{
-		constantClassCount++;
-	}
-
-	public void visitConstantDouble(ConstantDouble obj)
-	{
-		constantDoubleCount++;
-	}
-
-	public void visitConstantFieldref(ConstantFieldref obj)
-	{
-		constantFieldrefCount++;
-	}
-
-	public void visitConstantFloat(ConstantFloat obj)
-	{
-		constantFloatCount++;
-	}
-
-	public void visitConstantInteger(ConstantInteger obj)
-	{
-		constantIntegerCount++;
-	}
-
-	public void visitConstantInterfaceMethodref(ConstantInterfaceMethodref obj)
-	{
-		constantInterfaceMethodrefCount++;
-	}
-
-	public void visitConstantLong(ConstantLong obj)
-	{
-		constantLongCount++;
-	}
-
-	public void visitConstantMethodref(ConstantMethodref obj)
-	{
-		constantMethodrefCount++;
-	}
-
-	public void visitConstantNameAndType(ConstantNameAndType obj)
-	{
-		constantNameAndTypeCount++;
-	}
-
-	public void visitConstantPool(ConstantPool obj)
-	{
-		constantPoolCount++;
-	}
-
-	public void visitConstantString(ConstantString obj)
-	{
-		constantStringCount++;
-	}
-
-	public void visitConstantUtf8(ConstantUtf8 obj)
-	{
-		constantUtf8Count++;
-	}
-
-	public void visitConstantValue(ConstantValue obj)
-	{
-		constantValueCount++;
-	}
-
-	public void visitDeprecated(Deprecated obj)
-	{
-		deprecatedCount++;
-	}
-
-	public void visitEnclosingMethod(EnclosingMethod obj)
-	{
-		enclosingMethodCount++;
-	}
-
-	public void visitExceptionTable(ExceptionTable obj)
-	{
-		exceptionTableCount++;
-	}
-
-	public void visitField(Field obj)
-	{
-		fieldCount++;
-	}
-
-	public void visitInnerClass(InnerClass obj)
-	{
-		innerClassCount++;
-	}
-
-	public void visitInnerClasses(InnerClasses obj)
-	{
-		innerClassesCount++;
-	}
-
-	public void visitJavaClass(JavaClass obj)
-	{
-		javaClassCount++;
-	}
-
-	public void visitLineNumber(LineNumber obj)
-	{
-		lineNumberCount++;
-	}
-
-	public void visitLineNumberTable(LineNumberTable obj)
-	{
-		lineNumberTableCount++;
-	}
-
-	public void visitLocalVariable(LocalVariable obj)
-	{
-		localVariableCount++;
-	}
-
-	public void visitLocalVariableTable(LocalVariableTable obj)
-	{
-		localVariableTableCount++;
-	}
-
-	public void visitLocalVariableTypeTable(LocalVariableTypeTable obj)
-	{
-		localVariableTypeTableCount++;
-	}
-
-	public void visitMethod(Method obj)
-	{
-		methodCount++;
-	}
-
-	public void visitParameterAnnotation(ParameterAnnotations obj)
-	{
-		parameterAnnotationCount++;
-	}
-
-	public void visitSignature(Signature obj)
-	{
-		signatureAnnotationCount++;
-	}
-
-	public void visitSourceFile(SourceFile obj)
-	{
-		sourceFileCount++;
-	}
-
-	public void visitStackMap(StackMap obj)
-	{
-		stackMapCount++;
-	}
-
-	public void visitStackMapEntry(StackMapEntry obj)
-	{
-		stackMapEntryCount++;
-	}
-
-	public void visitSynthetic(Synthetic obj)
-	{
-		syntheticCount++;
-	}
-
-	public void visitUnknown(Unknown obj)
-	{
-		unknownCount++;
-	}
-
-	public void visitStackMapTable(StackMapTable obj)
+
+    public void visitAnnotation(Annotations obj)
+    {
+        annotationCount++;
+    }
+
+    public void visitAnnotationDefault(AnnotationDefault obj)
+    {
+        annotationDefaultCount++;
+    }
+
+    public void visitAnnotationEntry(AnnotationEntry obj)
+    {
+        annotationEntryCount++;
+    }
+
+    public void visitCode(Code obj)
+    {
+        codeCount++;
+    }
+
+    public void visitCodeException(CodeException obj)
+    {
+        codeExceptionCount++;
+    }
+
+    public void visitConstantClass(ConstantClass obj)
+    {
+        constantClassCount++;
+    }
+
+    public void visitConstantDouble(ConstantDouble obj)
     {
-		stackMapTableCount++;
-	}
+        constantDoubleCount++;
+    }
+
+    public void visitConstantFieldref(ConstantFieldref obj)
+    {
+        constantFieldrefCount++;
+    }
+
+    public void visitConstantFloat(ConstantFloat obj)
+    {
+        constantFloatCount++;
+    }
+
+    public void visitConstantInteger(ConstantInteger obj)
+    {
+        constantIntegerCount++;
+    }
+
+    public void visitConstantInterfaceMethodref(ConstantInterfaceMethodref obj)
+    {
+        constantInterfaceMethodrefCount++;
+    }
+
+    public void visitConstantLong(ConstantLong obj)
+    {
+        constantLongCount++;
+    }
+
+    public void visitConstantMethodref(ConstantMethodref obj)
+    {
+        constantMethodrefCount++;
+    }
+
+    public void visitConstantNameAndType(ConstantNameAndType obj)
+    {
+        constantNameAndTypeCount++;
+    }
+
+    public void visitConstantPool(ConstantPool obj)
+    {
+        constantPoolCount++;
+    }
+
+    public void visitConstantString(ConstantString obj)
+    {
+        constantStringCount++;
+    }
+
+    public void visitConstantUtf8(ConstantUtf8 obj)
+    {
+        constantUtf8Count++;
+    }
+
+    public void visitConstantValue(ConstantValue obj)
+    {
+        constantValueCount++;
+    }
+
+    public void visitDeprecated(Deprecated obj)
+    {
+        deprecatedCount++;
+    }
+
+    public void visitEnclosingMethod(EnclosingMethod obj)
+    {
+        enclosingMethodCount++;
+    }
 
-	public void visitStackMapTableEntry(StackMapTableEntry obj)
+    public void visitExceptionTable(ExceptionTable obj)
     {
-		stackMapTableEntryCount++;
-	}
+        exceptionTableCount++;
+    }
+
+    public void visitField(Field obj)
+    {
+        fieldCount++;
+    }
+
+    public void visitInnerClass(InnerClass obj)
+    {
+        innerClassCount++;
+    }
+
+    public void visitInnerClasses(InnerClasses obj)
+    {
+        innerClassesCount++;
+    }
+
+    public void visitJavaClass(JavaClass obj)
+    {
+        javaClassCount++;
+    }
+
+    public void visitLineNumber(LineNumber obj)
+    {
+        lineNumberCount++;
+    }
+
+    public void visitLineNumberTable(LineNumberTable obj)
+    {
+        lineNumberTableCount++;
+    }
+
+    public void visitLocalVariable(LocalVariable obj)
+    {
+        localVariableCount++;
+    }
+
+    public void visitLocalVariableTable(LocalVariableTable obj)
+    {
+        localVariableTableCount++;
+    }
+
+    public void visitLocalVariableTypeTable(LocalVariableTypeTable obj)
+    {
+        localVariableTypeTableCount++;
+    }
+
+    public void visitMethod(Method obj)
+    {
+        methodCount++;
+    }
+
+    public void visitParameterAnnotation(ParameterAnnotations obj)
+    {
+        parameterAnnotationCount++;
+    }
+
+    public void visitSignature(Signature obj)
+    {
+        signatureAnnotationCount++;
+    }
+
+    public void visitSourceFile(SourceFile obj)
+    {
+        sourceFileCount++;
+    }
+
+    public void visitStackMap(StackMap obj)
+    {
+        stackMapCount++;
+    }
+
+    public void visitStackMapEntry(StackMapEntry obj)
+    {
+        stackMapEntryCount++;
+    }
+
+    public void visitSynthetic(Synthetic obj)
+    {
+        syntheticCount++;
+    }
+
+    public void visitUnknown(Unknown obj)
+    {
+        unknownCount++;
+    }
+
+    public void visitStackMapTable(StackMapTable obj)
+    {
+        stackMapTableCount++;
+    }
+
+    public void visitStackMapTableEntry(StackMapTableEntry obj)
+    {
+        stackMapTableEntryCount++;
+    }
 
     public void visitBootstrapMethods(BootstrapMethods obj)
     {