commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1598766 [1/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/ap...
Date Fri, 30 May 2014 22:51:30 GMT
Author: sebb
Date: Fri May 30 22:51:27 2014
New Revision: 1598766

URL: http://svn.apache.org/r1598766
Log:
Tab police

Modified:
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/Constants.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/ArrayElementValue.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/Attribute.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/ClassElementValue.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/ClassFormatException.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/ClassParser.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/DescendingVisitor.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/ElementValue.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/ElementValuePair.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/EmptyVisitor.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/EnclosingMethod.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/EnumElementValue.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/FieldOrMethod.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/JavaClass.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/LocalVariableTypeTable.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/MethodParameter.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/MethodParameters.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/ParameterAnnotations.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/RuntimeInvisibleAnnotations.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/RuntimeVisibleAnnotations.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/SimpleElementValue.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/StackMapTableEntry.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/Utility.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/Visitor.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/generic/AnnotationElementValueGen.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/generic/AnnotationEntryGen.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/generic/ArrayElementValueGen.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/generic/ClassElementValueGen.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/generic/ClassGen.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/generic/ClassGenException.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/generic/ConstantPoolGen.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/generic/ElementValueGen.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/generic/ElementValuePairGen.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/generic/EmptyVisitor.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/generic/EnumElementValueGen.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/generic/FieldGen.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/generic/FieldGenOrMethodGen.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/generic/FieldInstruction.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/generic/INVOKEDYNAMIC.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/generic/Instruction.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/generic/InstructionFactory.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/generic/InstructionList.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/generic/InvokeInstruction.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/generic/JsrInstruction.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/generic/LDC.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/generic/MethodGen.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/generic/NameSignatureInstruction.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/generic/SimpleElementValueGen.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/generic/TargetLostException.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/generic/Type.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/generic/VisitorSupportsInvokeDynamic.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/util/Class2HTML.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/util/ClassPath.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/util/InstructionFinder.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/util/SyntheticRepository.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/verifier/exc/AssertionViolatedException.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/verifier/exc/ClassConstraintException.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/verifier/exc/CodeConstraintException.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/verifier/exc/InvalidMethodException.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/verifier/exc/LoadingException.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/verifier/exc/LocalVariableInfoInconsistentException.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/verifier/exc/StaticCodeConstraintException.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/verifier/exc/StaticCodeInstructionConstraintException.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/verifier/exc/StaticCodeInstructionOperandConstraintException.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/verifier/exc/StructuralCodeConstraintException.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/verifier/exc/Utility.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/verifier/exc/VerificationException.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/verifier/exc/VerifierConstraintViolatedException.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/verifier/statics/DOUBLE_Upper.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/verifier/statics/IntList.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/verifier/statics/LONG_Upper.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/verifier/statics/LocalVariableInfo.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/verifier/statics/LocalVariablesInfo.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/verifier/statics/Pass1Verifier.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/verifier/statics/Pass2Verifier.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/verifier/statics/Pass3aVerifier.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/verifier/structurals/ControlFlowGraph.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/verifier/structurals/ExceptionHandler.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/verifier/structurals/ExceptionHandlers.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/verifier/structurals/ExecutionVisitor.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/verifier/structurals/Frame.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/verifier/structurals/GenericArray.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/verifier/structurals/InstConstraintVisitor.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/verifier/structurals/InstructionContext.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/verifier/structurals/LocalVariables.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/verifier/structurals/OperandStack.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/verifier/structurals/Pass3bVerifier.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/verifier/structurals/Subroutine.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/verifier/structurals/Subroutines.java
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/verifier/structurals/UninitializedObjectType.java
    commons/proper/bcel/trunk/src/test/java/org/apache/bcel/AbstractCounterVisitorTestCase.java
    commons/proper/bcel/trunk/src/test/java/org/apache/bcel/AbstractTestCase.java
    commons/proper/bcel/trunk/src/test/java/org/apache/bcel/AnnotationAccessFlagTestCase.java
    commons/proper/bcel/trunk/src/test/java/org/apache/bcel/AnnotationDefaultAttributeTestCase.java
    commons/proper/bcel/trunk/src/test/java/org/apache/bcel/AnnotationGenTestCase.java
    commons/proper/bcel/trunk/src/test/java/org/apache/bcel/AnonymousClassTestCase.java
    commons/proper/bcel/trunk/src/test/java/org/apache/bcel/CounterVisitorTestCase.java
    commons/proper/bcel/trunk/src/test/java/org/apache/bcel/ElementValueGenTestCase.java
    commons/proper/bcel/trunk/src/test/java/org/apache/bcel/EnclosingMethodAttributeTestCase.java
    commons/proper/bcel/trunk/src/test/java/org/apache/bcel/EnumAccessFlagTestCase.java
    commons/proper/bcel/trunk/src/test/java/org/apache/bcel/FieldAnnotationsTestCase.java
    commons/proper/bcel/trunk/src/test/java/org/apache/bcel/InstructionFinderTestCase.java
    commons/proper/bcel/trunk/src/test/java/org/apache/bcel/NanoTimer.java
    commons/proper/bcel/trunk/src/test/java/org/apache/bcel/PerformanceTest.java
    commons/proper/bcel/trunk/src/test/java/org/apache/bcel/data/SimpleClass.java
    commons/proper/bcel/trunk/src/test/java/org/apache/bcel/util/InstructionFinderTest.java
    commons/proper/bcel/trunk/src/test/java/org/apache/bcel/verifier/VerifierTestCase.java
    commons/proper/bcel/trunk/src/test/java/org/apache/bcel/visitors/CounterVisitor.java

Modified: commons/proper/bcel/trunk/src/main/java/org/apache/bcel/Constants.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/bcel/Constants.java?rev=1598766&r1=1598765&r2=1598766&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/bcel/Constants.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/bcel/Constants.java Fri May 30 22:51:27 2014
@@ -1423,26 +1423,26 @@ public interface Constants {
 
   /** Attributes and their corresponding names.
    */
-  public static final byte ATTR_UNKNOWN                       			= -1;
-  public static final byte ATTR_SOURCE_FILE                   			= 0;
-  public static final byte ATTR_CONSTANT_VALUE                			= 1;
-  public static final byte ATTR_CODE                          			= 2;
-  public static final byte ATTR_EXCEPTIONS                    			= 3;
-  public static final byte ATTR_LINE_NUMBER_TABLE             			= 4;
-  public static final byte ATTR_LOCAL_VARIABLE_TABLE          			= 5;
-  public static final byte ATTR_INNER_CLASSES                 			= 6;
-  public static final byte ATTR_SYNTHETIC                     			= 7;
-  public static final byte ATTR_DEPRECATED                    			= 8;
-  public static final byte ATTR_PMG                           			= 9;
-  public static final byte ATTR_SIGNATURE                     			= 10;
-  public static final byte ATTR_STACK_MAP                     			= 11;
-  public static final byte ATTR_RUNTIME_VISIBLE_ANNOTATIONS    			= 12;
+  public static final byte ATTR_UNKNOWN                                 = -1;
+  public static final byte ATTR_SOURCE_FILE                             = 0;
+  public static final byte ATTR_CONSTANT_VALUE                          = 1;
+  public static final byte ATTR_CODE                                    = 2;
+  public static final byte ATTR_EXCEPTIONS                              = 3;
+  public static final byte ATTR_LINE_NUMBER_TABLE                       = 4;
+  public static final byte ATTR_LOCAL_VARIABLE_TABLE                    = 5;
+  public static final byte ATTR_INNER_CLASSES                           = 6;
+  public static final byte ATTR_SYNTHETIC                               = 7;
+  public static final byte ATTR_DEPRECATED                              = 8;
+  public static final byte ATTR_PMG                                     = 9;
+  public static final byte ATTR_SIGNATURE                               = 10;
+  public static final byte ATTR_STACK_MAP                               = 11;
+  public static final byte ATTR_RUNTIME_VISIBLE_ANNOTATIONS             = 12;
   public static final byte ATTR_RUNTIME_INVISIBLE_ANNOTATIONS           = 13;
-  public static final byte ATTR_RUNTIME_VISIBLE_PARAMETER_ANNOTATIONS 	= 14;
+  public static final byte ATTR_RUNTIME_VISIBLE_PARAMETER_ANNOTATIONS   = 14;
   public static final byte ATTR_RUNTIME_INVISIBLE_PARAMETER_ANNOTATIONS = 15;
   public static final byte ATTR_ANNOTATION_DEFAULT                      = 16;
   public static final byte ATTR_LOCAL_VARIABLE_TYPE_TABLE               = 17;
-  public static final byte ATTR_ENCLOSING_METHOD                      	= 18;
+  public static final byte ATTR_ENCLOSING_METHOD                        = 18;
   public static final byte ATTR_STACK_MAP_TABLE                         = 19;
   public static final byte ATTR_BOOTSTRAP_METHODS                       = 20;
   public static final byte ATTR_METHOD_PARAMETERS                       = 21;

Modified: commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/ArrayElementValue.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/ArrayElementValue.java?rev=1598766&r1=1598765&r2=1598766&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/ArrayElementValue.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/ArrayElementValue.java Fri May 30 22:51:27 2014
@@ -22,68 +22,68 @@ import java.io.IOException;
 
 public class ArrayElementValue extends ElementValue
 {
-	// For array types, this is the array
-	private ElementValue[] evalues;
+    // For array types, this is the array
+    private ElementValue[] evalues;
 
-	@Override
+    @Override
     public String toString()
-	{
-	    StringBuilder sb = new StringBuilder();
-		sb.append("{");
-		for (int i = 0; i < evalues.length; i++)
-		{
-			sb.append(evalues[i].toString());
-			if ((i + 1) < evalues.length) {
+    {
+        StringBuilder sb = new StringBuilder();
+        sb.append("{");
+        for (int i = 0; i < evalues.length; i++)
+        {
+            sb.append(evalues[i].toString());
+            if ((i + 1) < evalues.length) {
                 sb.append(",");
             }
-		}
-		sb.append("}");
-		return sb.toString();
-	}
-
-	public ArrayElementValue(int type, ElementValue[] datums, ConstantPool cpool)
-	{
-		super(type, cpool);
-		if (type != ARRAY) {
+        }
+        sb.append("}");
+        return sb.toString();
+    }
+
+    public ArrayElementValue(int type, ElementValue[] datums, ConstantPool cpool)
+    {
+        super(type, cpool);
+        if (type != ARRAY) {
             throw new RuntimeException(
-					"Only element values of type array can be built with this ctor - type specified: " + type);
+                    "Only element values of type array can be built with this ctor - type specified: " + type);
         }
-		this.evalues = datums;
-	}
+        this.evalues = datums;
+    }
 
-	@Override
+    @Override
     public void dump(DataOutputStream dos) throws IOException
-	{
-		dos.writeByte(type); // u1 type of value (ARRAY == '[')
-		dos.writeShort(evalues.length);
-		for (ElementValue evalue : evalues) {
-			evalue.dump(dos);
-		}
-	}
+    {
+        dos.writeByte(type); // u1 type of value (ARRAY == '[')
+        dos.writeShort(evalues.length);
+        for (ElementValue evalue : evalues) {
+            evalue.dump(dos);
+        }
+    }
 
-	@Override
+    @Override
     public String stringifyValue()
-	{
-	    StringBuilder sb = new StringBuilder();
-		sb.append("[");
-		for (int i = 0; i < evalues.length; i++)
-		{
-			sb.append(evalues[i].stringifyValue());
-			if ((i + 1) < evalues.length) {
+    {
+        StringBuilder sb = new StringBuilder();
+        sb.append("[");
+        for (int i = 0; i < evalues.length; i++)
+        {
+            sb.append(evalues[i].stringifyValue());
+            if ((i + 1) < evalues.length) {
                 sb.append(",");
             }
-		}
-		sb.append("]");
-		return sb.toString();
-	}
-
-	public ElementValue[] getElementValuesArray()
-	{
-		return evalues;
-	}
-
-	public int getElementValuesArraySize()
-	{
-		return evalues.length;
-	}
+        }
+        sb.append("]");
+        return sb.toString();
+    }
+
+    public ElementValue[] getElementValuesArray()
+    {
+        return evalues;
+    }
+
+    public int getElementValuesArraySize()
+    {
+        return evalues.length;
+    }
 }

Modified: commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/Attribute.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/Attribute.java?rev=1598766&r1=1598765&r2=1598766&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/Attribute.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/Attribute.java Fri May 30 22:51:27 2014
@@ -50,283 +50,283 @@ import org.apache.bcel.classfile.Constan
  */
 public abstract class Attribute implements Cloneable, Node, Serializable
 {
-	private static final long serialVersionUID = -1707826820310002955L;
+    private static final long serialVersionUID = -1707826820310002955L;
 
     protected int name_index; // Points to attribute name in constant pool
 
-	protected int length; // Content length of attribute field
+    protected int length; // Content length of attribute field
 
-	protected byte tag; // Tag to distiguish subclasses
+    protected byte tag; // Tag to distiguish subclasses
 
-	protected ConstantPool constant_pool;
+    protected ConstantPool constant_pool;
 
-	protected Attribute(byte tag, int name_index, int length,
-			ConstantPool constant_pool)
-	{
-		this.tag = tag;
-		this.name_index = name_index;
-		this.length = length;
-		this.constant_pool = constant_pool;
-	}
-
-	/**
-	 * Called by objects that are traversing the nodes of the tree implicitely
-	 * defined by the contents of a Java class. I.e., the hierarchy of methods,
-	 * fields, attributes, etc. spawns a tree of objects.
-	 * 
-	 * @param v
-	 *            Visitor object
-	 */
-	public abstract void accept(Visitor v);
-
-	/**
-	 * Dump attribute to file stream in binary format.
-	 * 
-	 * @param file
-	 *            Output file stream
-	 * @throws IOException
-	 */
-	public void dump(DataOutputStream file) throws IOException
-	{
-		file.writeShort(name_index);
-		file.writeInt(length);
-	}
-
-	private static final Map<String, AttributeReader> readers = new HashMap<String, AttributeReader>();
-
-	/**
-	 * Add an Attribute reader capable of parsing (user-defined) attributes
-	 * named "name". You should not add readers for the standard attributes such
-	 * as "LineNumberTable", because those are handled internally.
-	 * 
-	 * @param name
-	 *            the name of the attribute as stored in the class file
-	 * @param r
-	 *            the reader object
-	 */
-	public static void addAttributeReader(String name, AttributeReader r)
-	{
-		readers.put(name, r);
-	}
-
-	/**
-	 * Remove attribute reader
-	 * 
-	 * @param name
-	 *            the name of the attribute as stored in the class file
-	 */
-	public static void removeAttributeReader(String name)
-	{
-		readers.remove(name);
-	}
-
-	/*
-	 * Class method reads one attribute from the input data stream. This method
-	 * must not be accessible from the outside. It is called by the Field and
-	 * Method constructor methods.
-	 * 
-	 * @see Field
-	 * @see Method @param file Input stream @param constant_pool Array of
-	 *      constants @return Attribute @throws IOException @throws
-	 *      ClassFormatException
-	 */
-	public static Attribute readAttribute(DataInputStream file,
-			ConstantPool constant_pool) throws IOException,
-			ClassFormatException
-	{
-		ConstantUtf8 c;
-		String name;
-		int name_index;
-		int length;
-		byte tag = Constants.ATTR_UNKNOWN; // Unknown attribute
-		// Get class name from constant pool via `name_index' indirection
-		name_index = file.readUnsignedShort();
-		c = (ConstantUtf8) constant_pool.getConstant(name_index,
-				Constants.CONSTANT_Utf8);
-		name = c.getBytes();
-		// Length of data in bytes
-		length = file.readInt();
-		// Compare strings to find known attribute
-		// System.out.println(name);
-		for (byte i = 0; i < Constants.KNOWN_ATTRIBUTES; i++)
-		{
-			if (name.equals(Constants.ATTRIBUTE_NAMES[i]))
-			{
-				tag = i; // found!
-				break;
-			}
-		}
-		// Call proper constructor, depending on `tag'
-		switch (tag)
-		{
-		case Constants.ATTR_UNKNOWN:
-			AttributeReader r = readers.get(name);
-			if (r != null)
-			{
-				return r.createAttribute(name_index, length, file,
-						constant_pool);
-			}
-			return new Unknown(name_index, length, file, constant_pool);
-		case Constants.ATTR_CONSTANT_VALUE:
-			return new ConstantValue(name_index, length, file, constant_pool);
-		case Constants.ATTR_SOURCE_FILE:
-			return new SourceFile(name_index, length, file, constant_pool);
-		case Constants.ATTR_CODE:
-			return new Code(name_index, length, file, constant_pool);
-		case Constants.ATTR_EXCEPTIONS:
-			return new ExceptionTable(name_index, length, file, constant_pool);
-		case Constants.ATTR_LINE_NUMBER_TABLE:
-			return new LineNumberTable(name_index, length, file, constant_pool);
-		case Constants.ATTR_LOCAL_VARIABLE_TABLE:
-			return new LocalVariableTable(name_index, length, file,
-					constant_pool);
-		case Constants.ATTR_INNER_CLASSES:
-			return new InnerClasses(name_index, length, file, constant_pool);
-		case Constants.ATTR_SYNTHETIC:
-			return new Synthetic(name_index, length, file, constant_pool);
-		case Constants.ATTR_DEPRECATED:
-			return new Deprecated(name_index, length, file, constant_pool);
-		case Constants.ATTR_PMG:
-			return new PMGClass(name_index, length, file, constant_pool);
-		case Constants.ATTR_SIGNATURE:
-			return new Signature(name_index, length, file, constant_pool);
-		case Constants.ATTR_STACK_MAP:
-			return new StackMap(name_index, length, file, constant_pool);
-		case Constants.ATTR_RUNTIME_VISIBLE_ANNOTATIONS:
-			return new RuntimeVisibleAnnotations(name_index, length, file,
-					constant_pool);
-		case Constants.ATTR_RUNTIME_INVISIBLE_ANNOTATIONS:
-			return new RuntimeInvisibleAnnotations(name_index, length, file,
-					constant_pool);
-		case Constants.ATTR_RUNTIME_VISIBLE_PARAMETER_ANNOTATIONS:
-			return new RuntimeVisibleParameterAnnotations(name_index, length,
-					file, constant_pool);
-		case Constants.ATTR_RUNTIME_INVISIBLE_PARAMETER_ANNOTATIONS:
-			return new RuntimeInvisibleParameterAnnotations(name_index, length,
-					file, constant_pool);
-		case Constants.ATTR_ANNOTATION_DEFAULT:
-			return new AnnotationDefault(name_index, length, file,
-					constant_pool);
-		case Constants.ATTR_LOCAL_VARIABLE_TYPE_TABLE:
-			return new LocalVariableTypeTable(name_index, length, file,
-					constant_pool);
-		case Constants.ATTR_ENCLOSING_METHOD:
-			return new EnclosingMethod(name_index, length, file, constant_pool);
-		case Constants.ATTR_STACK_MAP_TABLE:
-			return new StackMapTable(name_index, length, file, constant_pool);
-		case Constants.ATTR_BOOTSTRAP_METHODS:
-			return new BootstrapMethods(name_index, length, file, constant_pool);
+    protected Attribute(byte tag, int name_index, int length,
+            ConstantPool constant_pool)
+    {
+        this.tag = tag;
+        this.name_index = name_index;
+        this.length = length;
+        this.constant_pool = constant_pool;
+    }
+
+    /**
+     * Called by objects that are traversing the nodes of the tree implicitely
+     * defined by the contents of a Java class. I.e., the hierarchy of methods,
+     * fields, attributes, etc. spawns a tree of objects.
+     * 
+     * @param v
+     *            Visitor object
+     */
+    public abstract void accept(Visitor v);
+
+    /**
+     * Dump attribute to file stream in binary format.
+     * 
+     * @param file
+     *            Output file stream
+     * @throws IOException
+     */
+    public void dump(DataOutputStream file) throws IOException
+    {
+        file.writeShort(name_index);
+        file.writeInt(length);
+    }
+
+    private static final Map<String, AttributeReader> readers = new HashMap<String, AttributeReader>();
+
+    /**
+     * Add an Attribute reader capable of parsing (user-defined) attributes
+     * named "name". You should not add readers for the standard attributes such
+     * as "LineNumberTable", because those are handled internally.
+     * 
+     * @param name
+     *            the name of the attribute as stored in the class file
+     * @param r
+     *            the reader object
+     */
+    public static void addAttributeReader(String name, AttributeReader r)
+    {
+        readers.put(name, r);
+    }
+
+    /**
+     * Remove attribute reader
+     * 
+     * @param name
+     *            the name of the attribute as stored in the class file
+     */
+    public static void removeAttributeReader(String name)
+    {
+        readers.remove(name);
+    }
+
+    /*
+     * Class method reads one attribute from the input data stream. This method
+     * must not be accessible from the outside. It is called by the Field and
+     * Method constructor methods.
+     * 
+     * @see Field
+     * @see Method @param file Input stream @param constant_pool Array of
+     *      constants @return Attribute @throws IOException @throws
+     *      ClassFormatException
+     */
+    public static Attribute readAttribute(DataInputStream file,
+            ConstantPool constant_pool) throws IOException,
+            ClassFormatException
+    {
+        ConstantUtf8 c;
+        String name;
+        int name_index;
+        int length;
+        byte tag = Constants.ATTR_UNKNOWN; // Unknown attribute
+        // Get class name from constant pool via `name_index' indirection
+        name_index = file.readUnsignedShort();
+        c = (ConstantUtf8) constant_pool.getConstant(name_index,
+                Constants.CONSTANT_Utf8);
+        name = c.getBytes();
+        // Length of data in bytes
+        length = file.readInt();
+        // Compare strings to find known attribute
+        // System.out.println(name);
+        for (byte i = 0; i < Constants.KNOWN_ATTRIBUTES; i++)
+        {
+            if (name.equals(Constants.ATTRIBUTE_NAMES[i]))
+            {
+                tag = i; // found!
+                break;
+            }
+        }
+        // Call proper constructor, depending on `tag'
+        switch (tag)
+        {
+        case Constants.ATTR_UNKNOWN:
+            AttributeReader r = readers.get(name);
+            if (r != null)
+            {
+                return r.createAttribute(name_index, length, file,
+                        constant_pool);
+            }
+            return new Unknown(name_index, length, file, constant_pool);
+        case Constants.ATTR_CONSTANT_VALUE:
+            return new ConstantValue(name_index, length, file, constant_pool);
+        case Constants.ATTR_SOURCE_FILE:
+            return new SourceFile(name_index, length, file, constant_pool);
+        case Constants.ATTR_CODE:
+            return new Code(name_index, length, file, constant_pool);
+        case Constants.ATTR_EXCEPTIONS:
+            return new ExceptionTable(name_index, length, file, constant_pool);
+        case Constants.ATTR_LINE_NUMBER_TABLE:
+            return new LineNumberTable(name_index, length, file, constant_pool);
+        case Constants.ATTR_LOCAL_VARIABLE_TABLE:
+            return new LocalVariableTable(name_index, length, file,
+                    constant_pool);
+        case Constants.ATTR_INNER_CLASSES:
+            return new InnerClasses(name_index, length, file, constant_pool);
+        case Constants.ATTR_SYNTHETIC:
+            return new Synthetic(name_index, length, file, constant_pool);
+        case Constants.ATTR_DEPRECATED:
+            return new Deprecated(name_index, length, file, constant_pool);
+        case Constants.ATTR_PMG:
+            return new PMGClass(name_index, length, file, constant_pool);
+        case Constants.ATTR_SIGNATURE:
+            return new Signature(name_index, length, file, constant_pool);
+        case Constants.ATTR_STACK_MAP:
+            return new StackMap(name_index, length, file, constant_pool);
+        case Constants.ATTR_RUNTIME_VISIBLE_ANNOTATIONS:
+            return new RuntimeVisibleAnnotations(name_index, length, file,
+                    constant_pool);
+        case Constants.ATTR_RUNTIME_INVISIBLE_ANNOTATIONS:
+            return new RuntimeInvisibleAnnotations(name_index, length, file,
+                    constant_pool);
+        case Constants.ATTR_RUNTIME_VISIBLE_PARAMETER_ANNOTATIONS:
+            return new RuntimeVisibleParameterAnnotations(name_index, length,
+                    file, constant_pool);
+        case Constants.ATTR_RUNTIME_INVISIBLE_PARAMETER_ANNOTATIONS:
+            return new RuntimeInvisibleParameterAnnotations(name_index, length,
+                    file, constant_pool);
+        case Constants.ATTR_ANNOTATION_DEFAULT:
+            return new AnnotationDefault(name_index, length, file,
+                    constant_pool);
+        case Constants.ATTR_LOCAL_VARIABLE_TYPE_TABLE:
+            return new LocalVariableTypeTable(name_index, length, file,
+                    constant_pool);
+        case Constants.ATTR_ENCLOSING_METHOD:
+            return new EnclosingMethod(name_index, length, file, constant_pool);
+        case Constants.ATTR_STACK_MAP_TABLE:
+            return new StackMapTable(name_index, length, file, constant_pool);
+        case Constants.ATTR_BOOTSTRAP_METHODS:
+            return new BootstrapMethods(name_index, length, file, constant_pool);
         case Constants.ATTR_METHOD_PARAMETERS:
                 return new MethodParameters(name_index, length, file, constant_pool);
-		default: // Never reached
-			throw new IllegalStateException("Unrecognized attribute type tag parsed: " + tag);
-		}
-	}
-
-	/**
-	 * @return Name of attribute
-	 */
-	public String getName()
-	{
-		ConstantUtf8 c = (ConstantUtf8) constant_pool.getConstant(name_index,
-				Constants.CONSTANT_Utf8);
-		return c.getBytes();
-	}
-
-	/**
-	 * @return Length of attribute field in bytes.
-	 */
-	public final int getLength()
-	{
-		return length;
-	}
-
-	/**
-	 * @param length
-	 *            length in bytes.
-	 */
-	public final void setLength(int length)
-	{
-		this.length = length;
-	}
-
-	/**
-	 * @param name_index
-	 *            of attribute.
-	 */
-	public final void setNameIndex(int name_index)
-	{
-		this.name_index = name_index;
-	}
-
-	/**
-	 * @return Name index in constant pool of attribute name.
-	 */
-	public final int getNameIndex()
-	{
-		return name_index;
-	}
-
-	/**
-	 * @return Tag of attribute, i.e., its type. Value may not be altered, thus
-	 *         there is no setTag() method.
-	 */
-	public final byte getTag()
-	{
-		return tag;
-	}
-
-	/**
-	 * @return Constant pool used by this object.
-	 * @see ConstantPool
-	 */
-	public final ConstantPool getConstantPool()
-	{
-		return constant_pool;
-	}
-
-	/**
-	 * @param constant_pool
-	 *            Constant pool to be used for this object.
-	 * @see ConstantPool
-	 */
-	public final void setConstantPool(ConstantPool constant_pool)
-	{
-		this.constant_pool = constant_pool;
-	}
-
-	/**
-	 * Use copy() if you want to have a deep copy(), i.e., with all references
-	 * copied correctly.
-	 * 
-	 * @return shallow copy of this attribute
-	 */
-	@Override
+        default: // Never reached
+            throw new IllegalStateException("Unrecognized attribute type tag parsed: " + tag);
+        }
+    }
+
+    /**
+     * @return Name of attribute
+     */
+    public String getName()
+    {
+        ConstantUtf8 c = (ConstantUtf8) constant_pool.getConstant(name_index,
+                Constants.CONSTANT_Utf8);
+        return c.getBytes();
+    }
+
+    /**
+     * @return Length of attribute field in bytes.
+     */
+    public final int getLength()
+    {
+        return length;
+    }
+
+    /**
+     * @param length
+     *            length in bytes.
+     */
+    public final void setLength(int length)
+    {
+        this.length = length;
+    }
+
+    /**
+     * @param name_index
+     *            of attribute.
+     */
+    public final void setNameIndex(int name_index)
+    {
+        this.name_index = name_index;
+    }
+
+    /**
+     * @return Name index in constant pool of attribute name.
+     */
+    public final int getNameIndex()
+    {
+        return name_index;
+    }
+
+    /**
+     * @return Tag of attribute, i.e., its type. Value may not be altered, thus
+     *         there is no setTag() method.
+     */
+    public final byte getTag()
+    {
+        return tag;
+    }
+
+    /**
+     * @return Constant pool used by this object.
+     * @see ConstantPool
+     */
+    public final ConstantPool getConstantPool()
+    {
+        return constant_pool;
+    }
+
+    /**
+     * @param constant_pool
+     *            Constant pool to be used for this object.
+     * @see ConstantPool
+     */
+    public final void setConstantPool(ConstantPool constant_pool)
+    {
+        this.constant_pool = constant_pool;
+    }
+
+    /**
+     * Use copy() if you want to have a deep copy(), i.e., with all references
+     * copied correctly.
+     * 
+     * @return shallow copy of this attribute
+     */
+    @Override
     public Object clone()
-	{
-		Attribute attr = null;
-		try
-		{
-		    attr = (Attribute) super.clone();
-		}
-		catch (CloneNotSupportedException e)
-		{
-			throw new Error("Clone Not Supported"); // never happens
-		}
-		return attr;
-	}
-
-	/**
-	 * @return deep copy of this attribute
-	 */
-	public abstract Attribute copy(ConstantPool _constant_pool);
-
-	/**
-	 * @return attribute name.
-	 */
-	@Override
+    {
+        Attribute attr = null;
+        try
+        {
+            attr = (Attribute) super.clone();
+        }
+        catch (CloneNotSupportedException e)
+        {
+            throw new Error("Clone Not Supported"); // never happens
+        }
+        return attr;
+    }
+
+    /**
+     * @return deep copy of this attribute
+     */
+    public abstract Attribute copy(ConstantPool _constant_pool);
+
+    /**
+     * @return attribute name.
+     */
+    @Override
     public String toString()
-	{
-		return Constants.ATTRIBUTE_NAMES[tag];
-	}
+    {
+        return Constants.ATTRIBUTE_NAMES[tag];
+    }
 }

Modified: commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/ClassElementValue.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/ClassElementValue.java?rev=1598766&r1=1598765&r2=1598766&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/ClassElementValue.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/ClassElementValue.java Fri May 30 22:51:27 2014
@@ -23,41 +23,41 @@ import org.apache.bcel.Constants;
 
 public class ClassElementValue extends ElementValue
 {
-	// For primitive types and string type, this points to the value entry in
-	// the cpool
-	// For 'class' this points to the class entry in the cpool
-	private int idx;
-
-	public ClassElementValue(int type, int idx, ConstantPool cpool)
-	{
-		super(type, cpool);
-		this.idx = idx;
-	}
-
-	public int getIndex()
-	{
-		return idx;
-	}
-
-	public String getClassString()
-	{
-		ConstantUtf8 c = (ConstantUtf8) cpool.getConstant(idx,
-				Constants.CONSTANT_Utf8);
-		return c.getBytes();
-	}
+    // For primitive types and string type, this points to the value entry in
+    // the cpool
+    // For 'class' this points to the class entry in the cpool
+    private int idx;
+
+    public ClassElementValue(int type, int idx, ConstantPool cpool)
+    {
+        super(type, cpool);
+        this.idx = idx;
+    }
+
+    public int getIndex()
+    {
+        return idx;
+    }
+
+    public String getClassString()
+    {
+        ConstantUtf8 c = (ConstantUtf8) cpool.getConstant(idx,
+                Constants.CONSTANT_Utf8);
+        return c.getBytes();
+    }
 
-	@Override
+    @Override
     public String stringifyValue()
-	{
-		ConstantUtf8 cu8 = (ConstantUtf8) cpool.getConstant(idx,
-				Constants.CONSTANT_Utf8);
-		return cu8.getBytes();
-	}
+    {
+        ConstantUtf8 cu8 = (ConstantUtf8) cpool.getConstant(idx,
+                Constants.CONSTANT_Utf8);
+        return cu8.getBytes();
+    }
 
-	@Override
+    @Override
     public void dump(DataOutputStream dos) throws IOException
-	{
-		dos.writeByte(type); // u1 kind of value
-		dos.writeShort(idx);
-	}
+    {
+        dos.writeByte(type); // u1 kind of value
+        dos.writeShort(idx);
+    }
 }

Modified: commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/ClassFormatException.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/ClassFormatException.java?rev=1598766&r1=1598765&r2=1598766&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/ClassFormatException.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/ClassFormatException.java Fri May 30 22:51:27 2014
@@ -37,8 +37,8 @@ public class ClassFormatException extend
     public ClassFormatException(String s) {
         super(s);
     }
-    
+
     public ClassFormatException(String s, Throwable initCause) {
-    	super(s, initCause);
+        super(s, initCause);
     }
 }

Modified: commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/ClassParser.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/ClassParser.java?rev=1598766&r1=1598765&r2=1598766&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/ClassParser.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/ClassParser.java Fri May 30 22:51:27 2014
@@ -121,11 +121,11 @@ public final class ClassParser {
                 if (is_zip) {
                     zip = new ZipFile(zip_file);
                     ZipEntry entry = zip.getEntry(file_name);
-                    
+
                     if (entry == null) {
                         throw new IOException("File " + file_name + " not found");
                     }
-                    
+
                     file = new DataInputStream(new BufferedInputStream(zip.getInputStream(entry),
                             BUFSIZE));
                 } else {

Modified: commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/DescendingVisitor.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/DescendingVisitor.java?rev=1598766&r1=1598765&r2=1598766&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/DescendingVisitor.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/DescendingVisitor.java Fri May 30 22:51:27 2014
@@ -29,407 +29,407 @@ import java.util.Stack;
  */
 public class DescendingVisitor implements Visitor
 {
-	private JavaClass clazz;
+    private JavaClass clazz;
 
-	private Visitor visitor;
+    private Visitor visitor;
 
-	private Stack<Object> stack = new Stack<Object>();
+    private Stack<Object> stack = new Stack<Object>();
 
-	/**
-	 * @return container of current entitity, i.e., predecessor during traversal
-	 */
-	public Object predecessor()
-	{
-		return predecessor(0);
-	}
-
-	/**
-	 * @param level
-	 *            nesting level, i.e., 0 returns the direct predecessor
-	 * @return container of current entitity, i.e., predecessor during traversal
-	 */
-	public Object predecessor(int level)
-	{
-		int size = stack.size();
-		if ((size < 2) || (level < 0))
-		{
-			return null;
-		}
-		else
-		{
-			return stack.elementAt(size - (level + 2)); // size - 1 == current
-		}
-	}
-
-	/**
-	 * @return current object
-	 */
-	public Object current()
-	{
-		return stack.peek();
-	}
-
-	/**
-	 * @param clazz
-	 *            Class to traverse
-	 * @param visitor
-	 *            visitor object to apply to all components
-	 */
-	public DescendingVisitor(JavaClass clazz, Visitor visitor)
-	{
-		this.clazz = clazz;
-		this.visitor = visitor;
-	}
-
-	/**
-	 * Start traversal.
-	 */
-	public void visit()
-	{
-		clazz.accept(this);
-	}
-
-	public void visitJavaClass(JavaClass _clazz)
-	{
-		stack.push(_clazz);
-		_clazz.accept(visitor);
-		Field[] fields = _clazz.getFields();
-		for (Field field : fields) {
-			field.accept(this);
-		}
-		Method[] methods = _clazz.getMethods();
-		for (Method method : methods) {
-			method.accept(this);
-		}
-		Attribute[] attributes = _clazz.getAttributes();
-		for (Attribute attribute : attributes) {
-			attribute.accept(this);
-		}
-		_clazz.getConstantPool().accept(this);
-		stack.pop();
-	}
-
-	public void visitAnnotation(Annotations annotation)
-	{
-		stack.push(annotation);
-		annotation.accept(visitor);
-		AnnotationEntry[] entries = annotation.getAnnotationEntries();
-		for (AnnotationEntry entrie : entries) {
-			entrie.accept(this);
-		}
-		stack.pop();
-	}
-
-	public void visitAnnotationEntry(AnnotationEntry annotationEntry)
-	{
-		stack.push(annotationEntry);
-		annotationEntry.accept(visitor);
-		stack.pop();
-	}
-
-	public void visitField(Field field)
-	{
-		stack.push(field);
-		field.accept(visitor);
-		Attribute[] attributes = field.getAttributes();
-		for (Attribute attribute : attributes) {
-			attribute.accept(this);
-		}
-		stack.pop();
-	}
-
-	public void visitConstantValue(ConstantValue cv)
-	{
-		stack.push(cv);
-		cv.accept(visitor);
-		stack.pop();
-	}
-
-	public void visitMethod(Method method)
-	{
-		stack.push(method);
-		method.accept(visitor);
-		Attribute[] attributes = method.getAttributes();
-		for (Attribute attribute : attributes) {
-			attribute.accept(this);
-		}
-		stack.pop();
-	}
-
-	public void visitExceptionTable(ExceptionTable table)
-	{
-		stack.push(table);
-		table.accept(visitor);
-		stack.pop();
-	}
-
-	public void visitCode(Code code)
-	{
-		stack.push(code);
-		code.accept(visitor);
-		CodeException[] table = code.getExceptionTable();
-		for (CodeException element : table) {
-			element.accept(this);
-		}
-		Attribute[] attributes = code.getAttributes();
-		for (Attribute attribute : attributes) {
-			attribute.accept(this);
-		}
-		stack.pop();
-	}
-
-	public void visitCodeException(CodeException ce)
-	{
-		stack.push(ce);
-		ce.accept(visitor);
-		stack.pop();
-	}
-
-	public void visitLineNumberTable(LineNumberTable table)
-	{
-		stack.push(table);
-		table.accept(visitor);
-		LineNumber[] numbers = table.getLineNumberTable();
-		for (LineNumber number : numbers) {
-			number.accept(this);
-		}
-		stack.pop();
-	}
-
-	public void visitLineNumber(LineNumber number)
-	{
-		stack.push(number);
-		number.accept(visitor);
-		stack.pop();
-	}
-
-	public void visitLocalVariableTable(LocalVariableTable table)
-	{
-		stack.push(table);
-		table.accept(visitor);
-		LocalVariable[] vars = table.getLocalVariableTable();
-		for (LocalVariable var : vars) {
-			var.accept(this);
-		}
-		stack.pop();
-	}
-
-	public void visitStackMap(StackMap table)
-	{
-		stack.push(table);
-		table.accept(visitor);
-		StackMapEntry[] vars = table.getStackMap();
-		for (StackMapEntry var : vars) {
-			var.accept(this);
-		}
-		stack.pop();
-	}
-
-	public void visitStackMapEntry(StackMapEntry var)
-	{
-		stack.push(var);
-		var.accept(visitor);
-		stack.pop();
-	}
-
-	public void visitStackMapTable(StackMapTable table)
-	{
-		stack.push(table);
-		table.accept(visitor);
-		StackMapTableEntry[] vars = table.getStackMapTable();
-		for (StackMapTableEntry var : vars) {
-			var.accept(this);
-		}
-		stack.pop();
-	}
-
-	public void visitStackMapTableEntry(StackMapTableEntry var)
-	{
-		stack.push(var);
-		var.accept(visitor);
-		stack.pop();
-	}
-
-	public void visitLocalVariable(LocalVariable var)
-	{
-		stack.push(var);
-		var.accept(visitor);
-		stack.pop();
-	}
-
-	public void visitConstantPool(ConstantPool cp)
-	{
-		stack.push(cp);
-		cp.accept(visitor);
-		Constant[] constants = cp.getConstantPool();
-		for (int i = 1; i < constants.length; i++)
-		{
-			if (constants[i] != null)
-			{
-				constants[i].accept(this);
-			}
-		}
-		stack.pop();
-	}
-
-	public void visitConstantClass(ConstantClass constant)
-	{
-		stack.push(constant);
-		constant.accept(visitor);
-		stack.pop();
-	}
-
-	public void visitConstantDouble(ConstantDouble constant)
-	{
-		stack.push(constant);
-		constant.accept(visitor);
-		stack.pop();
-	}
-
-	public void visitConstantFieldref(ConstantFieldref constant)
-	{
-		stack.push(constant);
-		constant.accept(visitor);
-		stack.pop();
-	}
-
-	public void visitConstantFloat(ConstantFloat constant)
-	{
-		stack.push(constant);
-		constant.accept(visitor);
-		stack.pop();
-	}
-
-	public void visitConstantInteger(ConstantInteger constant)
-	{
-		stack.push(constant);
-		constant.accept(visitor);
-		stack.pop();
-	}
-
-	public void visitConstantInterfaceMethodref(
-			ConstantInterfaceMethodref constant)
-	{
-		stack.push(constant);
-		constant.accept(visitor);
-		stack.pop();
-	}
-
-	public void visitConstantLong(ConstantLong constant)
-	{
-		stack.push(constant);
-		constant.accept(visitor);
-		stack.pop();
-	}
-
-	public void visitConstantMethodref(ConstantMethodref constant)
-	{
-		stack.push(constant);
-		constant.accept(visitor);
-		stack.pop();
-	}
-
-	public void visitConstantNameAndType(ConstantNameAndType constant)
-	{
-		stack.push(constant);
-		constant.accept(visitor);
-		stack.pop();
-	}
-
-	public void visitConstantString(ConstantString constant)
-	{
-		stack.push(constant);
-		constant.accept(visitor);
-		stack.pop();
-	}
-
-	public void visitConstantUtf8(ConstantUtf8 constant)
-	{
-		stack.push(constant);
-		constant.accept(visitor);
-		stack.pop();
-	}
-
-	public void visitInnerClasses(InnerClasses ic)
-	{
-		stack.push(ic);
-		ic.accept(visitor);
-		InnerClass[] ics = ic.getInnerClasses();
-		for (InnerClass ic2 : ics) {
-			ic2.accept(this);
-		}
-		stack.pop();
-	}
-
-	public void visitInnerClass(InnerClass inner)
-	{
-		stack.push(inner);
-		inner.accept(visitor);
-		stack.pop();
-	}
-
-	public void visitDeprecated(Deprecated attribute)
-	{
-		stack.push(attribute);
-		attribute.accept(visitor);
-		stack.pop();
-	}
-
-	public void visitSignature(Signature attribute)
-	{
-		stack.push(attribute);
-		attribute.accept(visitor);
-		stack.pop();
-	}
-
-	public void visitSourceFile(SourceFile attribute)
-	{
-		stack.push(attribute);
-		attribute.accept(visitor);
-		stack.pop();
-	}
-
-	public void visitSynthetic(Synthetic attribute)
-	{
-		stack.push(attribute);
-		attribute.accept(visitor);
-		stack.pop();
-	}
-
-	public void visitUnknown(Unknown attribute)
-	{
-		stack.push(attribute);
-		attribute.accept(visitor);
-		stack.pop();
-	}
-
-	public void visitAnnotationDefault(AnnotationDefault obj)
-	{
-		stack.push(obj);
-		obj.accept(visitor);
-		stack.pop();
-	}
-
-	public void visitEnclosingMethod(EnclosingMethod obj)
-	{
-		stack.push(obj);
-		obj.accept(visitor);
-		stack.pop();
-	}
-
-	public void visitLocalVariableTypeTable(LocalVariableTypeTable obj)
-	{
-		stack.push(obj);
-		obj.accept(visitor);
-		stack.pop();
-	}
-
-	public void visitParameterAnnotation(ParameterAnnotations obj)
-	{
-		stack.push(obj);
-		obj.accept(visitor);
-		stack.pop();
-	}
+    /**
+     * @return container of current entitity, i.e., predecessor during traversal
+     */
+    public Object predecessor()
+    {
+        return predecessor(0);
+    }
+
+    /**
+     * @param level
+     *            nesting level, i.e., 0 returns the direct predecessor
+     * @return container of current entitity, i.e., predecessor during traversal
+     */
+    public Object predecessor(int level)
+    {
+        int size = stack.size();
+        if ((size < 2) || (level < 0))
+        {
+            return null;
+        }
+        else
+        {
+            return stack.elementAt(size - (level + 2)); // size - 1 == current
+        }
+    }
+
+    /**
+     * @return current object
+     */
+    public Object current()
+    {
+        return stack.peek();
+    }
+
+    /**
+     * @param clazz
+     *            Class to traverse
+     * @param visitor
+     *            visitor object to apply to all components
+     */
+    public DescendingVisitor(JavaClass clazz, Visitor visitor)
+    {
+        this.clazz = clazz;
+        this.visitor = visitor;
+    }
+
+    /**
+     * Start traversal.
+     */
+    public void visit()
+    {
+        clazz.accept(this);
+    }
+
+    public void visitJavaClass(JavaClass _clazz)
+    {
+        stack.push(_clazz);
+        _clazz.accept(visitor);
+        Field[] fields = _clazz.getFields();
+        for (Field field : fields) {
+            field.accept(this);
+        }
+        Method[] methods = _clazz.getMethods();
+        for (Method method : methods) {
+            method.accept(this);
+        }
+        Attribute[] attributes = _clazz.getAttributes();
+        for (Attribute attribute : attributes) {
+            attribute.accept(this);
+        }
+        _clazz.getConstantPool().accept(this);
+        stack.pop();
+    }
+
+    public void visitAnnotation(Annotations annotation)
+    {
+        stack.push(annotation);
+        annotation.accept(visitor);
+        AnnotationEntry[] entries = annotation.getAnnotationEntries();
+        for (AnnotationEntry entrie : entries) {
+            entrie.accept(this);
+        }
+        stack.pop();
+    }
+
+    public void visitAnnotationEntry(AnnotationEntry annotationEntry)
+    {
+        stack.push(annotationEntry);
+        annotationEntry.accept(visitor);
+        stack.pop();
+    }
+
+    public void visitField(Field field)
+    {
+        stack.push(field);
+        field.accept(visitor);
+        Attribute[] attributes = field.getAttributes();
+        for (Attribute attribute : attributes) {
+            attribute.accept(this);
+        }
+        stack.pop();
+    }
+
+    public void visitConstantValue(ConstantValue cv)
+    {
+        stack.push(cv);
+        cv.accept(visitor);
+        stack.pop();
+    }
+
+    public void visitMethod(Method method)
+    {
+        stack.push(method);
+        method.accept(visitor);
+        Attribute[] attributes = method.getAttributes();
+        for (Attribute attribute : attributes) {
+            attribute.accept(this);
+        }
+        stack.pop();
+    }
+
+    public void visitExceptionTable(ExceptionTable table)
+    {
+        stack.push(table);
+        table.accept(visitor);
+        stack.pop();
+    }
+
+    public void visitCode(Code code)
+    {
+        stack.push(code);
+        code.accept(visitor);
+        CodeException[] table = code.getExceptionTable();
+        for (CodeException element : table) {
+            element.accept(this);
+        }
+        Attribute[] attributes = code.getAttributes();
+        for (Attribute attribute : attributes) {
+            attribute.accept(this);
+        }
+        stack.pop();
+    }
+
+    public void visitCodeException(CodeException ce)
+    {
+        stack.push(ce);
+        ce.accept(visitor);
+        stack.pop();
+    }
+
+    public void visitLineNumberTable(LineNumberTable table)
+    {
+        stack.push(table);
+        table.accept(visitor);
+        LineNumber[] numbers = table.getLineNumberTable();
+        for (LineNumber number : numbers) {
+            number.accept(this);
+        }
+        stack.pop();
+    }
+
+    public void visitLineNumber(LineNumber number)
+    {
+        stack.push(number);
+        number.accept(visitor);
+        stack.pop();
+    }
+
+    public void visitLocalVariableTable(LocalVariableTable table)
+    {
+        stack.push(table);
+        table.accept(visitor);
+        LocalVariable[] vars = table.getLocalVariableTable();
+        for (LocalVariable var : vars) {
+            var.accept(this);
+        }
+        stack.pop();
+    }
+
+    public void visitStackMap(StackMap table)
+    {
+        stack.push(table);
+        table.accept(visitor);
+        StackMapEntry[] vars = table.getStackMap();
+        for (StackMapEntry var : vars) {
+            var.accept(this);
+        }
+        stack.pop();
+    }
+
+    public void visitStackMapEntry(StackMapEntry var)
+    {
+        stack.push(var);
+        var.accept(visitor);
+        stack.pop();
+    }
+
+    public void visitStackMapTable(StackMapTable table)
+    {
+        stack.push(table);
+        table.accept(visitor);
+        StackMapTableEntry[] vars = table.getStackMapTable();
+        for (StackMapTableEntry var : vars) {
+            var.accept(this);
+        }
+        stack.pop();
+    }
+
+    public void visitStackMapTableEntry(StackMapTableEntry var)
+    {
+        stack.push(var);
+        var.accept(visitor);
+        stack.pop();
+    }
+
+    public void visitLocalVariable(LocalVariable var)
+    {
+        stack.push(var);
+        var.accept(visitor);
+        stack.pop();
+    }
+
+    public void visitConstantPool(ConstantPool cp)
+    {
+        stack.push(cp);
+        cp.accept(visitor);
+        Constant[] constants = cp.getConstantPool();
+        for (int i = 1; i < constants.length; i++)
+        {
+            if (constants[i] != null)
+            {
+                constants[i].accept(this);
+            }
+        }
+        stack.pop();
+    }
+
+    public void visitConstantClass(ConstantClass constant)
+    {
+        stack.push(constant);
+        constant.accept(visitor);
+        stack.pop();
+    }
+
+    public void visitConstantDouble(ConstantDouble constant)
+    {
+        stack.push(constant);
+        constant.accept(visitor);
+        stack.pop();
+    }
+
+    public void visitConstantFieldref(ConstantFieldref constant)
+    {
+        stack.push(constant);
+        constant.accept(visitor);
+        stack.pop();
+    }
+
+    public void visitConstantFloat(ConstantFloat constant)
+    {
+        stack.push(constant);
+        constant.accept(visitor);
+        stack.pop();
+    }
+
+    public void visitConstantInteger(ConstantInteger constant)
+    {
+        stack.push(constant);
+        constant.accept(visitor);
+        stack.pop();
+    }
+
+    public void visitConstantInterfaceMethodref(
+            ConstantInterfaceMethodref constant)
+    {
+        stack.push(constant);
+        constant.accept(visitor);
+        stack.pop();
+    }
+
+    public void visitConstantLong(ConstantLong constant)
+    {
+        stack.push(constant);
+        constant.accept(visitor);
+        stack.pop();
+    }
+
+    public void visitConstantMethodref(ConstantMethodref constant)
+    {
+        stack.push(constant);
+        constant.accept(visitor);
+        stack.pop();
+    }
+
+    public void visitConstantNameAndType(ConstantNameAndType constant)
+    {
+        stack.push(constant);
+        constant.accept(visitor);
+        stack.pop();
+    }
+
+    public void visitConstantString(ConstantString constant)
+    {
+        stack.push(constant);
+        constant.accept(visitor);
+        stack.pop();
+    }
+
+    public void visitConstantUtf8(ConstantUtf8 constant)
+    {
+        stack.push(constant);
+        constant.accept(visitor);
+        stack.pop();
+    }
+
+    public void visitInnerClasses(InnerClasses ic)
+    {
+        stack.push(ic);
+        ic.accept(visitor);
+        InnerClass[] ics = ic.getInnerClasses();
+        for (InnerClass ic2 : ics) {
+            ic2.accept(this);
+        }
+        stack.pop();
+    }
+
+    public void visitInnerClass(InnerClass inner)
+    {
+        stack.push(inner);
+        inner.accept(visitor);
+        stack.pop();
+    }
+
+    public void visitDeprecated(Deprecated attribute)
+    {
+        stack.push(attribute);
+        attribute.accept(visitor);
+        stack.pop();
+    }
+
+    public void visitSignature(Signature attribute)
+    {
+        stack.push(attribute);
+        attribute.accept(visitor);
+        stack.pop();
+    }
+
+    public void visitSourceFile(SourceFile attribute)
+    {
+        stack.push(attribute);
+        attribute.accept(visitor);
+        stack.pop();
+    }
+
+    public void visitSynthetic(Synthetic attribute)
+    {
+        stack.push(attribute);
+        attribute.accept(visitor);
+        stack.pop();
+    }
+
+    public void visitUnknown(Unknown attribute)
+    {
+        stack.push(attribute);
+        attribute.accept(visitor);
+        stack.pop();
+    }
+
+    public void visitAnnotationDefault(AnnotationDefault obj)
+    {
+        stack.push(obj);
+        obj.accept(visitor);
+        stack.pop();
+    }
+
+    public void visitEnclosingMethod(EnclosingMethod obj)
+    {
+        stack.push(obj);
+        obj.accept(visitor);
+        stack.pop();
+    }
+
+    public void visitLocalVariableTypeTable(LocalVariableTypeTable obj)
+    {
+        stack.push(obj);
+        obj.accept(visitor);
+        stack.pop();
+    }
+
+    public void visitParameterAnnotation(ParameterAnnotations obj)
+    {
+        stack.push(obj);
+        obj.accept(visitor);
+        stack.pop();
+    }
 
     public void visitBootstrapMethods(BootstrapMethods obj)
     {

Modified: commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/ElementValue.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/ElementValue.java?rev=1598766&r1=1598765&r2=1598766&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/ElementValue.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/ElementValue.java Fri May 30 22:51:27 2014
@@ -28,115 +28,115 @@ import java.io.IOException;
  */
 public abstract class ElementValue
 {
-	protected int type;
+    protected int type;
 
-	protected ConstantPool cpool;
+    protected ConstantPool cpool;
 
-	@Override
+    @Override
     public String toString()
-	{
-		return stringifyValue();
-	}
-
-	protected ElementValue(int type, ConstantPool cpool)
-	{
-		this.type = type;
-		this.cpool = cpool;
-	}
-
-	public int getElementValueType()
-	{
-		return type;
-	}
-
-	public abstract String stringifyValue();
-
-	public abstract void dump(DataOutputStream dos) throws IOException;
-
-	public static final int STRING = 's';
-
-	public static final int ENUM_CONSTANT = 'e';
-
-	public static final int CLASS = 'c';
-
-	public static final int ANNOTATION = '@';
-
-	public static final int ARRAY = '[';
-
-	public static final int PRIMITIVE_INT = 'I';
-
-	public static final int PRIMITIVE_BYTE = 'B';
-
-	public static final int PRIMITIVE_CHAR = 'C';
-
-	public static final int PRIMITIVE_DOUBLE = 'D';
-
-	public static final int PRIMITIVE_FLOAT = 'F';
-
-	public static final int PRIMITIVE_LONG = 'J';
-
-	public static final int PRIMITIVE_SHORT = 'S';
-
-	public static final int PRIMITIVE_BOOLEAN = 'Z';
-
-	public static ElementValue readElementValue(DataInputStream dis,
-			ConstantPool cpool) throws IOException
-	{
-		byte type = dis.readByte();
-		switch (type)
-		{
-		case 'B': // byte
-			return new SimpleElementValue(PRIMITIVE_BYTE, dis
-					.readUnsignedShort(), cpool);
-		case 'C': // char
-			return new SimpleElementValue(PRIMITIVE_CHAR, dis
-					.readUnsignedShort(), cpool);
-		case 'D': // double
-			return new SimpleElementValue(PRIMITIVE_DOUBLE, dis
-					.readUnsignedShort(), cpool);
-		case 'F': // float
-			return new SimpleElementValue(PRIMITIVE_FLOAT, dis
-					.readUnsignedShort(), cpool);
-		case 'I': // int
-			return new SimpleElementValue(PRIMITIVE_INT, dis
-					.readUnsignedShort(), cpool);
-		case 'J': // long
-			return new SimpleElementValue(PRIMITIVE_LONG, dis
-					.readUnsignedShort(), cpool);
-		case 'S': // short
-			return new SimpleElementValue(PRIMITIVE_SHORT, dis
-					.readUnsignedShort(), cpool);
-		case 'Z': // boolean
-			return new SimpleElementValue(PRIMITIVE_BOOLEAN, dis
-					.readUnsignedShort(), cpool);
-		case 's': // String
-			return new SimpleElementValue(STRING, dis.readUnsignedShort(),
-					cpool);
-		case 'e': // Enum constant
-			return new EnumElementValue(ENUM_CONSTANT, dis.readUnsignedShort(),
-					dis.readUnsignedShort(), cpool);
-		case 'c': // Class
-			return new ClassElementValue(CLASS, dis.readUnsignedShort(), cpool);
-		case '@': // Annotation
-			// TODO isRuntimeVisible
-			return new AnnotationElementValue(ANNOTATION, AnnotationEntry.read(
-					dis, cpool, false), cpool);
-		case '[': // Array
-			int numArrayVals = dis.readUnsignedShort();
-			ElementValue[] evalues = new ElementValue[numArrayVals];
-			for (int j = 0; j < numArrayVals; j++)
-			{
-				evalues[j] = ElementValue.readElementValue(dis, cpool);
-			}
-			return new ArrayElementValue(ARRAY, evalues, cpool);
-		default:
-			throw new RuntimeException(
-					"Unexpected element value kind in annotation: " + type);
-		}
-	}
-
-	public String toShortString()
-	{
-		return stringifyValue();
-	}
+    {
+        return stringifyValue();
+    }
+
+    protected ElementValue(int type, ConstantPool cpool)
+    {
+        this.type = type;
+        this.cpool = cpool;
+    }
+
+    public int getElementValueType()
+    {
+        return type;
+    }
+
+    public abstract String stringifyValue();
+
+    public abstract void dump(DataOutputStream dos) throws IOException;
+
+    public static final int STRING = 's';
+
+    public static final int ENUM_CONSTANT = 'e';
+
+    public static final int CLASS = 'c';
+
+    public static final int ANNOTATION = '@';
+
+    public static final int ARRAY = '[';
+
+    public static final int PRIMITIVE_INT = 'I';
+
+    public static final int PRIMITIVE_BYTE = 'B';
+
+    public static final int PRIMITIVE_CHAR = 'C';
+
+    public static final int PRIMITIVE_DOUBLE = 'D';
+
+    public static final int PRIMITIVE_FLOAT = 'F';
+
+    public static final int PRIMITIVE_LONG = 'J';
+
+    public static final int PRIMITIVE_SHORT = 'S';
+
+    public static final int PRIMITIVE_BOOLEAN = 'Z';
+
+    public static ElementValue readElementValue(DataInputStream dis,
+            ConstantPool cpool) throws IOException
+    {
+        byte type = dis.readByte();
+        switch (type)
+        {
+        case 'B': // byte
+            return new SimpleElementValue(PRIMITIVE_BYTE, dis
+                    .readUnsignedShort(), cpool);
+        case 'C': // char
+            return new SimpleElementValue(PRIMITIVE_CHAR, dis
+                    .readUnsignedShort(), cpool);
+        case 'D': // double
+            return new SimpleElementValue(PRIMITIVE_DOUBLE, dis
+                    .readUnsignedShort(), cpool);
+        case 'F': // float
+            return new SimpleElementValue(PRIMITIVE_FLOAT, dis
+                    .readUnsignedShort(), cpool);
+        case 'I': // int
+            return new SimpleElementValue(PRIMITIVE_INT, dis
+                    .readUnsignedShort(), cpool);
+        case 'J': // long
+            return new SimpleElementValue(PRIMITIVE_LONG, dis
+                    .readUnsignedShort(), cpool);
+        case 'S': // short
+            return new SimpleElementValue(PRIMITIVE_SHORT, dis
+                    .readUnsignedShort(), cpool);
+        case 'Z': // boolean
+            return new SimpleElementValue(PRIMITIVE_BOOLEAN, dis
+                    .readUnsignedShort(), cpool);
+        case 's': // String
+            return new SimpleElementValue(STRING, dis.readUnsignedShort(),
+                    cpool);
+        case 'e': // Enum constant
+            return new EnumElementValue(ENUM_CONSTANT, dis.readUnsignedShort(),
+                    dis.readUnsignedShort(), cpool);
+        case 'c': // Class
+            return new ClassElementValue(CLASS, dis.readUnsignedShort(), cpool);
+        case '@': // Annotation
+            // TODO isRuntimeVisible
+            return new AnnotationElementValue(ANNOTATION, AnnotationEntry.read(
+                    dis, cpool, false), cpool);
+        case '[': // Array
+            int numArrayVals = dis.readUnsignedShort();
+            ElementValue[] evalues = new ElementValue[numArrayVals];
+            for (int j = 0; j < numArrayVals; j++)
+            {
+                evalues[j] = ElementValue.readElementValue(dis, cpool);
+            }
+            return new ArrayElementValue(ARRAY, evalues, cpool);
+        default:
+            throw new RuntimeException(
+                    "Unexpected element value kind in annotation: " + type);
+        }
+    }
+
+    public String toShortString()
+    {
+        return stringifyValue();
+    }
 }

Modified: commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/ElementValuePair.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/ElementValuePair.java?rev=1598766&r1=1598765&r2=1598766&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/ElementValuePair.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/ElementValuePair.java Fri May 30 22:51:27 2014
@@ -30,47 +30,47 @@ import org.apache.bcel.Constants;
  */
 public class ElementValuePair
 {
-	private ElementValue elementValue;
+    private ElementValue elementValue;
 
-	private ConstantPool constantPool;
+    private ConstantPool constantPool;
 
-	private int elementNameIndex;
+    private int elementNameIndex;
 
-	public ElementValuePair(int elementNameIndex, ElementValue elementValue,
-			ConstantPool constantPool)
-	{
-		this.elementValue = elementValue;
-		this.elementNameIndex = elementNameIndex;
-		this.constantPool = constantPool;
-	}
-
-	public String getNameString()
-	{
-		ConstantUtf8 c = (ConstantUtf8) constantPool.getConstant(
-				elementNameIndex, Constants.CONSTANT_Utf8);
-		return c.getBytes();
-	}
-
-	public final ElementValue getValue()
-	{
-		return elementValue;
-	}
-
-	public int getNameIndex()
-	{
-		return elementNameIndex;
-	}
-
-	public String toShortString()
-	{
-		StringBuilder result = new StringBuilder();
-		result.append(getNameString()).append("=").append(
-				getValue().toShortString());
-		return result.toString();
-	}
-	
-	protected void dump(DataOutputStream dos) throws IOException {
-		dos.writeShort(elementNameIndex); // u2 name of the element
-		elementValue.dump(dos);
-	}
+    public ElementValuePair(int elementNameIndex, ElementValue elementValue,
+            ConstantPool constantPool)
+    {
+        this.elementValue = elementValue;
+        this.elementNameIndex = elementNameIndex;
+        this.constantPool = constantPool;
+    }
+
+    public String getNameString()
+    {
+        ConstantUtf8 c = (ConstantUtf8) constantPool.getConstant(
+                elementNameIndex, Constants.CONSTANT_Utf8);
+        return c.getBytes();
+    }
+
+    public final ElementValue getValue()
+    {
+        return elementValue;
+    }
+
+    public int getNameIndex()
+    {
+        return elementNameIndex;
+    }
+
+    public String toShortString()
+    {
+        StringBuilder result = new StringBuilder();
+        result.append(getNameString()).append("=").append(
+                getValue().toShortString());
+        return result.toString();
+    }
+
+    protected void dump(DataOutputStream dos) throws IOException {
+        dos.writeShort(elementNameIndex); // u2 name of the element
+        elementValue.dump(dos);
+    }
 }

Modified: commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/EmptyVisitor.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/EmptyVisitor.java?rev=1598766&r1=1598765&r2=1598766&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/EmptyVisitor.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/EmptyVisitor.java Fri May 30 22:51:27 2014
@@ -26,169 +26,169 @@ package org.apache.bcel.classfile;
  */
 public class EmptyVisitor implements Visitor
 {
-	protected EmptyVisitor()
-	{
-	}
-
-	public void visitAnnotation(Annotations obj)
-	{
-	}
-
-	public void visitParameterAnnotation(ParameterAnnotations obj)
-	{
-	}
-
-	public void visitAnnotationEntry(AnnotationEntry obj)
-	{
-	}
-
-	public void visitAnnotationDefault(AnnotationDefault obj)
-	{
-	}
-
-	public void visitCode(Code obj)
-	{
-	}
-
-	public void visitCodeException(CodeException obj)
-	{
-	}
-
-	public void visitConstantClass(ConstantClass obj)
-	{
-	}
-
-	public void visitConstantDouble(ConstantDouble obj)
-	{
-	}
-
-	public void visitConstantFieldref(ConstantFieldref obj)
-	{
-	}
-
-	public void visitConstantFloat(ConstantFloat obj)
-	{
-	}
-
-	public void visitConstantInteger(ConstantInteger obj)
-	{
-	}
-
-	public void visitConstantInterfaceMethodref(ConstantInterfaceMethodref obj)
-	{
-	}
-
-	public void visitConstantLong(ConstantLong obj)
-	{
-	}
-
-	public void visitConstantMethodref(ConstantMethodref obj)
-	{
-	}
-
-	public void visitConstantNameAndType(ConstantNameAndType obj)
-	{
-	}
-
-	public void visitConstantPool(ConstantPool obj)
-	{
-	}
-
-	public void visitConstantString(ConstantString obj)
-	{
-	}
-
-	public void visitConstantUtf8(ConstantUtf8 obj)
-	{
-	}
-
-	public void visitConstantValue(ConstantValue obj)
-	{
-	}
-
-	public void visitDeprecated(Deprecated obj)
-	{
-	}
-
-	public void visitExceptionTable(ExceptionTable obj)
-	{
-	}
-
-	public void visitField(Field obj)
-	{
-	}
-
-	public void visitInnerClass(InnerClass obj)
-	{
-	}
-
-	public void visitInnerClasses(InnerClasses obj)
-	{
-	}
-
-	public void visitJavaClass(JavaClass obj)
-	{
-	}
-
-	public void visitLineNumber(LineNumber obj)
-	{
-	}
-
-	public void visitLineNumberTable(LineNumberTable obj)
-	{
-	}
-
-	public void visitLocalVariable(LocalVariable obj)
-	{
-	}
-
-	public void visitLocalVariableTable(LocalVariableTable obj)
-	{
-	}
-
-	public void visitMethod(Method obj)
-	{
-	}
-
-	public void visitSignature(Signature obj)
-	{
-	}
-
-	public void visitSourceFile(SourceFile obj)
-	{
-	}
-
-	public void visitSynthetic(Synthetic obj)
-	{
-	}
-
-	public void visitUnknown(Unknown obj)
-	{
-	}
-
-	public void visitStackMap(StackMap obj)
-	{
-	}
-
-	public void visitStackMapEntry(StackMapEntry obj)
-	{
-	}
-
-	public void visitStackMapTable(StackMapTable obj)
-	{
-	}
-
-	public void visitStackMapTableEntry(StackMapTableEntry obj)
-	{
-	}
-
-	public void visitEnclosingMethod(EnclosingMethod obj)
-	{
-	}
-
-	public void visitLocalVariableTypeTable(LocalVariableTypeTable obj)
-	{
-	}
+    protected EmptyVisitor()
+    {
+    }
+
+    public void visitAnnotation(Annotations obj)
+    {
+    }
+
+    public void visitParameterAnnotation(ParameterAnnotations obj)
+    {
+    }
+
+    public void visitAnnotationEntry(AnnotationEntry obj)
+    {
+    }
+
+    public void visitAnnotationDefault(AnnotationDefault obj)
+    {
+    }
+
+    public void visitCode(Code obj)
+    {
+    }
+
+    public void visitCodeException(CodeException obj)
+    {
+    }
+
+    public void visitConstantClass(ConstantClass obj)
+    {
+    }
+
+    public void visitConstantDouble(ConstantDouble obj)
+    {
+    }
+
+    public void visitConstantFieldref(ConstantFieldref obj)
+    {
+    }
+
+    public void visitConstantFloat(ConstantFloat obj)
+    {
+    }
+
+    public void visitConstantInteger(ConstantInteger obj)
+    {
+    }
+
+    public void visitConstantInterfaceMethodref(ConstantInterfaceMethodref obj)
+    {
+    }
+
+    public void visitConstantLong(ConstantLong obj)
+    {
+    }
+
+    public void visitConstantMethodref(ConstantMethodref obj)
+    {
+    }
+
+    public void visitConstantNameAndType(ConstantNameAndType obj)
+    {
+    }
+
+    public void visitConstantPool(ConstantPool obj)
+    {
+    }
+
+    public void visitConstantString(ConstantString obj)
+    {
+    }
+
+    public void visitConstantUtf8(ConstantUtf8 obj)
+    {
+    }
+
+    public void visitConstantValue(ConstantValue obj)
+    {
+    }
+
+    public void visitDeprecated(Deprecated obj)
+    {
+    }
+
+    public void visitExceptionTable(ExceptionTable obj)
+    {
+    }
+
+    public void visitField(Field obj)
+    {
+    }
+
+    public void visitInnerClass(InnerClass obj)
+    {
+    }
+
+    public void visitInnerClasses(InnerClasses obj)
+    {
+    }
+
+    public void visitJavaClass(JavaClass obj)
+    {
+    }
+
+    public void visitLineNumber(LineNumber obj)
+    {
+    }
+
+    public void visitLineNumberTable(LineNumberTable obj)
+    {
+    }
+
+    public void visitLocalVariable(LocalVariable obj)
+    {
+    }
+
+    public void visitLocalVariableTable(LocalVariableTable obj)
+    {
+    }
+
+    public void visitMethod(Method obj)
+    {
+    }
+
+    public void visitSignature(Signature obj)
+    {
+    }
+
+    public void visitSourceFile(SourceFile obj)
+    {
+    }
+
+    public void visitSynthetic(Synthetic obj)
+    {
+    }
+
+    public void visitUnknown(Unknown obj)
+    {
+    }
+
+    public void visitStackMap(StackMap obj)
+    {
+    }
+
+    public void visitStackMapEntry(StackMapEntry obj)
+    {
+    }
+
+    public void visitStackMapTable(StackMapTable obj)
+    {
+    }
+
+    public void visitStackMapTableEntry(StackMapTableEntry obj)
+    {
+    }
+
+    public void visitEnclosingMethod(EnclosingMethod obj)
+    {
+    }
+
+    public void visitLocalVariableTypeTable(LocalVariableTypeTable obj)
+    {
+    }
 
     public void visitBootstrapMethods(BootstrapMethods obj)
     {

Modified: commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/EnclosingMethod.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/EnclosingMethod.java?rev=1598766&r1=1598765&r2=1598766&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/EnclosingMethod.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/EnclosingMethod.java Fri May 30 22:51:27 2014
@@ -27,72 +27,72 @@ import org.apache.bcel.Constants;
  * anonymous classes and ... there can be only one.
  */
 public class EnclosingMethod extends Attribute {
-	
-	private static final long serialVersionUID = 9136852385761725494L;
+
+    private static final long serialVersionUID = 9136852385761725494L;
 
     // Pointer to the CONSTANT_Class_info structure representing the 
-	// innermost class that encloses the declaration of the current class.
-	private int classIndex;
-	
-	// If the current class is not immediately enclosed by a method or 
-	// constructor, then the value of the method_index item must be zero.  
-	// Otherwise, the value of the  method_index item must point to a 
-	// CONSTANT_NameAndType_info structure representing the name and the 
-	// type of a method in the class referenced by the class we point 
-	// to in the class_index.  *It is the compiler responsibility* to 
-	// ensure that the method identified by this index is the closest 
-	// lexically enclosing method that includes the local/anonymous class.
-	private int methodIndex;
-
-	// Ctors - and code to read an attribute in.
-	public EnclosingMethod(int nameIndex, int len, DataInputStream dis, ConstantPool cpool) throws IOException {
-		this(nameIndex, len, dis.readUnsignedShort(), dis.readUnsignedShort(), cpool);
-	}
-
-	private EnclosingMethod(int nameIndex, int len, int classIdx,int methodIdx, ConstantPool cpool) {
-	    super(Constants.ATTR_ENCLOSING_METHOD, nameIndex, len, cpool);
-	    classIndex  = classIdx;
-	    methodIndex = methodIdx;
-	}
+    // innermost class that encloses the declaration of the current class.
+    private int classIndex;
+
+    // If the current class is not immediately enclosed by a method or 
+    // constructor, then the value of the method_index item must be zero.  
+    // Otherwise, the value of the  method_index item must point to a 
+    // CONSTANT_NameAndType_info structure representing the name and the 
+    // type of a method in the class referenced by the class we point 
+    // to in the class_index.  *It is the compiler responsibility* to 
+    // ensure that the method identified by this index is the closest 
+    // lexically enclosing method that includes the local/anonymous class.
+    private int methodIndex;
+
+    // Ctors - and code to read an attribute in.
+    public EnclosingMethod(int nameIndex, int len, DataInputStream dis, ConstantPool cpool) throws IOException {
+        this(nameIndex, len, dis.readUnsignedShort(), dis.readUnsignedShort(), cpool);
+    }
+
+    private EnclosingMethod(int nameIndex, int len, int classIdx,int methodIdx, ConstantPool cpool) {
+        super(Constants.ATTR_ENCLOSING_METHOD, nameIndex, len, cpool);
+        classIndex  = classIdx;
+        methodIndex = methodIdx;
+    }
 
-	@Override
+    @Override
     public void accept(Visitor v) {
-	  v.visitEnclosingMethod(this);
-	}
+      v.visitEnclosingMethod(this);
+    }
 
-	@Override
+    @Override
     public Attribute copy(ConstantPool constant_pool) {
-		throw new RuntimeException("Not implemented yet!");
-		// is this next line sufficient?
-		// return (EnclosingMethod)clone();
-	}
-	
-	// Accessors
-	public final int getEnclosingClassIndex() { return classIndex; }  
-	public final int getEnclosingMethodIndex(){ return methodIndex;}
-	
-	public final void setEnclosingClassIndex(int idx) {classIndex = idx;}
-	public final void setEnclosingMethodIndex(int idx){methodIndex= idx;}
-
-	public final ConstantClass getEnclosingClass() {
-		ConstantClass c = 
-			(ConstantClass)constant_pool.getConstant(classIndex,Constants.CONSTANT_Class);
-		return c;
-	}
-	
-	public final ConstantNameAndType getEnclosingMethod() {
-		if (methodIndex == 0) {
+        throw new RuntimeException("Not implemented yet!");
+        // is this next line sufficient?
+        // return (EnclosingMethod)clone();
+    }
+
+    // Accessors
+    public final int getEnclosingClassIndex() { return classIndex; }  
+    public final int getEnclosingMethodIndex(){ return methodIndex;}
+
+    public final void setEnclosingClassIndex(int idx) {classIndex = idx;}
+    public final void setEnclosingMethodIndex(int idx){methodIndex= idx;}
+
+    public final ConstantClass getEnclosingClass() {
+        ConstantClass c = 
+            (ConstantClass)constant_pool.getConstant(classIndex,Constants.CONSTANT_Class);
+        return c;
+    }
+
+    public final ConstantNameAndType getEnclosingMethod() {
+        if (methodIndex == 0) {
             return null;
         }
-		ConstantNameAndType nat = 
-			(ConstantNameAndType)constant_pool.getConstant(methodIndex,Constants.CONSTANT_NameAndType);
-		return nat;
-	}
+        ConstantNameAndType nat = 
+            (ConstantNameAndType)constant_pool.getConstant(methodIndex,Constants.CONSTANT_NameAndType);
+        return nat;
+    }
 
     @Override
     public final void dump(DataOutputStream file) throws IOException {
-	    super.dump(file);
-	    file.writeShort(classIndex);
-	    file.writeShort(methodIndex);
+        super.dump(file);
+        file.writeShort(classIndex);
+        file.writeShort(methodIndex);
     }    
 }

Modified: commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/EnumElementValue.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/EnumElementValue.java?rev=1598766&r1=1598765&r2=1598766&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/EnumElementValue.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/bcel/classfile/EnumElementValue.java Fri May 30 22:51:27 2014
@@ -23,60 +23,60 @@ import org.apache.bcel.Constants;
 
 public class EnumElementValue extends ElementValue
 {
-	// For enum types, these two indices point to the type and value
-	private int typeIdx;
+    // For enum types, these two indices point to the type and value
+    private int typeIdx;
 
-	private int valueIdx;
+    private int valueIdx;
 
-	public EnumElementValue(int type, int typeIdx, int valueIdx,
-			ConstantPool cpool)
-	{
-		super(type, cpool);
-		if (type != ENUM_CONSTANT) {
+    public EnumElementValue(int type, int typeIdx, int valueIdx,
+            ConstantPool cpool)
+    {
+        super(type, cpool);
+        if (type != ENUM_CONSTANT) {
             throw new RuntimeException(
-					"Only element values of type enum can be built with this ctor - type specified: " + type);
+                    "Only element values of type enum can be built with this ctor - type specified: " + type);
         }
-		this.typeIdx = typeIdx;
-		this.valueIdx = valueIdx;
-	}
+        this.typeIdx = typeIdx;
+        this.valueIdx = valueIdx;
+    }
 
-	@Override
+    @Override
     public void dump(DataOutputStream dos) throws IOException
-	{
-		dos.writeByte(type); // u1 type of value (ENUM_CONSTANT == 'e')
-		dos.writeShort(typeIdx); // u2
-		dos.writeShort(valueIdx); // u2
-	}
+    {
+        dos.writeByte(type); // u1 type of value (ENUM_CONSTANT == 'e')
+        dos.writeShort(typeIdx); // u2
+        dos.writeShort(valueIdx); // u2
+    }
 
-	@Override
+    @Override
     public String stringifyValue()
-	{
-		ConstantUtf8 cu8 = (ConstantUtf8) cpool.getConstant(valueIdx,
-				Constants.CONSTANT_Utf8);
-		return cu8.getBytes();
-	}
-
-	public String getEnumTypeString()
-	{
-		ConstantUtf8 cu8 = (ConstantUtf8) cpool.getConstant(typeIdx,
-				Constants.CONSTANT_Utf8);
-		return cu8.getBytes();// Utility.signatureToString(cu8.getBytes());
-	}
-
-	public String getEnumValueString()
-	{
-		ConstantUtf8 cu8 = (ConstantUtf8) cpool.getConstant(valueIdx,
-				Constants.CONSTANT_Utf8);
-		return cu8.getBytes();
-	}
-
-	public int getValueIndex()
-	{
-		return valueIdx;
-	}
-
-	public int getTypeIndex()
-	{
-		return typeIdx;
-	}
+    {
+        ConstantUtf8 cu8 = (ConstantUtf8) cpool.getConstant(valueIdx,
+                Constants.CONSTANT_Utf8);
+        return cu8.getBytes();
+    }
+
+    public String getEnumTypeString()
+    {
+        ConstantUtf8 cu8 = (ConstantUtf8) cpool.getConstant(typeIdx,
+                Constants.CONSTANT_Utf8);
+        return cu8.getBytes();// Utility.signatureToString(cu8.getBytes());
+    }
+
+    public String getEnumValueString()
+    {
+        ConstantUtf8 cu8 = (ConstantUtf8) cpool.getConstant(valueIdx,
+                Constants.CONSTANT_Utf8);
+        return cu8.getBytes();
+    }
+
+    public int getValueIndex()
+    {
+        return valueIdx;
+    }
+
+    public int getTypeIndex()
+    {
+        return typeIdx;
+    }
 }



Mime
View raw message