You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2022/05/01 18:46:03 UTC

[commons-bcel] branch master updated (bc3bf60b -> 5a4b4fc1)

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/commons-bcel.git


    from bc3bf60b Quiet please.
     new 256386cc Sort members.
     new 9f188870 Add spotbugs:check to the default Maven goal. Revert "Add spotbugs:check to the default Maven goal."
     new 58664a05 Update Spotbugs plugin and tool to 4.6.0.0/4.6.0
     new 94d31f8e Fix SpotBugs [ERROR] High: Found reliance on default encoding
     new 4e36acdf Remove unused exception from private method signature.
     new 2bf42c41 Remove unused exception from signature.
     new db3b0e1f Use camel-case.
     new 5a4b4fc1 Fix SpotBugs [ERROR] High: Found reliance on default encoding

The 8 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 pom.xml                                            |    4 +-
 src/changes/changes.xml                            |    2 +
 src/main/java/org/apache/bcel/Const.java           |  290 ++--
 src/main/java/org/apache/bcel/ExceptionConst.java  |   52 +-
 src/main/java/org/apache/bcel/Repository.java      |  226 +--
 .../org/apache/bcel/classfile/AccessFlags.java     |  176 +-
 .../apache/bcel/classfile/AnnotationDefault.java   |   28 +-
 .../bcel/classfile/AnnotationElementValue.java     |   10 +-
 .../org/apache/bcel/classfile/AnnotationEntry.java |   88 +-
 .../org/apache/bcel/classfile/Annotations.java     |   60 +-
 .../apache/bcel/classfile/ArrayElementValue.java   |   46 +-
 .../org/apache/bcel/classfile/BootstrapMethod.java |   64 +-
 .../apache/bcel/classfile/BootstrapMethods.java    |   28 +-
 .../apache/bcel/classfile/ClassElementValue.java   |   18 +-
 .../org/apache/bcel/classfile/ClassParser.java     |    2 +-
 src/main/java/org/apache/bcel/classfile/Code.java  |  158 +-
 .../org/apache/bcel/classfile/CodeException.java   |   46 +-
 .../java/org/apache/bcel/classfile/Constant.java   |  138 +-
 .../java/org/apache/bcel/classfile/ConstantCP.java |   40 +-
 .../org/apache/bcel/classfile/ConstantClass.java   |   30 +-
 .../org/apache/bcel/classfile/ConstantDouble.java  |   34 +-
 .../org/apache/bcel/classfile/ConstantFloat.java   |   34 +-
 .../org/apache/bcel/classfile/ConstantInteger.java |   34 +-
 .../org/apache/bcel/classfile/ConstantLong.java    |   34 +-
 .../bcel/classfile/ConstantMethodHandle.java       |   16 +-
 .../org/apache/bcel/classfile/ConstantModule.java  |   30 +-
 .../apache/bcel/classfile/ConstantNameAndType.java |   20 +-
 .../org/apache/bcel/classfile/ConstantPackage.java |   30 +-
 .../org/apache/bcel/classfile/ConstantPool.java    |   96 +-
 .../org/apache/bcel/classfile/ConstantString.java  |   32 +-
 .../org/apache/bcel/classfile/ConstantValue.java   |   22 +-
 .../java/org/apache/bcel/classfile/Deprecated.java |   30 +-
 .../apache/bcel/classfile/DescendingVisitor.java   |  512 +++---
 .../org/apache/bcel/classfile/ElementValue.java    |   70 +-
 .../apache/bcel/classfile/ElementValuePair.java    |   20 +-
 .../org/apache/bcel/classfile/EmptyVisitor.java    |  176 +-
 .../org/apache/bcel/classfile/EnclosingMethod.java |   36 +-
 .../apache/bcel/classfile/EnumElementValue.java    |   20 +-
 .../org/apache/bcel/classfile/ExceptionTable.java  |   74 +-
 src/main/java/org/apache/bcel/classfile/Field.java |  122 +-
 .../org/apache/bcel/classfile/FieldOrMethod.java   |  204 +--
 .../java/org/apache/bcel/classfile/InnerClass.java |   44 +-
 .../org/apache/bcel/classfile/InnerClasses.java    |   58 +-
 .../java/org/apache/bcel/classfile/JavaClass.java  |  914 +++++-----
 .../java/org/apache/bcel/classfile/LineNumber.java |   46 +-
 .../org/apache/bcel/classfile/LineNumberTable.java |  132 +-
 .../org/apache/bcel/classfile/LocalVariable.java   |  114 +-
 .../apache/bcel/classfile/LocalVariableTable.java  |   92 +-
 .../bcel/classfile/LocalVariableTypeTable.java     |   66 +-
 .../java/org/apache/bcel/classfile/Method.java     |  184 +-
 .../org/apache/bcel/classfile/MethodParameter.java |   74 +-
 .../apache/bcel/classfile/MethodParameters.java    |   16 +-
 .../java/org/apache/bcel/classfile/Module.java     |  116 +-
 .../org/apache/bcel/classfile/ModuleExports.java   |   26 +-
 .../org/apache/bcel/classfile/ModuleMainClass.java |   48 +-
 .../org/apache/bcel/classfile/ModuleOpens.java     |   26 +-
 .../org/apache/bcel/classfile/ModulePackages.java  |   78 +-
 .../org/apache/bcel/classfile/ModuleProvides.java  |   26 +-
 .../org/apache/bcel/classfile/ModuleRequires.java  |   26 +-
 .../java/org/apache/bcel/classfile/NestHost.java   |   48 +-
 .../org/apache/bcel/classfile/NestMembers.java     |   82 +-
 .../java/org/apache/bcel/classfile/PMGClass.java   |   66 +-
 .../bcel/classfile/ParameterAnnotationEntry.java   |   38 +-
 .../bcel/classfile/ParameterAnnotations.java       |   44 +-
 .../java/org/apache/bcel/classfile/Signature.java  |  275 +--
 .../apache/bcel/classfile/SimpleElementValue.java  |  118 +-
 .../java/org/apache/bcel/classfile/SourceFile.java |   48 +-
 .../java/org/apache/bcel/classfile/StackMap.java   |   90 +-
 .../org/apache/bcel/classfile/StackMapEntry.java   |  264 +--
 .../org/apache/bcel/classfile/StackMapType.java    |  104 +-
 .../java/org/apache/bcel/classfile/Synthetic.java  |   48 +-
 .../java/org/apache/bcel/classfile/Unknown.java    |   52 +-
 .../java/org/apache/bcel/classfile/Utility.java    | 1254 +++++++-------
 .../java/org/apache/bcel/classfile/Visitor.java    |  162 +-
 .../java/org/apache/bcel/generic/ACONST_NULL.java  |   16 +-
 .../java/org/apache/bcel/generic/ANEWARRAY.java    |   14 +-
 .../java/org/apache/bcel/generic/ARRAYLENGTH.java  |   20 +-
 src/main/java/org/apache/bcel/generic/ATHROW.java  |   20 +-
 .../bcel/generic/AnnotationElementValueGen.java    |   24 +-
 .../apache/bcel/generic/AnnotationEntryGen.java    |  302 ++--
 .../apache/bcel/generic/ArrayElementValueGen.java  |   68 +-
 .../java/org/apache/bcel/generic/ArrayType.java    |   38 +-
 src/main/java/org/apache/bcel/generic/BIPUSH.java  |   54 +-
 .../java/org/apache/bcel/generic/BasicType.java    |   36 +-
 .../java/org/apache/bcel/generic/BranchHandle.java |   74 +-
 .../org/apache/bcel/generic/BranchInstruction.java |  220 +--
 .../java/org/apache/bcel/generic/CHECKCAST.java    |   38 +-
 .../org/apache/bcel/generic/CPInstruction.java     |   66 +-
 .../apache/bcel/generic/ClassElementValueGen.java  |   62 +-
 .../java/org/apache/bcel/generic/ClassGen.java     |  642 +++----
 .../org/apache/bcel/generic/CodeExceptionGen.java  |  126 +-
 .../org/apache/bcel/generic/ConstantPoolGen.java   |  762 ++++-----
 src/main/java/org/apache/bcel/generic/DCMPG.java   |   14 +-
 src/main/java/org/apache/bcel/generic/DCMPL.java   |   14 +-
 src/main/java/org/apache/bcel/generic/DCONST.java  |   28 +-
 .../org/apache/bcel/generic/ElementValueGen.java   |  128 +-
 .../apache/bcel/generic/ElementValuePairGen.java   |   20 +-
 .../java/org/apache/bcel/generic/EmptyVisitor.java |  366 ++--
 .../apache/bcel/generic/EnumElementValueGen.java   |   78 +-
 src/main/java/org/apache/bcel/generic/FCMPG.java   |   16 +-
 src/main/java/org/apache/bcel/generic/FCMPL.java   |   16 +-
 src/main/java/org/apache/bcel/generic/FCONST.java  |   28 +-
 .../java/org/apache/bcel/generic/FieldGen.java     |  348 ++--
 .../apache/bcel/generic/FieldGenOrMethodGen.java   |  132 +-
 .../org/apache/bcel/generic/FieldInstruction.java  |   32 +-
 .../org/apache/bcel/generic/FieldOrMethod.java     |   66 +-
 .../java/org/apache/bcel/generic/GETFIELD.java     |   28 +-
 .../java/org/apache/bcel/generic/GETSTATIC.java    |   26 +-
 src/main/java/org/apache/bcel/generic/GOTO.java    |   36 +-
 src/main/java/org/apache/bcel/generic/GOTO_W.java  |   34 +-
 .../org/apache/bcel/generic/GotoInstruction.java   |   10 +-
 src/main/java/org/apache/bcel/generic/ICONST.java  |   28 +-
 src/main/java/org/apache/bcel/generic/IDIV.java    |   20 +-
 src/main/java/org/apache/bcel/generic/IFEQ.java    |   18 +-
 src/main/java/org/apache/bcel/generic/IFGE.java    |   18 +-
 src/main/java/org/apache/bcel/generic/IFGT.java    |   18 +-
 src/main/java/org/apache/bcel/generic/IFLE.java    |   18 +-
 src/main/java/org/apache/bcel/generic/IFLT.java    |   18 +-
 src/main/java/org/apache/bcel/generic/IFNE.java    |   18 +-
 .../java/org/apache/bcel/generic/IFNONNULL.java    |   18 +-
 src/main/java/org/apache/bcel/generic/IFNULL.java  |   18 +-
 .../java/org/apache/bcel/generic/IF_ACMPEQ.java    |   18 +-
 .../java/org/apache/bcel/generic/IF_ACMPNE.java    |   18 +-
 .../java/org/apache/bcel/generic/IF_ICMPEQ.java    |   18 +-
 .../java/org/apache/bcel/generic/IF_ICMPGE.java    |   18 +-
 .../java/org/apache/bcel/generic/IF_ICMPGT.java    |   18 +-
 .../java/org/apache/bcel/generic/IF_ICMPLE.java    |   18 +-
 .../java/org/apache/bcel/generic/IF_ICMPLT.java    |   18 +-
 .../java/org/apache/bcel/generic/IF_ICMPNE.java    |   18 +-
 src/main/java/org/apache/bcel/generic/IINC.java    |   94 +-
 .../java/org/apache/bcel/generic/INSTANCEOF.java   |   32 +-
 .../org/apache/bcel/generic/INVOKEDYNAMIC.java     |   88 +-
 .../org/apache/bcel/generic/INVOKEINTERFACE.java   |   76 +-
 .../org/apache/bcel/generic/INVOKESPECIAL.java     |   40 +-
 .../java/org/apache/bcel/generic/INVOKESTATIC.java |   36 +-
 .../org/apache/bcel/generic/INVOKEVIRTUAL.java     |   40 +-
 src/main/java/org/apache/bcel/generic/IREM.java    |   20 +-
 .../java/org/apache/bcel/generic/Instruction.java  |  318 ++--
 .../org/apache/bcel/generic/InstructionConst.java  |    4 +-
 .../apache/bcel/generic/InstructionConstants.java  |  226 +--
 .../apache/bcel/generic/InstructionFactory.java    |  818 ++++-----
 .../org/apache/bcel/generic/InstructionHandle.java |  292 ++--
 .../org/apache/bcel/generic/InstructionList.java   | 1462 ++++++++--------
 .../org/apache/bcel/generic/InvokeInstruction.java |   84 +-
 src/main/java/org/apache/bcel/generic/JSR.java     |   36 +-
 src/main/java/org/apache/bcel/generic/JSR_W.java   |   34 +-
 .../org/apache/bcel/generic/JsrInstruction.java    |   10 +-
 src/main/java/org/apache/bcel/generic/LCMP.java    |   16 +-
 src/main/java/org/apache/bcel/generic/LCONST.java  |   28 +-
 src/main/java/org/apache/bcel/generic/LDC.java     |  104 +-
 src/main/java/org/apache/bcel/generic/LDC2_W.java  |   36 +-
 src/main/java/org/apache/bcel/generic/LDIV.java    |   16 +-
 .../java/org/apache/bcel/generic/LOOKUPSWITCH.java |   36 +-
 src/main/java/org/apache/bcel/generic/LREM.java    |   16 +-
 .../org/apache/bcel/generic/LineNumberGen.java     |   54 +-
 .../org/apache/bcel/generic/LocalVariableGen.java  |  174 +-
 .../bcel/generic/LocalVariableInstruction.java     |  134 +-
 .../java/org/apache/bcel/generic/MONITORENTER.java |   16 +-
 .../java/org/apache/bcel/generic/MONITOREXIT.java  |   16 +-
 .../org/apache/bcel/generic/MULTIANEWARRAY.java    |   96 +-
 .../java/org/apache/bcel/generic/MethodGen.java    | 1408 +++++++--------
 src/main/java/org/apache/bcel/generic/NEW.java     |   28 +-
 .../java/org/apache/bcel/generic/NEWARRAY.java     |   60 +-
 .../bcel/generic/NameSignatureInstruction.java     |   16 +-
 .../java/org/apache/bcel/generic/ObjectType.java   |   82 +-
 src/main/java/org/apache/bcel/generic/PUSH.java    |  118 +-
 .../java/org/apache/bcel/generic/PUTFIELD.java     |   28 +-
 .../java/org/apache/bcel/generic/PUTSTATIC.java    |   26 +-
 src/main/java/org/apache/bcel/generic/RET.java     |   76 +-
 .../org/apache/bcel/generic/ReferenceType.java     |  288 ++--
 .../org/apache/bcel/generic/ReturnInstruction.java |   16 +-
 .../org/apache/bcel/generic/ReturnaddressType.java |   22 +-
 src/main/java/org/apache/bcel/generic/SIPUSH.java  |   54 +-
 src/main/java/org/apache/bcel/generic/SWITCH.java  |   58 +-
 src/main/java/org/apache/bcel/generic/Select.java  |  300 ++--
 .../apache/bcel/generic/SimpleElementValueGen.java |  104 +-
 .../java/org/apache/bcel/generic/TABLESWITCH.java  |   36 +-
 src/main/java/org/apache/bcel/generic/Type.java    |  392 ++---
 src/main/java/org/apache/bcel/generic/Visitor.java |  366 ++--
 .../bcel/util/AbstractClassPathRepository.java     |   66 +-
 .../java/org/apache/bcel/util/AttributeHTML.java   |   81 +-
 .../java/org/apache/bcel/util/BCELFactory.java     |  272 +--
 src/main/java/org/apache/bcel/util/BCELifier.java  |  288 ++--
 .../java/org/apache/bcel/util/ByteSequence.java    |   36 +-
 src/main/java/org/apache/bcel/util/Class2HTML.java |  169 +-
 .../java/org/apache/bcel/util/ClassLoader.java     |   88 +-
 .../apache/bcel/util/ClassLoaderRepository.java    |   50 +-
 .../org/apache/bcel/util/ClassPathRepository.java  |   26 +-
 src/main/java/org/apache/bcel/util/ClassQueue.java |   10 +-
 src/main/java/org/apache/bcel/util/ClassSet.java   |   18 +-
 src/main/java/org/apache/bcel/util/ClassStack.java |   12 +-
 src/main/java/org/apache/bcel/util/CodeHTML.java   |   55 +-
 .../java/org/apache/bcel/util/ConstantHTML.java    |   61 +-
 .../org/apache/bcel/util/InstructionFinder.java    |  414 ++---
 .../java/org/apache/bcel/util/JavaWrapper.java     |   46 +-
 .../bcel/util/LruCacheClassPathRepository.java     |   16 +-
 .../util/MemorySensitiveClassPathRepository.java   |   32 +-
 src/main/java/org/apache/bcel/util/MethodHTML.java |   51 +-
 .../org/apache/bcel/util/ModularRuntimeImage.java  |   13 +-
 src/main/java/org/apache/bcel/util/Repository.java |   26 +-
 .../org/apache/bcel/util/SyntheticRepository.java  |    8 +-
 .../apache/bcel/verifier/GraphicalVerifier.java    |   22 +-
 .../org/apache/bcel/verifier/NativeVerifier.java   |   14 +-
 .../org/apache/bcel/verifier/PassVerifier.java     |   50 +-
 .../org/apache/bcel/verifier/TransitiveHull.java   |   46 +-
 .../apache/bcel/verifier/VerificationResult.java   |   30 +-
 .../java/org/apache/bcel/verifier/Verifier.java    |  168 +-
 .../org/apache/bcel/verifier/VerifierAppFrame.java |  206 +--
 .../org/apache/bcel/verifier/VerifierFactory.java  |   38 +-
 .../bcel/verifier/VerifierFactoryListModel.java    |   36 +-
 .../org/apache/bcel/verifier/VerifyDialog.java     |  134 +-
 .../verifier/exc/AssertionViolatedException.java   |   18 +-
 .../exc/StructuralCodeConstraintException.java     |   10 +-
 .../java/org/apache/bcel/verifier/exc/Utility.java |    6 +-
 .../apache/bcel/verifier/statics/DOUBLE_Upper.java |   10 +-
 .../apache/bcel/verifier/statics/LONG_Upper.java   |   10 +-
 .../bcel/verifier/statics/LocalVariableInfo.java   |   90 +-
 .../bcel/verifier/statics/LocalVariablesInfo.java  |   26 +-
 .../bcel/verifier/statics/Pass1Verifier.java       |   36 +-
 .../bcel/verifier/statics/Pass2Verifier.java       | 1792 ++++++++++----------
 .../bcel/verifier/statics/Pass3aVerifier.java      | 1654 +++++++++---------
 .../verifier/statics/StringRepresentation.java     |  188 +-
 .../verifier/structurals/ControlFlowGraph.java     |  302 ++--
 .../verifier/structurals/ExecutionVisitor.java     |   16 +-
 .../apache/bcel/verifier/structurals/Frame.java    |   56 +-
 .../structurals/InstConstraintVisitor.java         |  610 +++----
 .../verifier/structurals/InstructionContext.java   |   60 +-
 .../bcel/verifier/structurals/LocalVariables.java  |  102 +-
 .../bcel/verifier/structurals/OperandStack.java    |  132 +-
 .../bcel/verifier/structurals/Pass3bVerifier.java  |   64 +-
 .../bcel/verifier/structurals/Subroutine.java      |   48 +-
 .../bcel/verifier/structurals/Subroutines.java     |  456 ++---
 .../structurals/UninitializedObjectType.java       |   26 +-
 .../bcel/AbstractCounterVisitorTestCase.java       |   16 +-
 .../java/org/apache/bcel/AbstractTestCase.java     |  166 +-
 .../org/apache/bcel/AnonymousClassTestCase.java    |   26 +-
 .../org/apache/bcel/CounterVisitorTestCase.java    |   12 +-
 .../org/apache/bcel/ElementValueGenTestCase.java   |  152 +-
 .../bcel/EnclosingMethodAttributeTestCase.java     |   46 +-
 .../bcel/LocalVariableTypeTableTestCase.java       |   82 +-
 src/test/java/org/apache/bcel/NanoTimer.java       |    8 +-
 src/test/java/org/apache/bcel/PLSETestCase.java    |   38 +-
 .../bcel/classfile/ConstantPoolTestCase.java       |   12 +-
 .../bcel/classfile/JDKClassDumpTestCase.java       |   50 +-
 .../bcel/data/AnnotatedWithCombinedAnnotation.java |    8 +-
 .../org/apache/bcel/data/AnonymousClassTest.java   |   16 +-
 .../apache/bcel/data/AttributeTestClassEM02.java   |    8 +-
 .../org/apache/bcel/data/ComplexAnnotation.java    |   12 +-
 .../java/org/apache/bcel/data/ConstantPoolX.java   |   56 +-
 .../org/apache/bcel/data/SimpleAnnotation.java     |    4 +-
 .../apache/bcel/generic/AnnotationGenTestCase.java |   50 +-
 .../apache/bcel/generic/BranchHandleTestCase.java  |   14 +-
 .../bcel/generic/FieldAnnotationsTestCase.java     |   52 +-
 .../GeneratingAnnotatedClassesTestCase.java        |  654 +++----
 .../bcel/generic/InstructionHandleTestCase.java    |   28 +-
 .../bcel/generic/JdkGenericDumpTestCase.java       |   40 +-
 .../org/apache/bcel/generic/MethodGenTestCase.java |   36 +-
 .../org/apache/bcel/util/Class2HTMLTestCase.java   |    3 +-
 .../bcel/util/ClassPathRepositoryTestCase.java     |   72 +-
 .../bcel/util/ModularRuntimeImageTestCase.java     |   16 +-
 .../bcel/verifier/VerifierInvokeTestCase.java      |   20 +-
 .../bcel/verifier/VerifyBadClassesTestCase.java    |  140 +-
 .../apache/bcel/verifier/tests/TestArray01.java    |    8 +-
 .../apache/bcel/verifier/tests/TestCreator.java    |   20 +-
 .../verifier/tests/TestLegalInvokeInterface01.java |    8 +-
 .../apache/bcel/verifier/tests/TestReturn02.java   |   16 +-
 .../org/apache/bcel/visitors/CounterVisitor.java   |  192 +--
 267 files changed, 15291 insertions(+), 15283 deletions(-)


[commons-bcel] 02/08: Add spotbugs:check to the default Maven goal. Revert "Add spotbugs:check to the default Maven goal."

Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-bcel.git

commit 9f188870edb80c9e3d26a858d8629e396299a932
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun May 1 08:55:22 2022 -0400

    Add spotbugs:check to the default Maven goal.
    Revert "Add spotbugs:check to the default Maven goal."
    
    This reverts commit ac0c27169c7d07907b7e9e36fb7a8addfdd7ccd2.


[commons-bcel] 07/08: Use camel-case.

Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-bcel.git

commit db3b0e1ffe5ad6dd154cd032a3faf454eef4acdc
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun May 1 14:27:06 2022 -0400

    Use camel-case.
---
 src/main/java/org/apache/bcel/util/Class2HTML.java | 122 ++++++++++-----------
 1 file changed, 61 insertions(+), 61 deletions(-)

diff --git a/src/main/java/org/apache/bcel/util/Class2HTML.java b/src/main/java/org/apache/bcel/util/Class2HTML.java
index de048d16..ef56ab14 100644
--- a/src/main/java/org/apache/bcel/util/Class2HTML.java
+++ b/src/main/java/org/apache/bcel/util/Class2HTML.java
@@ -55,27 +55,27 @@ import org.apache.bcel.classfile.Utility;
  */
 public class Class2HTML implements Constants {
 
-    private static String class_package; // name of package, unclean to make it static, but ...
-    private static String class_name; // name of current class, dito
-    private static ConstantPool constant_pool;
-    private static final Set<String> basic_types = new HashSet<>();
+    private static String classPackage; // name of package, unclean to make it static, but ...
+    private static String className; // name of current class, dito
+    private static ConstantPool constantPool;
+    private static final Set<String> basicTypes = new HashSet<>();
     static {
-        basic_types.add("int");
-        basic_types.add("short");
-        basic_types.add("boolean");
-        basic_types.add("void");
-        basic_types.add("char");
-        basic_types.add("byte");
-        basic_types.add("long");
-        basic_types.add("double");
-        basic_types.add("float");
+        basicTypes.add("int");
+        basicTypes.add("short");
+        basicTypes.add("boolean");
+        basicTypes.add("void");
+        basicTypes.add("char");
+        basicTypes.add("byte");
+        basicTypes.add("long");
+        basicTypes.add("double");
+        basicTypes.add("float");
     }
     public static void main( final String[] argv ) throws IOException {
-        final String[] file_name = new String[argv.length];
+        final String[] fileName = new String[argv.length];
         int files = 0;
         ClassParser parser = null;
-        JavaClass java_class = null;
-        String zip_file = null;
+        JavaClass javaClass = null;
+        String zipFile = null;
         final char sep = File.separatorChar;
         String dir = "." + sep; // Where to store HTML files
         /* Parse command line arguments.
@@ -95,26 +95,26 @@ public class Class2HTML implements Constants {
                         }
                     }
                 } else if (argv[i].equals("-zip")) {
-                    zip_file = argv[++i];
+                    zipFile = argv[++i];
                 } else {
                     System.out.println("Unknown option " + argv[i]);
                 }
             } else {
-                file_name[files++] = argv[i];
+                fileName[files++] = argv[i];
             }
         }
         if (files == 0) {
             System.err.println("Class2HTML: No input files specified.");
         } else { // Loop through files ...
             for (int i = 0; i < files; i++) {
-                System.out.print("Processing " + file_name[i] + "...");
-                if (zip_file == null) {
-                    parser = new ClassParser(file_name[i]); // Create parser object from file
+                System.out.print("Processing " + fileName[i] + "...");
+                if (zipFile == null) {
+                    parser = new ClassParser(fileName[i]); // Create parser object from file
                 } else {
-                    parser = new ClassParser(zip_file, file_name[i]); // Create parser object from zip file
+                    parser = new ClassParser(zipFile, fileName[i]); // Create parser object from zip file
                 }
-                java_class = parser.parse();
-                new Class2HTML(java_class, dir);
+                javaClass = parser.parse();
+                new Class2HTML(javaClass, dir);
                 System.out.println("Done.");
             }
         }
@@ -125,26 +125,26 @@ public class Class2HTML implements Constants {
      * i.e., an index to a string.
      */
     static String referenceClass( final int index ) {
-        String str = constant_pool.getConstantString(index, Const.CONSTANT_Class);
+        String str = constantPool.getConstantString(index, Const.CONSTANT_Class);
         str = Utility.compactClassName(str);
-        str = Utility.compactClassName(str, class_package + ".", true);
-        return "<A HREF=\"" + class_name + "_cp.html#cp" + index + "\" TARGET=ConstantPool>" + str
+        str = Utility.compactClassName(str, classPackage + ".", true);
+        return "<A HREF=\"" + className + "_cp.html#cp" + index + "\" TARGET=ConstantPool>" + str
                 + "</A>";
     }
 
     static String referenceType( final String type ) {
-        String short_type = Utility.compactClassName(type);
-        short_type = Utility.compactClassName(short_type, class_package + ".", true);
+        String shortType = Utility.compactClassName(type);
+        shortType = Utility.compactClassName(shortType, classPackage + ".", true);
         final int index = type.indexOf('['); // Type is an array?
-        String base_type = type;
+        String baseType = type;
         if (index > -1) {
-            base_type = type.substring(0, index); // Tack of the `['
+            baseType = type.substring(0, index); // Tack of the `['
         }
         // test for basic type
-        if (basic_types.contains(base_type)) {
+        if (basicTypes.contains(baseType)) {
             return "<FONT COLOR=\"#00FF00\">" + type + "</FONT>";
         }
-        return "<A HREF=\"" + base_type + ".html\" TARGET=_top>" + short_type + "</A>";
+        return "<A HREF=\"" + baseType + ".html\" TARGET=_top>" + shortType + "</A>";
     }
 
 
@@ -173,7 +173,7 @@ public class Class2HTML implements Constants {
     }
 
 
-    private final JavaClass java_class; // current class object
+    private final JavaClass javaClass; // current class object
 
 
     private final String dir;
@@ -182,54 +182,54 @@ public class Class2HTML implements Constants {
     /**
      * Write contents of the given JavaClass into HTML files.
      *
-     * @param java_class The class to write
+     * @param javaClass The class to write
      * @param dir The directory to put the files in
      */
-    public Class2HTML(final JavaClass java_class, final String dir) throws IOException {
-        final Method[] methods = java_class.getMethods();
-        this.java_class = java_class;
+    public Class2HTML(final JavaClass javaClass, final String dir) throws IOException {
+        final Method[] methods = javaClass.getMethods();
+        this.javaClass = javaClass;
         this.dir = dir;
-        class_name = java_class.getClassName(); // Remember full name
-        constant_pool = java_class.getConstantPool();
+        className = javaClass.getClassName(); // Remember full name
+        constantPool = javaClass.getConstantPool();
         // Get package name by tacking off everything after the last `.'
-        final int index = class_name.lastIndexOf('.');
+        final int index = className.lastIndexOf('.');
         if (index > -1) {
-            class_package = class_name.substring(0, index);
+            classPackage = className.substring(0, index);
         } else {
-            class_package = ""; // default package
+            classPackage = ""; // default package
         }
-        final ConstantHTML constant_html = new ConstantHTML(dir, class_name, class_package, methods,
-                constant_pool);
+        final ConstantHTML constantHtml = new ConstantHTML(dir, className, classPackage, methods,
+                constantPool);
         /* Attributes can't be written in one step, so we just open a file
          * which will be written consequently.
          */
-        final AttributeHTML attribute_html = new AttributeHTML(dir, class_name, constant_pool,
-                constant_html);
-        new MethodHTML(dir, class_name, methods, java_class.getFields(),
-                constant_html, attribute_html);
+        final AttributeHTML attributeHtml = new AttributeHTML(dir, className, constantPool,
+                constantHtml);
+        new MethodHTML(dir, className, methods, javaClass.getFields(),
+                constantHtml, attributeHtml);
         // Write main file (with frames, yuk)
-        writeMainHTML(attribute_html);
-        new CodeHTML(dir, class_name, methods, constant_pool, constant_html);
-        attribute_html.close();
+        writeMainHTML(attributeHtml);
+        new CodeHTML(dir, className, methods, constantPool, constantHtml);
+        attributeHtml.close();
     }
 
 
-    private void writeMainHTML( final AttributeHTML attribute_html ) throws IOException {
-        try (PrintWriter file = new PrintWriter(new FileOutputStream(dir + class_name + ".html"))) {
-            file.println("<HTML>\n" + "<HEAD><TITLE>Documentation for " + class_name + "</TITLE>" + "</HEAD>\n"
+    private void writeMainHTML( final AttributeHTML attributeHtml ) throws IOException {
+        try (PrintWriter file = new PrintWriter(new FileOutputStream(dir + className + ".html"))) {
+            file.println("<HTML>\n" + "<HEAD><TITLE>Documentation for " + className + "</TITLE>" + "</HEAD>\n"
                     + "<FRAMESET BORDER=1 cols=\"30%,*\">\n" + "<FRAMESET BORDER=1 rows=\"80%,*\">\n"
-                    + "<FRAME NAME=\"ConstantPool\" SRC=\"" + class_name + "_cp.html" + "\"\n MARGINWIDTH=\"0\" "
+                    + "<FRAME NAME=\"ConstantPool\" SRC=\"" + className + "_cp.html" + "\"\n MARGINWIDTH=\"0\" "
                     + "MARGINHEIGHT=\"0\" FRAMEBORDER=\"1\" SCROLLING=\"AUTO\">\n" + "<FRAME NAME=\"Attributes\" SRC=\""
-                    + class_name + "_attributes.html" + "\"\n MARGINWIDTH=\"0\" "
+                    + className + "_attributes.html" + "\"\n MARGINWIDTH=\"0\" "
                     + "MARGINHEIGHT=\"0\" FRAMEBORDER=\"1\" SCROLLING=\"AUTO\">\n" + "</FRAMESET>\n"
-                    + "<FRAMESET BORDER=1 rows=\"80%,*\">\n" + "<FRAME NAME=\"Code\" SRC=\"" + class_name
+                    + "<FRAMESET BORDER=1 rows=\"80%,*\">\n" + "<FRAME NAME=\"Code\" SRC=\"" + className
                     + "_code.html\"\n MARGINWIDTH=0 " + "MARGINHEIGHT=0 FRAMEBORDER=1 SCROLLING=\"AUTO\">\n"
-                    + "<FRAME NAME=\"Methods\" SRC=\"" + class_name + "_methods.html\"\n MARGINWIDTH=0 "
+                    + "<FRAME NAME=\"Methods\" SRC=\"" + className + "_methods.html\"\n MARGINWIDTH=0 "
                     + "MARGINHEIGHT=0 FRAMEBORDER=1 SCROLLING=\"AUTO\">\n" + "</FRAMESET></FRAMESET></HTML>");
         }
-        final Attribute[] attributes = java_class.getAttributes();
+        final Attribute[] attributes = javaClass.getAttributes();
         for (int i = 0; i < attributes.length; i++) {
-            attribute_html.writeAttribute(attributes[i], "class" + i);
+            attributeHtml.writeAttribute(attributes[i], "class" + i);
         }
     }
 }


[commons-bcel] 04/08: Fix SpotBugs [ERROR] High: Found reliance on default encoding

Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-bcel.git

commit 94d31f8e85316329a13dd9a413ca284da502b09b
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun May 1 14:07:36 2022 -0400

    Fix SpotBugs [ERROR] High: Found reliance on default encoding
---
 src/main/java/org/apache/bcel/classfile/Signature.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/apache/bcel/classfile/Signature.java b/src/main/java/org/apache/bcel/classfile/Signature.java
index a9157061..8dbda61a 100644
--- a/src/main/java/org/apache/bcel/classfile/Signature.java
+++ b/src/main/java/org/apache/bcel/classfile/Signature.java
@@ -21,6 +21,7 @@ import java.io.ByteArrayInputStream;
 import java.io.DataInput;
 import java.io.DataOutputStream;
 import java.io.IOException;
+import java.nio.charset.StandardCharsets;
 
 import org.apache.bcel.Const;
 
@@ -38,12 +39,12 @@ public final class Signature extends Attribute {
     private static final class MyByteArrayInputStream extends ByteArrayInputStream {
 
         MyByteArrayInputStream(final String data) {
-            super(data.getBytes());
+            super(data.getBytes(StandardCharsets.UTF_8));
         }
 
 
         String getData() {
-            return new String(buf);
+            return new String(buf, StandardCharsets.UTF_8);
         }
 
 


[commons-bcel] 08/08: Fix SpotBugs [ERROR] High: Found reliance on default encoding

Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-bcel.git

commit 5a4b4fc17be8df08871649f87a16bdc8054f13ed
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun May 1 14:45:53 2022 -0400

    Fix SpotBugs [ERROR] High: Found reliance on default encoding
---
 .../java/org/apache/bcel/util/AttributeHTML.java   | 73 +++++++++++-----------
 src/main/java/org/apache/bcel/util/Class2HTML.java | 21 ++++---
 src/main/java/org/apache/bcel/util/CodeHTML.java   | 49 ++++++++-------
 .../java/org/apache/bcel/util/ConstantHTML.java    | 39 ++++++------
 src/main/java/org/apache/bcel/util/MethodHTML.java | 48 +++++++-------
 .../org/apache/bcel/util/Class2HTMLTestCase.java   |  3 +-
 6 files changed, 120 insertions(+), 113 deletions(-)

diff --git a/src/main/java/org/apache/bcel/util/AttributeHTML.java b/src/main/java/org/apache/bcel/util/AttributeHTML.java
index f44771ab..27728944 100644
--- a/src/main/java/org/apache/bcel/util/AttributeHTML.java
+++ b/src/main/java/org/apache/bcel/util/AttributeHTML.java
@@ -17,9 +17,9 @@
  */
 package org.apache.bcel.util;
 
-import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.PrintWriter;
+import java.nio.charset.Charset;
 
 import org.apache.bcel.Const;
 import org.apache.bcel.classfile.Attribute;
@@ -40,31 +40,32 @@ import org.apache.bcel.classfile.Utility;
 
 /**
  * Convert found attributes into HTML file.
- *
- *
  */
 final class AttributeHTML {
 
     private final String class_name; // name of current class
-    private final PrintWriter file; // file to write to
+    private final PrintWriter printWriter; // file to write to
     private int attr_count;
     private final ConstantHTML constant_html;
     private final ConstantPool constant_pool;
 
 
     AttributeHTML(final String dir, final String class_name, final ConstantPool constant_pool,
-            final ConstantHTML constant_html) throws IOException {
+        final ConstantHTML constant_html, final Charset charset) throws IOException {
         this.class_name = class_name;
         this.constant_pool = constant_pool;
         this.constant_html = constant_html;
-        file = new PrintWriter(new FileOutputStream(dir + class_name + "_attributes.html"));
-        file.println("<HTML><BODY BGCOLOR=\"#C0C0C0\"><TABLE BORDER=0>");
+        printWriter = new PrintWriter(dir + class_name + "_attributes.html", charset.name());
+        printWriter.print("<HTML><head><meta charset=\"");
+        printWriter.print(charset.name());
+        printWriter.println("\"></head>");
+        printWriter.println("<BODY BGCOLOR=\"#C0C0C0\"><TABLE BORDER=0>");
     }
 
 
     void close() {
-        file.println("</TABLE></BODY></HTML>");
-        file.close();
+        printWriter.println("</TABLE></BODY></HTML>");
+        printWriter.close();
     }
 
 
@@ -87,11 +88,11 @@ final class AttributeHTML {
         }
         attr_count++; // Increment number of attributes found so far
         if (attr_count % 2 == 0) {
-            file.print("<TR BGCOLOR=\"#C0C0C0\"><TD>");
+            printWriter.print("<TR BGCOLOR=\"#C0C0C0\"><TD>");
         } else {
-            file.print("<TR BGCOLOR=\"#A0A0A0\"><TD>");
+            printWriter.print("<TR BGCOLOR=\"#A0A0A0\"><TD>");
         }
-        file.println("<H4><A NAME=\"" + anchor + "\">" + attr_count + " " + Const.getAttributeName(tag)
+        printWriter.println("<H4><A NAME=\"" + anchor + "\">" + attr_count + " " + Const.getAttributeName(tag)
                 + "</A></H4>");
         /* Handle different attributes
          */
@@ -99,7 +100,7 @@ final class AttributeHTML {
             case Const.ATTR_CODE:
                 final Code c = (Code) attribute;
                 // Some directly printable values
-                file.print("<UL><LI>Maximum stack size = " + c.getMaxStack()
+                printWriter.print("<UL><LI>Maximum stack size = " + c.getMaxStack()
                         + "</LI>\n<LI>Number of local variables = " + c.getMaxLocals()
                         + "</LI>\n<LI><A HREF=\"" + class_name + "_code.html#method"
                         + method_number + "\" TARGET=Code>Byte code</A></LI></UL>\n");
@@ -107,63 +108,63 @@ final class AttributeHTML {
                 final CodeException[] ce = c.getExceptionTable();
                 final int len = ce.length;
                 if (len > 0) {
-                    file.print("<P><B>Exceptions handled</B><UL>");
+                    printWriter.print("<P><B>Exceptions handled</B><UL>");
                     for (final CodeException cex : ce) {
                         final int catch_type = cex.getCatchType(); // Index in constant pool
-                        file.print("<LI>");
+                        printWriter.print("<LI>");
                         if (catch_type != 0) {
-                            file.print(constant_html.referenceConstant(catch_type)); // Create Link to _cp.html
+                            printWriter.print(constant_html.referenceConstant(catch_type)); // Create Link to _cp.html
                         } else {
-                            file.print("Any Exception");
+                            printWriter.print("Any Exception");
                         }
-                        file.print("<BR>(Ranging from lines "
+                        printWriter.print("<BR>(Ranging from lines "
                                 + codeLink(cex.getStartPC(), method_number) + " to "
                                 + codeLink(cex.getEndPC(), method_number) + ", handled at line "
                                 + codeLink(cex.getHandlerPC(), method_number) + ")</LI>");
                     }
-                    file.print("</UL>");
+                    printWriter.print("</UL>");
                 }
                 break;
             case Const.ATTR_CONSTANT_VALUE:
                 index = ((ConstantValue) attribute).getConstantValueIndex();
                 // Reference _cp.html
-                file.print("<UL><LI><A HREF=\"" + class_name + "_cp.html#cp" + index
+                printWriter.print("<UL><LI><A HREF=\"" + class_name + "_cp.html#cp" + index
                         + "\" TARGET=\"ConstantPool\">Constant value index(" + index
                         + ")</A></UL>\n");
                 break;
             case Const.ATTR_SOURCE_FILE:
                 index = ((SourceFile) attribute).getSourceFileIndex();
                 // Reference _cp.html
-                file.print("<UL><LI><A HREF=\"" + class_name + "_cp.html#cp" + index
+                printWriter.print("<UL><LI><A HREF=\"" + class_name + "_cp.html#cp" + index
                         + "\" TARGET=\"ConstantPool\">Source file index(" + index + ")</A></UL>\n");
                 break;
             case Const.ATTR_EXCEPTIONS:
                 // List thrown exceptions
                 final int[] indices = ((ExceptionTable) attribute).getExceptionIndexTable();
-                file.print("<UL>");
+                printWriter.print("<UL>");
                 for (final int indice : indices) {
-                    file.print("<LI><A HREF=\"" + class_name + "_cp.html#cp" + indice
+                    printWriter.print("<LI><A HREF=\"" + class_name + "_cp.html#cp" + indice
                             + "\" TARGET=\"ConstantPool\">Exception class index(" + indice
                             + ")</A>\n");
                 }
-                file.print("</UL>\n");
+                printWriter.print("</UL>\n");
                 break;
             case Const.ATTR_LINE_NUMBER_TABLE:
                 final LineNumber[] line_numbers = ((LineNumberTable) attribute).getLineNumberTable();
                 // List line number pairs
-                file.print("<P>");
+                printWriter.print("<P>");
                 for (int i = 0; i < line_numbers.length; i++) {
-                    file.print("(" + line_numbers[i].getStartPC() + ",&nbsp;"
+                    printWriter.print("(" + line_numbers[i].getStartPC() + ",&nbsp;"
                             + line_numbers[i].getLineNumber() + ")");
                     if (i < line_numbers.length - 1) {
-                        file.print(", "); // breakable
+                        printWriter.print(", "); // breakable
                     }
                 }
                 break;
             case Const.ATTR_LOCAL_VARIABLE_TABLE:
                 final LocalVariable[] vars = ((LocalVariableTable) attribute).getLocalVariableTable();
                 // List name, range and type
-                file.print("<UL>");
+                printWriter.print("<UL>");
                 for (final LocalVariable var : vars) {
                     index = var.getSignatureIndex();
                     String signature = ((ConstantUtf8) constant_pool.getConstant(index,
@@ -171,19 +172,19 @@ final class AttributeHTML {
                     signature = Utility.signatureToString(signature, false);
                     final int start = var.getStartPC();
                     final int end = start + var.getLength();
-                    file.println("<LI>" + Class2HTML.referenceType(signature) + "&nbsp;<B>"
+                    printWriter.println("<LI>" + Class2HTML.referenceType(signature) + "&nbsp;<B>"
                             + var.getName() + "</B> in slot %" + var.getIndex()
                             + "<BR>Valid from lines " + "<A HREF=\"" + class_name
                             + "_code.html#code" + method_number + "@" + start + "\" TARGET=Code>"
                             + start + "</A> to " + "<A HREF=\"" + class_name + "_code.html#code"
                             + method_number + "@" + end + "\" TARGET=Code>" + end + "</A></LI>");
                 }
-                file.print("</UL>\n");
+                printWriter.print("</UL>\n");
                 break;
             case Const.ATTR_INNER_CLASSES:
                 final InnerClass[] classes = ((InnerClasses) attribute).getInnerClasses();
                 // List inner classes
-                file.print("<UL>");
+                printWriter.print("<UL>");
                 for (final InnerClass classe : classes) {
                     final String name;
                     final String access;
@@ -195,18 +196,18 @@ final class AttributeHTML {
                         name = "&lt;anonymous&gt;";
                     }
                     access = Utility.accessToString(classe.getInnerAccessFlags());
-                    file.print("<LI><FONT COLOR=\"#FF0000\">" + access + "</FONT> "
+                    printWriter.print("<LI><FONT COLOR=\"#FF0000\">" + access + "</FONT> "
                             + constant_html.referenceConstant(classe.getInnerClassIndex())
                             + " in&nbsp;class "
                             + constant_html.referenceConstant(classe.getOuterClassIndex())
                             + " named " + name + "</LI>\n");
                 }
-                file.print("</UL>\n");
+                printWriter.print("</UL>\n");
                 break;
             default: // Such as Unknown attribute or Deprecated
-                file.print("<P>" + attribute);
+                printWriter.print("<P>" + attribute);
         }
-        file.println("</TD></TR>");
-        file.flush();
+        printWriter.println("</TD></TR>");
+        printWriter.flush();
     }
 }
diff --git a/src/main/java/org/apache/bcel/util/Class2HTML.java b/src/main/java/org/apache/bcel/util/Class2HTML.java
index ef56ab14..c987ae89 100644
--- a/src/main/java/org/apache/bcel/util/Class2HTML.java
+++ b/src/main/java/org/apache/bcel/util/Class2HTML.java
@@ -21,6 +21,8 @@ import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.PrintWriter;
+import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
 import java.util.HashSet;
 import java.util.Set;
 
@@ -186,6 +188,10 @@ public class Class2HTML implements Constants {
      * @param dir The directory to put the files in
      */
     public Class2HTML(final JavaClass javaClass, final String dir) throws IOException {
+        this(javaClass, dir, StandardCharsets.UTF_8);
+    }
+
+    private Class2HTML(final JavaClass javaClass, final String dir, final Charset charset) throws IOException {
         final Method[] methods = javaClass.getMethods();
         this.javaClass = javaClass;
         this.dir = dir;
@@ -198,18 +204,15 @@ public class Class2HTML implements Constants {
         } else {
             classPackage = ""; // default package
         }
-        final ConstantHTML constantHtml = new ConstantHTML(dir, className, classPackage, methods,
-                constantPool);
-        /* Attributes can't be written in one step, so we just open a file
-         * which will be written consequently.
+        final ConstantHTML constantHtml = new ConstantHTML(dir, className, classPackage, methods, constantPool, charset);
+        /*
+         * Attributes can't be written in one step, so we just open a file which will be written consequently.
          */
-        final AttributeHTML attributeHtml = new AttributeHTML(dir, className, constantPool,
-                constantHtml);
-        new MethodHTML(dir, className, methods, javaClass.getFields(),
-                constantHtml, attributeHtml);
+        final AttributeHTML attributeHtml = new AttributeHTML(dir, className, constantPool, constantHtml, charset);
+        new MethodHTML(dir, className, methods, javaClass.getFields(), constantHtml, attributeHtml, charset);
         // Write main file (with frames, yuk)
         writeMainHTML(attributeHtml);
-        new CodeHTML(dir, className, methods, constantPool, constantHtml);
+        new CodeHTML(dir, className, methods, constantPool, constantHtml, charset);
         attributeHtml.close();
     }
 
diff --git a/src/main/java/org/apache/bcel/util/CodeHTML.java b/src/main/java/org/apache/bcel/util/CodeHTML.java
index 543af9a0..4519699a 100644
--- a/src/main/java/org/apache/bcel/util/CodeHTML.java
+++ b/src/main/java/org/apache/bcel/util/CodeHTML.java
@@ -17,9 +17,9 @@
  */
 package org.apache.bcel.util;
 
-import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.PrintWriter;
+import java.nio.charset.Charset;
 import java.util.BitSet;
 
 import org.apache.bcel.Const;
@@ -39,33 +39,34 @@ import org.apache.bcel.classfile.Utility;
 
 /**
  * Convert code into HTML file.
- *
- *
  */
 final class CodeHTML {
 
     private static boolean wide;
 private final String className; // name of current class
     //    private Method[] methods; // Methods to print
-    private final PrintWriter file; // file to write to
+    private final PrintWriter printWriter; // file to write to
     private BitSet gotoSet;
     private final ConstantPool constantPool;
     private final ConstantHTML constantHtml;
 
 
     CodeHTML(final String dir, final String class_name, final Method[] methods, final ConstantPool constant_pool,
-            final ConstantHTML constant_html) throws IOException {
+            final ConstantHTML constant_html, final Charset charset) throws IOException {
         this.className = class_name;
 //        this.methods = methods;
         this.constantPool = constant_pool;
         this.constantHtml = constant_html;
-        file = new PrintWriter(new FileOutputStream(dir + class_name + "_code.html"));
-        file.println("<HTML><BODY BGCOLOR=\"#C0C0C0\">");
+        printWriter = new PrintWriter(dir + class_name + "_code.html", charset.name());
+        printWriter.print("<HTML><head><meta charset=\"");
+        printWriter.print(charset.name());
+        printWriter.println("\"></head>");
+        printWriter.println("<BODY BGCOLOR=\"#C0C0C0\">");
         for (int i = 0; i < methods.length; i++) {
             writeMethod(methods[i], i);
         }
-        file.println("</BODY></HTML>");
-        file.close();
+        printWriter.println("</BODY></HTML>");
+        printWriter.close();
     }
 
 
@@ -505,45 +506,45 @@ private final String className; // name of current class
         access = Utility.replace(access, " ", "&nbsp;");
         // Get the method's attributes, the Code Attribute in particular
         final Attribute[] attributes = method.getAttributes();
-        file.print("<P><B><FONT COLOR=\"#FF0000\">" + access + "</FONT>&nbsp;" + "<A NAME=method"
+        printWriter.print("<P><B><FONT COLOR=\"#FF0000\">" + access + "</FONT>&nbsp;" + "<A NAME=method"
                 + method_number + ">" + Class2HTML.referenceType(type) + "</A>&nbsp<A HREF=\""
                 + className + "_methods.html#method" + method_number + "\" TARGET=Methods>"
                 + html_name + "</A>(");
         for (int i = 0; i < args.length; i++) {
-            file.print(Class2HTML.referenceType(args[i]));
+            printWriter.print(Class2HTML.referenceType(args[i]));
             if (i < args.length - 1) {
-                file.print(",&nbsp;");
+                printWriter.print(",&nbsp;");
             }
         }
-        file.println(")</B></P>");
+        printWriter.println(")</B></P>");
         Code c = null;
         byte[] code = null;
         if (attributes.length > 0) {
-            file.print("<H4>Attributes</H4><UL>\n");
+            printWriter.print("<H4>Attributes</H4><UL>\n");
             for (int i = 0; i < attributes.length; i++) {
                 byte tag = attributes[i].getTag();
                 if (tag != Const.ATTR_UNKNOWN) {
-                    file.print("<LI><A HREF=\"" + className + "_attributes.html#method"
+                    printWriter.print("<LI><A HREF=\"" + className + "_attributes.html#method"
                             + method_number + "@" + i + "\" TARGET=Attributes>"
                             + Const.getAttributeName(tag) + "</A></LI>\n");
                 } else {
-                    file.print("<LI>" + attributes[i] + "</LI>");
+                    printWriter.print("<LI>" + attributes[i] + "</LI>");
                 }
                 if (tag == Const.ATTR_CODE) {
                     c = (Code) attributes[i];
                     final Attribute[] attributes2 = c.getAttributes();
                     code = c.getCode();
-                    file.print("<UL>");
+                    printWriter.print("<UL>");
                     for (int j = 0; j < attributes2.length; j++) {
                         tag = attributes2[j].getTag();
-                        file.print("<LI><A HREF=\"" + className + "_attributes.html#" + "method"
+                        printWriter.print("<LI><A HREF=\"" + className + "_attributes.html#" + "method"
                                 + method_number + "@" + i + "@" + j + "\" TARGET=Attributes>"
                                 + Const.getAttributeName(tag) + "</A></LI>\n");
                     }
-                    file.print("</UL>");
+                    printWriter.print("</UL>");
                 }
             }
-            file.println("</UL>");
+            printWriter.println("</UL>");
         }
         if (code != null) { // No code, an abstract method, e.g.
             //System.out.println(name + "\n" + Utility.codeToString(code, constantPool, 0, -1));
@@ -552,7 +553,7 @@ private final String className; // name of current class
                 stream.mark(stream.available());
                 findGotos(stream, c);
                 stream.reset();
-                file.println("<TABLE BORDER=0><TR><TH ALIGN=LEFT>Byte<BR>offset</TH>"
+                printWriter.println("<TABLE BORDER=0><TR><TH ALIGN=LEFT>Byte<BR>offset</TH>"
                         + "<TH ALIGN=LEFT>Instruction</TH><TH ALIGN=LEFT>Argument</TH>");
                 for (; stream.available() > 0;) {
                     final int offset = stream.getIndex();
@@ -571,12 +572,12 @@ private final String className; // name of current class
                     } else {
                         anchor2 = "" + offset;
                     }
-                    file.println("<TR VALIGN=TOP><TD>" + anchor2 + "</TD><TD>" + anchor + str + "</TR>");
+                    printWriter.println("<TR VALIGN=TOP><TD>" + anchor2 + "</TD><TD>" + anchor + str + "</TR>");
                 }
             }
             // Mark last line, may be targetted from Attributes window
-            file.println("<TR><TD> </A></TD></TR>");
-            file.println("</TABLE>");
+            printWriter.println("<TR><TD> </A></TD></TR>");
+            printWriter.println("</TABLE>");
         }
     }
 }
diff --git a/src/main/java/org/apache/bcel/util/ConstantHTML.java b/src/main/java/org/apache/bcel/util/ConstantHTML.java
index 5bfaa8da..bc1f9f3b 100644
--- a/src/main/java/org/apache/bcel/util/ConstantHTML.java
+++ b/src/main/java/org/apache/bcel/util/ConstantHTML.java
@@ -17,9 +17,9 @@
  */
 package org.apache.bcel.util;
 
-import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.PrintWriter;
+import java.nio.charset.Charset;
 
 import org.apache.bcel.Const;
 import org.apache.bcel.classfile.Constant;
@@ -35,45 +35,46 @@ import org.apache.bcel.classfile.Utility;
 
 /**
  * Convert constant pool into HTML file.
- *
- *
  */
 final class ConstantHTML {
 
     private final String className; // name of current class
     private final String classPackage; // name of package
     private final ConstantPool constantPool; // reference to constant pool
-    private final PrintWriter file; // file to write to
+    private final PrintWriter printWriter; // file to write to
     private final String[] constantRef; // String to return for cp[i]
     private final Constant[] constants; // The constants in the cp
     private final Method[] methods;
 
 
     ConstantHTML(final String dir, final String class_name, final String class_package, final Method[] methods,
-            final ConstantPool constant_pool) throws IOException {
+        final ConstantPool constant_pool, final Charset charset) throws IOException {
         this.className = class_name;
         this.classPackage = class_package;
         this.constantPool = constant_pool;
         this.methods = methods;
         constants = constant_pool.getConstantPool();
-        file = new PrintWriter(new FileOutputStream(dir + class_name + "_cp.html"));
+        printWriter = new PrintWriter(dir + class_name + "_cp.html", charset.name());
         constantRef = new String[constants.length];
         constantRef[0] = "&lt;unknown&gt;";
-        file.println("<HTML><BODY BGCOLOR=\"#C0C0C0\"><TABLE BORDER=0>");
+        printWriter.print("<HTML><head><meta charset=\"");
+        printWriter.print(charset.name());
+        printWriter.println("\"></head>");
+        printWriter.println("<BODY BGCOLOR=\"#C0C0C0\"><TABLE BORDER=0>");
         // Loop through constants, constants[0] is reserved
         for (int i = 1; i < constants.length; i++) {
             if (i % 2 == 0) {
-                file.print("<TR BGCOLOR=\"#C0C0C0\"><TD>");
+                printWriter.print("<TR BGCOLOR=\"#C0C0C0\"><TD>");
             } else {
-                file.print("<TR BGCOLOR=\"#A0A0A0\"><TD>");
+                printWriter.print("<TR BGCOLOR=\"#A0A0A0\"><TD>");
             }
             if (constants[i] != null) {
                 writeConstant(i);
             }
-            file.print("</TD></TR>\n");
+            printWriter.print("</TD></TR>\n");
         }
-        file.println("</TABLE></BODY></HTML>");
-        file.close();
+        printWriter.println("</TABLE></BODY></HTML>");
+        printWriter.close();
     }
 
 
@@ -99,7 +100,7 @@ final class ConstantHTML {
         int name_index;
         String ref;
         // The header is always the same
-        file.println("<H4> <A NAME=cp" + index + ">" + index + "</A> " + Const.getConstantName(tag)
+        printWriter.println("<H4> <A NAME=cp" + index + ">" + index + "</A> " + Const.getConstantName(tag)
                 + "</H4>");
         /* For every constant type get the needed parameters and print them appropiately
          */
@@ -158,7 +159,7 @@ final class ConstantHTML {
                         + class_index + "\" TARGET=Constants>" + short_method_class
                         + "</A>.<A HREF=\"" + className + "_cp.html#cp" + index
                         + "\" TARGET=ConstantPool>" + html_method_name + "</A>&nbsp;" + arg_types;
-                file.println("<P><TT>" + ret_type + "&nbsp;" + ref + arg_types
+                printWriter.println("<P><TT>" + ret_type + "&nbsp;" + ref + arg_types
                         + "&nbsp;</TT>\n<UL>" + "<LI><A HREF=\"#cp" + class_index
                         + "\">Class index(" + class_index + ")</A>\n" + "<LI><A HREF=\"#cp"
                         + name_index + "\">NameAndType index(" + name_index + ")</A></UL>");
@@ -187,7 +188,7 @@ final class ConstantHTML {
                         + "\" TARGET=Constants>" + short_field_class + "</A>.<A HREF=\""
                         + className + "_cp.html#cp" + index + "\" TARGET=ConstantPool>"
                         + field_name + "</A>";
-                file.println("<P><TT>" + ref + "</TT><BR>\n" + "<UL>" + "<LI><A HREF=\"#cp"
+                printWriter.println("<P><TT>" + ref + "</TT><BR>\n" + "<UL>" + "<LI><A HREF=\"#cp"
                         + class_index + "\">Class(" + class_index + ")</A><BR>\n"
                         + "<LI><A HREF=\"#cp" + name_index + "\">NameAndType(" + name_index
                         + ")</A></UL>");
@@ -203,7 +204,7 @@ final class ConstantHTML {
                         + "</A>";
                 constantRef[index] = "<A HREF=\"" + className + "_cp.html#cp" + index
                         + "\" TARGET=ConstantPool>" + short_class_name + "</A>";
-                file.println("<P><TT>" + ref + "</TT><UL>" + "<LI><A HREF=\"#cp" + name_index
+                printWriter.println("<P><TT>" + ref + "</TT><UL>" + "<LI><A HREF=\"#cp" + name_index
                         + "\">Name index(" + name_index + ")</A></UL>\n");
                 break;
             case Const.CONSTANT_String:
@@ -211,7 +212,7 @@ final class ConstantHTML {
                         Const.CONSTANT_String);
                 name_index = c5.getStringIndex();
                 final String str = Class2HTML.toHTML(constantPool.constantToString(index, tag));
-                file.println("<P><TT>" + str + "</TT><UL>" + "<LI><A HREF=\"#cp" + name_index
+                printWriter.println("<P><TT>" + str + "</TT><UL>" + "<LI><A HREF=\"#cp" + name_index
                         + "\">Name index(" + name_index + ")</A></UL>\n");
                 break;
             case Const.CONSTANT_NameAndType:
@@ -219,14 +220,14 @@ final class ConstantHTML {
                         Const.CONSTANT_NameAndType);
                 name_index = c6.getNameIndex();
                 final int signature_index = c6.getSignatureIndex();
-                file.println("<P><TT>"
+                printWriter.println("<P><TT>"
                         + Class2HTML.toHTML(constantPool.constantToString(index, tag))
                         + "</TT><UL>" + "<LI><A HREF=\"#cp" + name_index + "\">Name index("
                         + name_index + ")</A>\n" + "<LI><A HREF=\"#cp" + signature_index
                         + "\">Signature index(" + signature_index + ")</A></UL>\n");
                 break;
             default:
-                file.println("<P><TT>" + Class2HTML.toHTML(constantPool.constantToString(index, tag)) + "</TT>\n");
+                printWriter.println("<P><TT>" + Class2HTML.toHTML(constantPool.constantToString(index, tag)) + "</TT>\n");
         } // switch
     }
 }
diff --git a/src/main/java/org/apache/bcel/util/MethodHTML.java b/src/main/java/org/apache/bcel/util/MethodHTML.java
index b83220a2..f85f7ece 100644
--- a/src/main/java/org/apache/bcel/util/MethodHTML.java
+++ b/src/main/java/org/apache/bcel/util/MethodHTML.java
@@ -20,6 +20,7 @@ package org.apache.bcel.util;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.PrintWriter;
+import java.nio.charset.Charset;
 
 import org.apache.bcel.Const;
 import org.apache.bcel.classfile.Attribute;
@@ -31,38 +32,39 @@ import org.apache.bcel.classfile.Utility;
 
 /**
  * Convert methods and fields into HTML file.
- *
- *
  */
 final class MethodHTML {
 
     private final String className; // name of current class
-    private final PrintWriter file; // file to write to
+    private final PrintWriter printWriter; // file to write to
     private final ConstantHTML constantHtml;
     private final AttributeHTML attribute_html;
 
 
     MethodHTML(final String dir, final String class_name, final Method[] methods, final Field[] fields,
-            final ConstantHTML constant_html, final AttributeHTML attribute_html) throws IOException {
+            final ConstantHTML constant_html, final AttributeHTML attribute_html, final Charset charset) throws IOException {
         this.className = class_name;
         this.attribute_html = attribute_html;
         this.constantHtml = constant_html;
-        file = new PrintWriter(new FileOutputStream(dir + class_name + "_methods.html"));
-        file.println("<HTML><BODY BGCOLOR=\"#C0C0C0\"><TABLE BORDER=0>");
-        file.println("<TR><TH ALIGN=LEFT>Access&nbsp;flags</TH><TH ALIGN=LEFT>Type</TH>"
+        printWriter = new PrintWriter(new FileOutputStream(dir + class_name + "_methods.html"));
+        printWriter.print("<HTML><head><meta charset=\"");
+        printWriter.print(charset.name());
+        printWriter.println("\"></head>");
+        printWriter.println("<BODY BGCOLOR=\"#C0C0C0\"><TABLE BORDER=0>");
+        printWriter.println("<TR><TH ALIGN=LEFT>Access&nbsp;flags</TH><TH ALIGN=LEFT>Type</TH>"
                 + "<TH ALIGN=LEFT>Field&nbsp;name</TH></TR>");
         for (final Field field : fields) {
             writeField(field);
         }
-        file.println("</TABLE>");
-        file.println("<TABLE BORDER=0><TR><TH ALIGN=LEFT>Access&nbsp;flags</TH>"
+        printWriter.println("</TABLE>");
+        printWriter.println("<TABLE BORDER=0><TR><TH ALIGN=LEFT>Access&nbsp;flags</TH>"
                 + "<TH ALIGN=LEFT>Return&nbsp;type</TH><TH ALIGN=LEFT>Method&nbsp;name</TH>"
                 + "<TH ALIGN=LEFT>Arguments</TH></TR>");
         for (int i = 0; i < methods.length; i++) {
             writeMethod(methods[i], i);
         }
-        file.println("</TABLE></BODY></HTML>");
-        file.close();
+        printWriter.println("</TABLE></BODY></HTML>");
+        printWriter.close();
     }
 
 
@@ -77,7 +79,7 @@ final class MethodHTML {
         String access = Utility.accessToString(field.getAccessFlags());
         Attribute[] attributes;
         access = Utility.replace(access, " ", "&nbsp;");
-        file.print("<TR><TD><FONT COLOR=\"#FF0000\">" + access + "</FONT></TD>\n<TD>"
+        printWriter.print("<TR><TD><FONT COLOR=\"#FF0000\">" + access + "</FONT></TD>\n<TD>"
                 + Class2HTML.referenceType(type) + "</TD><TD><A NAME=\"field" + name + "\">" + name
                 + "</A></TD>");
         attributes = field.getAttributes();
@@ -89,12 +91,12 @@ final class MethodHTML {
             if (attributes[i].getTag() == Const.ATTR_CONSTANT_VALUE) { // Default value
                 final String str = attributes[i].toString();
                 // Reference attribute in _attributes.html
-                file.print("<TD>= <A HREF=\"" + className + "_attributes.html#" + name + "@" + i
+                printWriter.print("<TD>= <A HREF=\"" + className + "_attributes.html#" + name + "@" + i
                         + "\" TARGET=\"Attributes\">" + str + "</TD>\n");
                 break;
             }
         }
-        file.println("</TR>");
+        printWriter.println("</TR>");
     }
 
 
@@ -117,33 +119,33 @@ final class MethodHTML {
          */
         access = Utility.replace(access, " ", "&nbsp;");
         html_name = Class2HTML.toHTML(name);
-        file.print("<TR VALIGN=TOP><TD><FONT COLOR=\"#FF0000\"><A NAME=method" + method_number
+        printWriter.print("<TR VALIGN=TOP><TD><FONT COLOR=\"#FF0000\"><A NAME=method" + method_number
                 + ">" + access + "</A></FONT></TD>");
-        file.print("<TD>" + Class2HTML.referenceType(type) + "</TD><TD>" + "<A HREF=" + className
+        printWriter.print("<TD>" + Class2HTML.referenceType(type) + "</TD><TD>" + "<A HREF=" + className
                 + "_code.html#method" + method_number + " TARGET=Code>" + html_name
                 + "</A></TD>\n<TD>(");
         for (int i = 0; i < args.length; i++) {
-            file.print(Class2HTML.referenceType(args[i]));
+            printWriter.print(Class2HTML.referenceType(args[i]));
             if (i < args.length - 1) {
-                file.print(", ");
+                printWriter.print(", ");
             }
         }
-        file.print(")</TD></TR>");
+        printWriter.print(")</TD></TR>");
         // Check for thrown exceptions
         for (int i = 0; i < attributes.length; i++) {
             attribute_html.writeAttribute(attributes[i], "method" + method_number + "@" + i,
                     method_number);
             final byte tag = attributes[i].getTag();
             if (tag == Const.ATTR_EXCEPTIONS) {
-                file.print("<TR VALIGN=TOP><TD COLSPAN=2></TD><TH ALIGN=LEFT>throws</TH><TD>");
+                printWriter.print("<TR VALIGN=TOP><TD COLSPAN=2></TD><TH ALIGN=LEFT>throws</TH><TD>");
                 final int[] exceptions = ((ExceptionTable) attributes[i]).getExceptionIndexTable();
                 for (int j = 0; j < exceptions.length; j++) {
-                    file.print(constantHtml.referenceConstant(exceptions[j]));
+                    printWriter.print(constantHtml.referenceConstant(exceptions[j]));
                     if (j < exceptions.length - 1) {
-                        file.print(", ");
+                        printWriter.print(", ");
                     }
                 }
-                file.println("</TD></TR>");
+                printWriter.println("</TD></TR>");
             } else if (tag == Const.ATTR_CODE) {
                 final Attribute[] c_a = ((Code) attributes[i]).getAttributes();
                 for (int j = 0; j < c_a.length; j++) {
diff --git a/src/test/java/org/apache/bcel/util/Class2HTMLTestCase.java b/src/test/java/org/apache/bcel/util/Class2HTMLTestCase.java
index 971e91d2..4a9e68fd 100644
--- a/src/test/java/org/apache/bcel/util/Class2HTMLTestCase.java
+++ b/src/test/java/org/apache/bcel/util/Class2HTMLTestCase.java
@@ -48,8 +48,7 @@ public class Class2HTMLTestCase {
     @Test
     public void testReferenceToConstant() {
         @SuppressWarnings("unused")
-        final
-        short referenceToConstant = Class2HTML.AALOAD;
+        final short referenceToConstant = Class2HTML.AALOAD;
     }
 
 }


[commons-bcel] 05/08: Remove unused exception from private method signature.

Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-bcel.git

commit 4e36acdf8551647caaf3659606de974eb9c41f77
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun May 1 14:10:31 2022 -0400

    Remove unused exception from private method signature.
---
 src/main/java/org/apache/bcel/util/MethodHTML.java | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/main/java/org/apache/bcel/util/MethodHTML.java b/src/main/java/org/apache/bcel/util/MethodHTML.java
index 183e8962..b83220a2 100644
--- a/src/main/java/org/apache/bcel/util/MethodHTML.java
+++ b/src/main/java/org/apache/bcel/util/MethodHTML.java
@@ -70,9 +70,8 @@ final class MethodHTML {
      * Print field of class.
      *
      * @param field field to print
-     * @throws java.io.IOException
      */
-    private void writeField( final Field field ) throws IOException {
+    private void writeField( final Field field ) {
         final String type = Utility.signatureToString(field.getSignature());
         final String name = field.getName();
         String access = Utility.accessToString(field.getAccessFlags());


[commons-bcel] 01/08: Sort members.

Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-bcel.git

commit 256386cc94299a71e0dd4dc999e4e2adf96e9238
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun May 1 08:51:14 2022 -0400

    Sort members.
---
 src/main/java/org/apache/bcel/Const.java           |  290 ++--
 src/main/java/org/apache/bcel/ExceptionConst.java  |   52 +-
 src/main/java/org/apache/bcel/Repository.java      |  226 +--
 .../org/apache/bcel/classfile/AccessFlags.java     |  176 +-
 .../apache/bcel/classfile/AnnotationDefault.java   |   28 +-
 .../bcel/classfile/AnnotationElementValue.java     |   10 +-
 .../org/apache/bcel/classfile/AnnotationEntry.java |   88 +-
 .../org/apache/bcel/classfile/Annotations.java     |   60 +-
 .../apache/bcel/classfile/ArrayElementValue.java   |   46 +-
 .../org/apache/bcel/classfile/BootstrapMethod.java |   64 +-
 .../apache/bcel/classfile/BootstrapMethods.java    |   28 +-
 .../apache/bcel/classfile/ClassElementValue.java   |   18 +-
 .../org/apache/bcel/classfile/ClassParser.java     |    2 +-
 src/main/java/org/apache/bcel/classfile/Code.java  |  158 +-
 .../org/apache/bcel/classfile/CodeException.java   |   46 +-
 .../java/org/apache/bcel/classfile/Constant.java   |  138 +-
 .../java/org/apache/bcel/classfile/ConstantCP.java |   40 +-
 .../org/apache/bcel/classfile/ConstantClass.java   |   30 +-
 .../org/apache/bcel/classfile/ConstantDouble.java  |   34 +-
 .../org/apache/bcel/classfile/ConstantFloat.java   |   34 +-
 .../org/apache/bcel/classfile/ConstantInteger.java |   34 +-
 .../org/apache/bcel/classfile/ConstantLong.java    |   34 +-
 .../bcel/classfile/ConstantMethodHandle.java       |   16 +-
 .../org/apache/bcel/classfile/ConstantModule.java  |   30 +-
 .../apache/bcel/classfile/ConstantNameAndType.java |   20 +-
 .../org/apache/bcel/classfile/ConstantPackage.java |   30 +-
 .../org/apache/bcel/classfile/ConstantPool.java    |   96 +-
 .../org/apache/bcel/classfile/ConstantString.java  |   32 +-
 .../org/apache/bcel/classfile/ConstantValue.java   |   22 +-
 .../java/org/apache/bcel/classfile/Deprecated.java |   30 +-
 .../apache/bcel/classfile/DescendingVisitor.java   |  512 +++---
 .../org/apache/bcel/classfile/ElementValue.java    |   70 +-
 .../apache/bcel/classfile/ElementValuePair.java    |   20 +-
 .../org/apache/bcel/classfile/EmptyVisitor.java    |  176 +-
 .../org/apache/bcel/classfile/EnclosingMethod.java |   36 +-
 .../apache/bcel/classfile/EnumElementValue.java    |   20 +-
 .../org/apache/bcel/classfile/ExceptionTable.java  |   74 +-
 src/main/java/org/apache/bcel/classfile/Field.java |  122 +-
 .../org/apache/bcel/classfile/FieldOrMethod.java   |  204 +--
 .../java/org/apache/bcel/classfile/InnerClass.java |   44 +-
 .../org/apache/bcel/classfile/InnerClasses.java    |   58 +-
 .../java/org/apache/bcel/classfile/JavaClass.java  |  914 +++++-----
 .../java/org/apache/bcel/classfile/LineNumber.java |   46 +-
 .../org/apache/bcel/classfile/LineNumberTable.java |  132 +-
 .../org/apache/bcel/classfile/LocalVariable.java   |  114 +-
 .../apache/bcel/classfile/LocalVariableTable.java  |   92 +-
 .../bcel/classfile/LocalVariableTypeTable.java     |   66 +-
 .../java/org/apache/bcel/classfile/Method.java     |  184 +-
 .../org/apache/bcel/classfile/MethodParameter.java |   74 +-
 .../apache/bcel/classfile/MethodParameters.java    |   16 +-
 .../java/org/apache/bcel/classfile/Module.java     |  116 +-
 .../org/apache/bcel/classfile/ModuleExports.java   |   26 +-
 .../org/apache/bcel/classfile/ModuleMainClass.java |   48 +-
 .../org/apache/bcel/classfile/ModuleOpens.java     |   26 +-
 .../org/apache/bcel/classfile/ModulePackages.java  |   78 +-
 .../org/apache/bcel/classfile/ModuleProvides.java  |   26 +-
 .../org/apache/bcel/classfile/ModuleRequires.java  |   26 +-
 .../java/org/apache/bcel/classfile/NestHost.java   |   48 +-
 .../org/apache/bcel/classfile/NestMembers.java     |   82 +-
 .../java/org/apache/bcel/classfile/PMGClass.java   |   66 +-
 .../bcel/classfile/ParameterAnnotationEntry.java   |   38 +-
 .../bcel/classfile/ParameterAnnotations.java       |   44 +-
 .../java/org/apache/bcel/classfile/Signature.java  |  270 +--
 .../apache/bcel/classfile/SimpleElementValue.java  |  118 +-
 .../java/org/apache/bcel/classfile/SourceFile.java |   48 +-
 .../java/org/apache/bcel/classfile/StackMap.java   |   90 +-
 .../org/apache/bcel/classfile/StackMapEntry.java   |  264 +--
 .../org/apache/bcel/classfile/StackMapType.java    |  104 +-
 .../java/org/apache/bcel/classfile/Synthetic.java  |   48 +-
 .../java/org/apache/bcel/classfile/Unknown.java    |   52 +-
 .../java/org/apache/bcel/classfile/Utility.java    | 1254 +++++++-------
 .../java/org/apache/bcel/classfile/Visitor.java    |  162 +-
 .../java/org/apache/bcel/generic/ACONST_NULL.java  |   16 +-
 .../java/org/apache/bcel/generic/ANEWARRAY.java    |   14 +-
 .../java/org/apache/bcel/generic/ARRAYLENGTH.java  |   20 +-
 src/main/java/org/apache/bcel/generic/ATHROW.java  |   20 +-
 .../bcel/generic/AnnotationElementValueGen.java    |   24 +-
 .../apache/bcel/generic/AnnotationEntryGen.java    |  302 ++--
 .../apache/bcel/generic/ArrayElementValueGen.java  |   68 +-
 .../java/org/apache/bcel/generic/ArrayType.java    |   38 +-
 src/main/java/org/apache/bcel/generic/BIPUSH.java  |   54 +-
 .../java/org/apache/bcel/generic/BasicType.java    |   36 +-
 .../java/org/apache/bcel/generic/BranchHandle.java |   74 +-
 .../org/apache/bcel/generic/BranchInstruction.java |  220 +--
 .../java/org/apache/bcel/generic/CHECKCAST.java    |   38 +-
 .../org/apache/bcel/generic/CPInstruction.java     |   66 +-
 .../apache/bcel/generic/ClassElementValueGen.java  |   62 +-
 .../java/org/apache/bcel/generic/ClassGen.java     |  642 +++----
 .../org/apache/bcel/generic/CodeExceptionGen.java  |  126 +-
 .../org/apache/bcel/generic/ConstantPoolGen.java   |  762 ++++-----
 src/main/java/org/apache/bcel/generic/DCMPG.java   |   14 +-
 src/main/java/org/apache/bcel/generic/DCMPL.java   |   14 +-
 src/main/java/org/apache/bcel/generic/DCONST.java  |   28 +-
 .../org/apache/bcel/generic/ElementValueGen.java   |  128 +-
 .../apache/bcel/generic/ElementValuePairGen.java   |   20 +-
 .../java/org/apache/bcel/generic/EmptyVisitor.java |  366 ++--
 .../apache/bcel/generic/EnumElementValueGen.java   |   78 +-
 src/main/java/org/apache/bcel/generic/FCMPG.java   |   16 +-
 src/main/java/org/apache/bcel/generic/FCMPL.java   |   16 +-
 src/main/java/org/apache/bcel/generic/FCONST.java  |   28 +-
 .../java/org/apache/bcel/generic/FieldGen.java     |  348 ++--
 .../apache/bcel/generic/FieldGenOrMethodGen.java   |  132 +-
 .../org/apache/bcel/generic/FieldInstruction.java  |   32 +-
 .../org/apache/bcel/generic/FieldOrMethod.java     |   66 +-
 .../java/org/apache/bcel/generic/GETFIELD.java     |   28 +-
 .../java/org/apache/bcel/generic/GETSTATIC.java    |   26 +-
 src/main/java/org/apache/bcel/generic/GOTO.java    |   36 +-
 src/main/java/org/apache/bcel/generic/GOTO_W.java  |   34 +-
 .../org/apache/bcel/generic/GotoInstruction.java   |   10 +-
 src/main/java/org/apache/bcel/generic/ICONST.java  |   28 +-
 src/main/java/org/apache/bcel/generic/IDIV.java    |   20 +-
 src/main/java/org/apache/bcel/generic/IFEQ.java    |   18 +-
 src/main/java/org/apache/bcel/generic/IFGE.java    |   18 +-
 src/main/java/org/apache/bcel/generic/IFGT.java    |   18 +-
 src/main/java/org/apache/bcel/generic/IFLE.java    |   18 +-
 src/main/java/org/apache/bcel/generic/IFLT.java    |   18 +-
 src/main/java/org/apache/bcel/generic/IFNE.java    |   18 +-
 .../java/org/apache/bcel/generic/IFNONNULL.java    |   18 +-
 src/main/java/org/apache/bcel/generic/IFNULL.java  |   18 +-
 .../java/org/apache/bcel/generic/IF_ACMPEQ.java    |   18 +-
 .../java/org/apache/bcel/generic/IF_ACMPNE.java    |   18 +-
 .../java/org/apache/bcel/generic/IF_ICMPEQ.java    |   18 +-
 .../java/org/apache/bcel/generic/IF_ICMPGE.java    |   18 +-
 .../java/org/apache/bcel/generic/IF_ICMPGT.java    |   18 +-
 .../java/org/apache/bcel/generic/IF_ICMPLE.java    |   18 +-
 .../java/org/apache/bcel/generic/IF_ICMPLT.java    |   18 +-
 .../java/org/apache/bcel/generic/IF_ICMPNE.java    |   18 +-
 src/main/java/org/apache/bcel/generic/IINC.java    |   94 +-
 .../java/org/apache/bcel/generic/INSTANCEOF.java   |   32 +-
 .../org/apache/bcel/generic/INVOKEDYNAMIC.java     |   88 +-
 .../org/apache/bcel/generic/INVOKEINTERFACE.java   |   76 +-
 .../org/apache/bcel/generic/INVOKESPECIAL.java     |   40 +-
 .../java/org/apache/bcel/generic/INVOKESTATIC.java |   36 +-
 .../org/apache/bcel/generic/INVOKEVIRTUAL.java     |   40 +-
 src/main/java/org/apache/bcel/generic/IREM.java    |   20 +-
 .../java/org/apache/bcel/generic/Instruction.java  |  318 ++--
 .../org/apache/bcel/generic/InstructionConst.java  |    4 +-
 .../apache/bcel/generic/InstructionConstants.java  |  226 +--
 .../apache/bcel/generic/InstructionFactory.java    |  818 ++++-----
 .../org/apache/bcel/generic/InstructionHandle.java |  292 ++--
 .../org/apache/bcel/generic/InstructionList.java   | 1462 ++++++++--------
 .../org/apache/bcel/generic/InvokeInstruction.java |   84 +-
 src/main/java/org/apache/bcel/generic/JSR.java     |   36 +-
 src/main/java/org/apache/bcel/generic/JSR_W.java   |   34 +-
 .../org/apache/bcel/generic/JsrInstruction.java    |   10 +-
 src/main/java/org/apache/bcel/generic/LCMP.java    |   16 +-
 src/main/java/org/apache/bcel/generic/LCONST.java  |   28 +-
 src/main/java/org/apache/bcel/generic/LDC.java     |  104 +-
 src/main/java/org/apache/bcel/generic/LDC2_W.java  |   36 +-
 src/main/java/org/apache/bcel/generic/LDIV.java    |   16 +-
 .../java/org/apache/bcel/generic/LOOKUPSWITCH.java |   36 +-
 src/main/java/org/apache/bcel/generic/LREM.java    |   16 +-
 .../org/apache/bcel/generic/LineNumberGen.java     |   54 +-
 .../org/apache/bcel/generic/LocalVariableGen.java  |  174 +-
 .../bcel/generic/LocalVariableInstruction.java     |  134 +-
 .../java/org/apache/bcel/generic/MONITORENTER.java |   16 +-
 .../java/org/apache/bcel/generic/MONITOREXIT.java  |   16 +-
 .../org/apache/bcel/generic/MULTIANEWARRAY.java    |   96 +-
 .../java/org/apache/bcel/generic/MethodGen.java    | 1408 +++++++--------
 src/main/java/org/apache/bcel/generic/NEW.java     |   28 +-
 .../java/org/apache/bcel/generic/NEWARRAY.java     |   60 +-
 .../bcel/generic/NameSignatureInstruction.java     |   16 +-
 .../java/org/apache/bcel/generic/ObjectType.java   |   82 +-
 src/main/java/org/apache/bcel/generic/PUSH.java    |  118 +-
 .../java/org/apache/bcel/generic/PUTFIELD.java     |   28 +-
 .../java/org/apache/bcel/generic/PUTSTATIC.java    |   26 +-
 src/main/java/org/apache/bcel/generic/RET.java     |   76 +-
 .../org/apache/bcel/generic/ReferenceType.java     |  288 ++--
 .../org/apache/bcel/generic/ReturnInstruction.java |   16 +-
 .../org/apache/bcel/generic/ReturnaddressType.java |   22 +-
 src/main/java/org/apache/bcel/generic/SIPUSH.java  |   54 +-
 src/main/java/org/apache/bcel/generic/SWITCH.java  |   58 +-
 src/main/java/org/apache/bcel/generic/Select.java  |  300 ++--
 .../apache/bcel/generic/SimpleElementValueGen.java |  104 +-
 .../java/org/apache/bcel/generic/TABLESWITCH.java  |   36 +-
 src/main/java/org/apache/bcel/generic/Type.java    |  392 ++---
 src/main/java/org/apache/bcel/generic/Visitor.java |  366 ++--
 .../bcel/util/AbstractClassPathRepository.java     |   66 +-
 .../java/org/apache/bcel/util/AttributeHTML.java   |   12 +-
 .../java/org/apache/bcel/util/BCELFactory.java     |  272 +--
 src/main/java/org/apache/bcel/util/BCELifier.java  |  288 ++--
 .../java/org/apache/bcel/util/ByteSequence.java    |   36 +-
 src/main/java/org/apache/bcel/util/Class2HTML.java |   82 +-
 .../java/org/apache/bcel/util/ClassLoader.java     |   88 +-
 .../apache/bcel/util/ClassLoaderRepository.java    |   50 +-
 .../org/apache/bcel/util/ClassPathRepository.java  |   26 +-
 src/main/java/org/apache/bcel/util/ClassQueue.java |   10 +-
 src/main/java/org/apache/bcel/util/ClassSet.java   |   18 +-
 src/main/java/org/apache/bcel/util/ClassStack.java |   12 +-
 src/main/java/org/apache/bcel/util/CodeHTML.java   |    6 +-
 .../java/org/apache/bcel/util/ConstantHTML.java    |   22 +-
 .../org/apache/bcel/util/InstructionFinder.java    |  414 ++---
 .../java/org/apache/bcel/util/JavaWrapper.java     |   46 +-
 .../bcel/util/LruCacheClassPathRepository.java     |   16 +-
 .../util/MemorySensitiveClassPathRepository.java   |   32 +-
 .../org/apache/bcel/util/ModularRuntimeImage.java  |    8 +-
 src/main/java/org/apache/bcel/util/Repository.java |   26 +-
 .../org/apache/bcel/util/SyntheticRepository.java  |    8 +-
 .../apache/bcel/verifier/GraphicalVerifier.java    |   22 +-
 .../org/apache/bcel/verifier/NativeVerifier.java   |   14 +-
 .../org/apache/bcel/verifier/PassVerifier.java     |   50 +-
 .../org/apache/bcel/verifier/TransitiveHull.java   |   46 +-
 .../apache/bcel/verifier/VerificationResult.java   |   30 +-
 .../java/org/apache/bcel/verifier/Verifier.java    |  168 +-
 .../org/apache/bcel/verifier/VerifierAppFrame.java |  206 +--
 .../org/apache/bcel/verifier/VerifierFactory.java  |   38 +-
 .../bcel/verifier/VerifierFactoryListModel.java    |   36 +-
 .../org/apache/bcel/verifier/VerifyDialog.java     |  134 +-
 .../verifier/exc/AssertionViolatedException.java   |   18 +-
 .../exc/StructuralCodeConstraintException.java     |   10 +-
 .../java/org/apache/bcel/verifier/exc/Utility.java |    6 +-
 .../apache/bcel/verifier/statics/DOUBLE_Upper.java |   10 +-
 .../apache/bcel/verifier/statics/LONG_Upper.java   |   10 +-
 .../bcel/verifier/statics/LocalVariableInfo.java   |   90 +-
 .../bcel/verifier/statics/LocalVariablesInfo.java  |   26 +-
 .../bcel/verifier/statics/Pass1Verifier.java       |   36 +-
 .../bcel/verifier/statics/Pass2Verifier.java       | 1792 ++++++++++----------
 .../bcel/verifier/statics/Pass3aVerifier.java      | 1654 +++++++++---------
 .../verifier/statics/StringRepresentation.java     |  188 +-
 .../verifier/structurals/ControlFlowGraph.java     |  302 ++--
 .../verifier/structurals/ExecutionVisitor.java     |   16 +-
 .../apache/bcel/verifier/structurals/Frame.java    |   56 +-
 .../structurals/InstConstraintVisitor.java         |  610 +++----
 .../verifier/structurals/InstructionContext.java   |   60 +-
 .../bcel/verifier/structurals/LocalVariables.java  |  102 +-
 .../bcel/verifier/structurals/OperandStack.java    |  132 +-
 .../bcel/verifier/structurals/Pass3bVerifier.java  |   64 +-
 .../bcel/verifier/structurals/Subroutine.java      |   48 +-
 .../bcel/verifier/structurals/Subroutines.java     |  456 ++---
 .../structurals/UninitializedObjectType.java       |   26 +-
 .../bcel/AbstractCounterVisitorTestCase.java       |   16 +-
 .../java/org/apache/bcel/AbstractTestCase.java     |  166 +-
 .../org/apache/bcel/AnonymousClassTestCase.java    |   26 +-
 .../org/apache/bcel/CounterVisitorTestCase.java    |   12 +-
 .../org/apache/bcel/ElementValueGenTestCase.java   |  152 +-
 .../bcel/EnclosingMethodAttributeTestCase.java     |   46 +-
 .../bcel/LocalVariableTypeTableTestCase.java       |   82 +-
 src/test/java/org/apache/bcel/NanoTimer.java       |    8 +-
 src/test/java/org/apache/bcel/PLSETestCase.java    |   38 +-
 .../bcel/classfile/ConstantPoolTestCase.java       |   12 +-
 .../bcel/classfile/JDKClassDumpTestCase.java       |   50 +-
 .../bcel/data/AnnotatedWithCombinedAnnotation.java |    8 +-
 .../org/apache/bcel/data/AnonymousClassTest.java   |   16 +-
 .../apache/bcel/data/AttributeTestClassEM02.java   |    8 +-
 .../org/apache/bcel/data/ComplexAnnotation.java    |   12 +-
 .../java/org/apache/bcel/data/ConstantPoolX.java   |   56 +-
 .../org/apache/bcel/data/SimpleAnnotation.java     |    4 +-
 .../apache/bcel/generic/AnnotationGenTestCase.java |   50 +-
 .../apache/bcel/generic/BranchHandleTestCase.java  |   14 +-
 .../bcel/generic/FieldAnnotationsTestCase.java     |   52 +-
 .../GeneratingAnnotatedClassesTestCase.java        |  654 +++----
 .../bcel/generic/InstructionHandleTestCase.java    |   28 +-
 .../bcel/generic/JdkGenericDumpTestCase.java       |   40 +-
 .../org/apache/bcel/generic/MethodGenTestCase.java |   36 +-
 .../bcel/util/ClassPathRepositoryTestCase.java     |   72 +-
 .../bcel/util/ModularRuntimeImageTestCase.java     |   16 +-
 .../bcel/verifier/VerifierInvokeTestCase.java      |   20 +-
 .../bcel/verifier/VerifyBadClassesTestCase.java    |  140 +-
 .../apache/bcel/verifier/tests/TestArray01.java    |    8 +-
 .../apache/bcel/verifier/tests/TestCreator.java    |   20 +-
 .../verifier/tests/TestLegalInvokeInterface01.java |    8 +-
 .../apache/bcel/verifier/tests/TestReturn02.java   |   16 +-
 .../org/apache/bcel/visitors/CounterVisitor.java   |  192 +--
 263 files changed, 15130 insertions(+), 15130 deletions(-)

diff --git a/src/main/java/org/apache/bcel/Const.java b/src/main/java/org/apache/bcel/Const.java
index b79b0461..907bb630 100644
--- a/src/main/java/org/apache/bcel/Const.java
+++ b/src/main/java/org/apache/bcel/Const.java
@@ -363,13 +363,11 @@ public final class Const {
   public static final int ACCESS_NAMES_LENGTH = ACCESS_NAMES.length;
 
   /**
-   * @param index
-   * @return the ACCESS_NAMES entry at the given index
-   * @since 6.0
+   * Marks a constant pool entry as type UTF-8.
+   * @see  <a href="https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.4.7">
+   * The Constant Pool in The Java Virtual Machine Specification</a>
    */
-  public static String getAccessName(final int index) {
-      return ACCESS_NAMES[index];
-  }
+  public static final byte CONSTANT_Utf8               = 1;
 
   /*
    * The description of the constant pool is at:
@@ -377,13 +375,6 @@ public final class Const {
    * References below are to the individual sections
    */
 
-  /**
-   * Marks a constant pool entry as type UTF-8.
-   * @see  <a href="https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.4.7">
-   * The Constant Pool in The Java Virtual Machine Specification</a>
-   */
-  public static final byte CONSTANT_Utf8               = 1;
-
   /**
    * Marks a constant pool entry as type Integer.
    * @see  <a href="https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.4.4">
@@ -508,16 +499,6 @@ public final class Const {
     "CONSTANT_MethodType", "CONSTANT_Dynamic", "CONSTANT_InvokeDynamic",
     "CONSTANT_Module", "CONSTANT_Package"};
 
-  /**
-   *
-   * @param index
-   * @return the CONSTANT_NAMES entry at the given index
-   * @since 6.0
-   */
-  public static String getConstantName(final int index) {
-      return CONSTANT_NAMES[index];
-  }
-
   /** The name of the static initializer, also called &quot;class
    *  initialization method&quot; or &quot;interface initialization
    *   method&quot;. This is &quot;&lt;clinit&gt;&quot;.
@@ -534,13 +515,6 @@ public final class Const {
    */
   private static final String[] INTERFACES_IMPLEMENTED_BY_ARRAYS = {"java.lang.Cloneable", "java.io.Serializable"};
 
-  /**
-   * @since 6.0
-   */
-  public static Iterable<String> getInterfacesImplementedByArrays() {
-      return Collections.unmodifiableList(Arrays.asList(INTERFACES_IMPLEMENTED_BY_ARRAYS));
-  }
-
   /**
    * Maximum Constant Pool entries.
    * One of the limitations of the Java Virtual Machine.
@@ -1890,17 +1864,6 @@ public final class Const {
     "void", "array", "object", "unknown", "address"
   };
 
-  /**
-   * The primitive type names corresponding to the T_XX constants,
-   * e.g., TYPE_NAMES[T_INT] = "int"
-   * @param index
-   * @return the type name
-   * @since 6.0
-   */
-  public static String getTypeName(final int index) {
-      return TYPE_NAMES[index];
-  }
-
   /** The primitive class names corresponding to the T_XX constants,
    * e.g., CLASS_TYPE_NAMES[T_INT] = "java.lang.Integer"
    */
@@ -1912,17 +1875,6 @@ public final class Const {
     ILLEGAL_TYPE, ILLEGAL_TYPE,  ILLEGAL_TYPE,  ILLEGAL_TYPE
   };
 
-  /**
-   * The primitive class names corresponding to the T_XX constants,
-   * e.g., CLASS_TYPE_NAMES[T_INT] = "java.lang.Integer"
-   * @param index
-   * @return the class name
-   * @since 6.0
-   */
-  public static String getClassTypeName(final int index) {
-      return CLASS_TYPE_NAMES[index];
-  }
-
   /** The signature characters corresponding to primitive types,
    * e.g., SHORT_TYPE_NAMES[T_INT] = "I"
    */
@@ -1932,17 +1884,6 @@ public final class Const {
     "V", ILLEGAL_TYPE, ILLEGAL_TYPE, ILLEGAL_TYPE
   };
 
-  /**
-   *
-   * @param index
-   * @return the short type name
-   * @since 6.0
-   */
-  public static String getShortTypeName(final int index) {
-      return SHORT_TYPE_NAMES[index];
-  }
-
-
   /**
    * Number of byte code operands for each opcode, i.e., number of bytes after the tag byte
    * itself.  Indexed by opcode, so NO_OF_OPERANDS[BIPUSH] = the number of operands for a bipush
@@ -2009,16 +1950,6 @@ public final class Const {
     UNDEFINED, UNDEFINED, RESERVED/*impdep1*/, RESERVED/*impdep2*/
   };
 
-  /**
-   *
-   * @param index
-   * @return Number of byte code operands
-   * @since 6.0
-   */
-  public static short getNoOfOperands(final int index) {
-      return NO_OF_OPERANDS[index];
-  }
-
   /**
    * How the byte code operands are to be interpreted for each opcode.
    * Indexed by opcode.  TYPE_OF_OPERANDS[ILOAD] = an array of shorts
@@ -2088,20 +2019,6 @@ public final class Const {
     {}/*impdep1*/, {}/*impdep2*/
   };
 
-  /**
-   * @since 6.0
-   */
-  public static short getOperandType(final int opcode, final int index) {
-      return TYPE_OF_OPERANDS[opcode][index];
-  }
-
-  /**
-   * @since 6.0
-   */
-  public static long getOperandTypeCount(final int opcode) {
-      return TYPE_OF_OPERANDS[opcode].length;
-  }
-
   /**
    * Names of opcodes.  Indexed by opcode.  OPCODE_NAMES[ALOAD] = "aload".
    */
@@ -2159,14 +2076,6 @@ public final class Const {
    */
   public static final int OPCODE_NAMES_LENGTH = OPCODE_NAMES.length;
 
-
-  /**
-   * @since 6.0
-   */
-  public static String getOpcodeName(final int index) {
-      return OPCODE_NAMES[index];
-  }
-
   /**
    * Number of words consumed on operand stack by instructions.
    * Indexed by opcode.  CONSUME_STACK[FALOAD] = number of words
@@ -2223,17 +2132,6 @@ public final class Const {
     UNDEFINED, UNPREDICTABLE/*impdep1*/, UNPREDICTABLE/*impdep2*/
   };
 
-  /**
-   *
-   * @param index
-   * @return Number of words consumed on operand stack
-   * @since 6.0
-   */
-  public static int getConsumeStack(final int index) {
-      return CONSUME_STACK[index];
-  }
-
-
   /**
    * Number of words produced onto operand stack by instructions.
    * Indexed by opcode.  CONSUME_STACK[DALOAD] = number of words
@@ -2290,30 +2188,35 @@ public final class Const {
     UNDEFINED, UNPREDICTABLE/*impdep1*/, UNPREDICTABLE/*impdep2*/
   };
 
-  /**
-   *
-   * @param index
-   * @return Number of words produced onto operand stack
-   * @since 6.0
-   */
-  public static int getProduceStack(final int index) {
-      return PRODUCE_STACK[index];
-  }
 
   /** 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_RUNTIME_INVISIBLE_ANNOTATIONS           = 13;
@@ -2330,9 +2233,7 @@ public final class Const {
   public static final byte ATTR_MODULE_MAIN_CLASS                       = 24;
   public static final byte ATTR_NEST_HOST                               = 25;
   public static final byte ATTR_NEST_MEMBERS                            = 26;
-
   public static final short KNOWN_ATTRIBUTES = 27; // count of attributes
-
   private static final String[] ATTRIBUTE_NAMES = {
     "SourceFile", "ConstantValue", "Code", "Exceptions",
     "LineNumberTable", "LocalVariableTable",
@@ -2344,17 +2245,6 @@ public final class Const {
     "BootstrapMethods", "MethodParameters", "Module", "ModulePackages",
     "ModuleMainClass", "NestHost", "NestMembers"
   };
-
-  /**
-   *
-   * @param index
-   * @return the attribute name
-   * @since 6.0
-   */
-  public static String getAttributeName(final int index) {
-      return ATTRIBUTE_NAMES[index];
-  }
-
   /** Constants used in the StackMap attribute.
    */
   public static final byte ITEM_Bogus      = 0;
@@ -2366,35 +2256,26 @@ public final class Const {
   public static final byte ITEM_InitObject = 6;
   public static final byte ITEM_Object     = 7;
   public static final byte ITEM_NewObject  = 8;
-
   private static final String[] ITEM_NAMES = {
     "Bogus", "Integer", "Float", "Double", "Long",
     "Null", "InitObject", "Object", "NewObject"
   };
 
-  /**
-   *
-   * @param index
-   * @return the item name
-   * @since 6.0
-   */
-  public static String getItemName(final int index) {
-      return ITEM_NAMES[index];
-  }
-
   /** Constants used to identify StackMapEntry types.
    *
    * For those types which can specify a range, the
    * constant names the lowest value.
    */
   public static final int SAME_FRAME = 0;
+
   public static final int SAME_LOCALS_1_STACK_ITEM_FRAME = 64;
+
   public static final int SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED = 247;
+
   public static final int CHOP_FRAME = 248;
   public static final int SAME_FRAME_EXTENDED = 251;
   public static final int APPEND_FRAME = 252;
   public static final int FULL_FRAME = 255;
-
   /** Constants that define the maximum value of
    * those constants which store ranges. */
 
@@ -2402,20 +2283,18 @@ public final class Const {
   public static final int SAME_LOCALS_1_STACK_ITEM_FRAME_MAX = 127;
   public static final int CHOP_FRAME_MAX = 250;
   public static final int APPEND_FRAME_MAX = 254;
-
-
-  // Constants defining the behavior of the Method Handles (JVMS �5.4.3.5)
-
   public static final byte REF_getField         = 1;
+
   public static final byte REF_getStatic        = 2;
+
   public static final byte REF_putField         = 3;
+
   public static final byte REF_putStatic        = 4;
   public static final byte REF_invokeVirtual    = 5;
   public static final byte REF_invokeStatic     = 6;
   public static final byte REF_invokeSpecial    = 7;
   public static final byte REF_newInvokeSpecial = 8;
   public static final byte REF_invokeInterface  = 9;
-
   /**
    * The names of the reference_kinds of a CONSTANT_MethodHandle_info.
    */
@@ -2423,6 +2302,70 @@ public final class Const {
       "", "getField", "getStatic", "putField", "putStatic", "invokeVirtual",
       "invokeStatic", "invokeSpecial", "newInvokeSpecial", "invokeInterface" };
 
+  /**
+   * @param index
+   * @return the ACCESS_NAMES entry at the given index
+   * @since 6.0
+   */
+  public static String getAccessName(final int index) {
+      return ACCESS_NAMES[index];
+  }
+  /**
+   *
+   * @param index
+   * @return the attribute name
+   * @since 6.0
+   */
+  public static String getAttributeName(final int index) {
+      return ATTRIBUTE_NAMES[index];
+  }
+  /**
+   * The primitive class names corresponding to the T_XX constants,
+   * e.g., CLASS_TYPE_NAMES[T_INT] = "java.lang.Integer"
+   * @param index
+   * @return the class name
+   * @since 6.0
+   */
+  public static String getClassTypeName(final int index) {
+      return CLASS_TYPE_NAMES[index];
+  }
+  /**
+   *
+   * @param index
+   * @return the CONSTANT_NAMES entry at the given index
+   * @since 6.0
+   */
+  public static String getConstantName(final int index) {
+      return CONSTANT_NAMES[index];
+  }
+
+
+  // Constants defining the behavior of the Method Handles (JVMS �5.4.3.5)
+
+  /**
+   *
+   * @param index
+   * @return Number of words consumed on operand stack
+   * @since 6.0
+   */
+  public static int getConsumeStack(final int index) {
+      return CONSUME_STACK[index];
+  }
+  /**
+   * @since 6.0
+   */
+  public static Iterable<String> getInterfacesImplementedByArrays() {
+      return Collections.unmodifiableList(Arrays.asList(INTERFACES_IMPLEMENTED_BY_ARRAYS));
+  }
+  /**
+   *
+   * @param index
+   * @return the item name
+   * @since 6.0
+   */
+  public static String getItemName(final int index) {
+      return ITEM_NAMES[index];
+  }
   /**
    *
    * @param index
@@ -2432,6 +2375,63 @@ public final class Const {
   public static String getMethodHandleName(final int index) {
       return METHODHANDLE_NAMES[index];
   }
+  /**
+   *
+   * @param index
+   * @return Number of byte code operands
+   * @since 6.0
+   */
+  public static short getNoOfOperands(final int index) {
+      return NO_OF_OPERANDS[index];
+  }
+  /**
+   * @since 6.0
+   */
+  public static String getOpcodeName(final int index) {
+      return OPCODE_NAMES[index];
+  }
+  /**
+   * @since 6.0
+   */
+  public static short getOperandType(final int opcode, final int index) {
+      return TYPE_OF_OPERANDS[opcode][index];
+  }
+  /**
+   * @since 6.0
+   */
+  public static long getOperandTypeCount(final int opcode) {
+      return TYPE_OF_OPERANDS[opcode].length;
+  }
+  /**
+   *
+   * @param index
+   * @return Number of words produced onto operand stack
+   * @since 6.0
+   */
+  public static int getProduceStack(final int index) {
+      return PRODUCE_STACK[index];
+  }
+
+  /**
+   *
+   * @param index
+   * @return the short type name
+   * @since 6.0
+   */
+  public static String getShortTypeName(final int index) {
+      return SHORT_TYPE_NAMES[index];
+  }
+
+  /**
+   * The primitive type names corresponding to the T_XX constants,
+   * e.g., TYPE_NAMES[T_INT] = "int"
+   * @param index
+   * @return the type name
+   * @since 6.0
+   */
+  public static String getTypeName(final int index) {
+      return TYPE_NAMES[index];
+  }
 
   private Const() { } // not instantiable
 
diff --git a/src/main/java/org/apache/bcel/ExceptionConst.java b/src/main/java/org/apache/bcel/ExceptionConst.java
index ae7bc3f7..8ec03f79 100644
--- a/src/main/java/org/apache/bcel/ExceptionConst.java
+++ b/src/main/java/org/apache/bcel/ExceptionConst.java
@@ -23,6 +23,18 @@ package org.apache.bcel;
  */
 public final class ExceptionConst {
 
+    /**
+     * Enum corresponding to the various Exception Class arrays,
+     * used by {@link ExceptionConst#createExceptions(EXCS, Class...)}
+     */
+    public enum EXCS {
+        EXCS_CLASS_AND_INTERFACE_RESOLUTION,
+        EXCS_FIELD_AND_METHOD_RESOLUTION,
+        EXCS_INTERFACE_METHOD_RESOLUTION,
+        EXCS_STRING_RESOLUTION,
+        EXCS_ARRAY_EXCEPTION,
+    }
+
     /**
      * The mother of all exceptions
      */
@@ -37,7 +49,6 @@ public final class ExceptionConst {
      * Super class of any linking exception (aka Linkage Error)
      */
     public static final Class<LinkageError> LINKING_EXCEPTION = LinkageError.class;
-
     /**
      * Linking Exceptions
      */
@@ -52,10 +63,10 @@ public final class ExceptionConst {
     public static final Class<NoSuchMethodError> NO_SUCH_METHOD_ERROR = NoSuchMethodError.class;
     public static final Class<NoClassDefFoundError> NO_CLASS_DEF_FOUND_ERROR = NoClassDefFoundError.class;
     public static final Class<UnsatisfiedLinkError> UNSATISFIED_LINK_ERROR = UnsatisfiedLinkError.class;
+
     public static final Class<VerifyError> VERIFY_ERROR = VerifyError.class;
     /* UnsupportedClassVersionError is new in JDK 1.2 */
 //    public static final Class UnsupportedClassVersionError = UnsupportedClassVersionError.class;
-
     /**
      * Run-Time Exceptions
      */
@@ -65,8 +76,8 @@ public final class ExceptionConst {
     public static final Class<ArithmeticException> ARITHMETIC_EXCEPTION = ArithmeticException.class;
     public static final Class<NegativeArraySizeException> NEGATIVE_ARRAY_SIZE_EXCEPTION = NegativeArraySizeException.class;
     public static final Class<ClassCastException> CLASS_CAST_EXCEPTION = ClassCastException.class;
-    public static final Class<IllegalMonitorStateException> ILLEGAL_MONITOR_STATE = IllegalMonitorStateException.class;
 
+    public static final Class<IllegalMonitorStateException> ILLEGAL_MONITOR_STATE = IllegalMonitorStateException.class;
     /**
      * Pre-defined exception arrays according to chapters 5.1-5.4 of the Java Virtual
      * Machine Specification
@@ -75,6 +86,7 @@ public final class ExceptionConst {
             NO_CLASS_DEF_FOUND_ERROR, CLASS_FORMAT_ERROR, VERIFY_ERROR, ABSTRACT_METHOD_ERROR,
             EXCEPTION_IN_INITIALIZER_ERROR, ILLEGAL_ACCESS_ERROR
     }; // Chapter 5.1
+
     private static final Class<?>[] EXCS_FIELD_AND_METHOD_RESOLUTION = {
             NO_SUCH_FIELD_ERROR, ILLEGAL_ACCESS_ERROR, NO_SUCH_METHOD_ERROR
     }; // Chapter 5.2
@@ -94,29 +106,6 @@ public final class ExceptionConst {
             NULL_POINTER_EXCEPTION, ARRAY_INDEX_OUT_OF_BOUNDS_EXCEPTION
     };
 
-    /**
-     * Enum corresponding to the various Exception Class arrays,
-     * used by {@link ExceptionConst#createExceptions(EXCS, Class...)}
-     */
-    public enum EXCS {
-        EXCS_CLASS_AND_INTERFACE_RESOLUTION,
-        EXCS_FIELD_AND_METHOD_RESOLUTION,
-        EXCS_INTERFACE_METHOD_RESOLUTION,
-        EXCS_STRING_RESOLUTION,
-        EXCS_ARRAY_EXCEPTION,
-    }
-
-    // helper method to merge exception class arrays
-    private static Class<?>[] mergeExceptions(final Class<?>[] input, final Class<?> ... extraClasses) {
-        final int extraLen = extraClasses == null ? 0 : extraClasses.length;
-        final Class<?>[] excs = new Class<?>[input.length + extraLen];
-        System.arraycopy(input, 0, excs, 0, input.length);
-        if (extraLen > 0) {
-            System.arraycopy(extraClasses, 0, excs, input.length, extraLen);
-        }
-        return excs;
-    }
-
     /**
      * Creates a copy of the specified Exception Class array combined with any additional Exception classes.
      * @param type the basic array type
@@ -140,5 +129,16 @@ public final class ExceptionConst {
         }
     }
 
+    // helper method to merge exception class arrays
+    private static Class<?>[] mergeExceptions(final Class<?>[] input, final Class<?> ... extraClasses) {
+        final int extraLen = extraClasses == null ? 0 : extraClasses.length;
+        final Class<?>[] excs = new Class<?>[input.length + extraLen];
+        System.arraycopy(input, 0, excs, 0, input.length);
+        if (extraLen > 0) {
+            System.arraycopy(extraClasses, 0, excs, input.length, extraLen);
+        }
+        return excs;
+    }
+
 
 }
diff --git a/src/main/java/org/apache/bcel/Repository.java b/src/main/java/org/apache/bcel/Repository.java
index edcccb4a..e2bf835f 100644
--- a/src/main/java/org/apache/bcel/Repository.java
+++ b/src/main/java/org/apache/bcel/Repository.java
@@ -38,62 +38,14 @@ public abstract class Repository {
 
 
     /**
-     * @return currently used repository instance
-     */
-    public static org.apache.bcel.util.Repository getRepository() {
-        return repository;
-    }
-
-
-    /**
-     * Sets repository instance to be used for class loading
-     */
-    public static void setRepository( final org.apache.bcel.util.Repository rep ) {
-        repository = rep;
-    }
-
-
-    /**
-     * Lookups class somewhere found on your CLASSPATH, or whereever the
-     * repository instance looks for it.
-     *
-     * @return class object for given fully qualified class name
-     * @throws ClassNotFoundException if the class could not be found or
-     * parsed correctly
-     */
-    public static JavaClass lookupClass( final String class_name ) throws ClassNotFoundException {
-        return repository.loadClass(class_name);
-    }
-
-
-    /**
-     * Tries to find class source using the internal repository instance.
+     * Adds clazz to repository if there isn't an equally named class already in there.
      *
-     * @see Class
-     * @return JavaClass object for given runtime class
-     * @throws ClassNotFoundException if the class could not be found or
-     * parsed correctly
-     */
-    public static JavaClass lookupClass( final Class<?> clazz ) throws ClassNotFoundException {
-        return repository.loadClass(clazz);
-    }
-
-
-    /**
-     * @return class file object for given Java class by looking on the
-     *  system class path; returns null if the class file can't be
-     *  found
+     * @return old entry in repository
      */
-    public static ClassPath.ClassFile lookupClassFile( final String class_name ) {
-        try {
-            final ClassPath path = repository.getClassPath();
-            if (path == null) {
-                return null;
-            }
-            return path.getClassFile(class_name);
-        } catch (final IOException e) {
-            return null;
-        }
+    public static JavaClass addClass( final JavaClass clazz ) {
+        final JavaClass old = repository.findClass(clazz.getClassName());
+        repository.storeClass(clazz);
+        return old;
     }
 
 
@@ -106,30 +58,33 @@ public abstract class Repository {
 
 
     /**
-     * Adds clazz to repository if there isn't an equally named class already in there.
-     *
-     * @return old entry in repository
+     * @return all interfaces implemented by class and its super
+     * classes and the interfaces that those interfaces extend, and so on.
+     * (Some people call this a transitive hull).
+     * @throws ClassNotFoundException if any of the class's
+     *  superclasses or superinterfaces can't be found
      */
-    public static JavaClass addClass( final JavaClass clazz ) {
-        final JavaClass old = repository.findClass(clazz.getClassName());
-        repository.storeClass(clazz);
-        return old;
+    public static JavaClass[] getInterfaces( final JavaClass clazz ) throws ClassNotFoundException {
+        return clazz.getAllInterfaces();
     }
 
 
     /**
-     * Removes class with given (fully qualified) name from repository.
+     * @return all interfaces implemented by class and its super
+     * classes and the interfaces that extend those interfaces, and so on
+     * @throws ClassNotFoundException if the named class can't be found,
+     *   or if any of its superclasses or superinterfaces can't be found
      */
-    public static void removeClass( final String clazz ) {
-        repository.removeClass(repository.findClass(clazz));
+    public static JavaClass[] getInterfaces( final String class_name ) throws ClassNotFoundException {
+        return getInterfaces(lookupClass(class_name));
     }
 
 
     /**
-     * Removes given class from repository.
+     * @return currently used repository instance
      */
-    public static void removeClass( final JavaClass clazz ) {
-        repository.removeClass(clazz);
+    public static org.apache.bcel.util.Repository getRepository() {
+        return repository;
     }
 
 
@@ -156,48 +111,58 @@ public abstract class Repository {
 
 
     /**
-     * @return all interfaces implemented by class and its super
-     * classes and the interfaces that those interfaces extend, and so on.
-     * (Some people call this a transitive hull).
-     * @throws ClassNotFoundException if any of the class's
-     *  superclasses or superinterfaces can't be found
+     * @return true, if clazz is an implementation of interface inter
+     * @throws ClassNotFoundException if any superclasses or superinterfaces
+     *   of clazz can't be found
      */
-    public static JavaClass[] getInterfaces( final JavaClass clazz ) throws ClassNotFoundException {
-        return clazz.getAllInterfaces();
+    public static boolean implementationOf( final JavaClass clazz, final JavaClass inter )
+            throws ClassNotFoundException {
+        return clazz.implementationOf(inter);
     }
 
 
     /**
-     * @return all interfaces implemented by class and its super
-     * classes and the interfaces that extend those interfaces, and so on
-     * @throws ClassNotFoundException if the named class can't be found,
-     *   or if any of its superclasses or superinterfaces can't be found
+     * @return true, if clazz is an implementation of interface inter
+     * @throws ClassNotFoundException if inter or any superclasses
+     *   or superinterfaces of clazz can't be found
      */
-    public static JavaClass[] getInterfaces( final String class_name ) throws ClassNotFoundException {
-        return getInterfaces(lookupClass(class_name));
+    public static boolean implementationOf( final JavaClass clazz, final String inter )
+            throws ClassNotFoundException {
+        return implementationOf(clazz, lookupClass(inter));
     }
 
 
     /**
-     * Equivalent to runtime "instanceof" operator.
-     * @return true, if clazz is an instance of super_class
-     * @throws ClassNotFoundException if any superclasses or superinterfaces
-     *   of clazz can't be found
+     * @return true, if clazz is an implementation of interface inter
+     * @throws ClassNotFoundException if clazz or any superclasses or
+     *   superinterfaces of clazz can't be found
      */
-    public static boolean instanceOf( final JavaClass clazz, final JavaClass super_class )
+    public static boolean implementationOf( final String clazz, final JavaClass inter )
             throws ClassNotFoundException {
-        return clazz.instanceOf(super_class);
+        return implementationOf(lookupClass(clazz), inter);
     }
 
 
     /**
+     * @return true, if clazz is an implementation of interface inter
+     * @throws ClassNotFoundException if clazz, inter, or any superclasses
+     *   or superinterfaces of clazz can't be found
+     */
+    public static boolean implementationOf( final String clazz, final String inter )
+            throws ClassNotFoundException {
+        return implementationOf(lookupClass(clazz), lookupClass(inter));
+    }
+
+
+    /**
+     * Equivalent to runtime "instanceof" operator.
      * @return true, if clazz is an instance of super_class
-     * @throws ClassNotFoundException if either clazz or super_class
-     *   can't be found
+     * @throws ClassNotFoundException if any superclasses or superinterfaces
+     *   of clazz can't be found
      */
-    public static boolean instanceOf( final String clazz, final String super_class )
+    public static boolean instanceOf( final JavaClass clazz, final JavaClass super_class )
             throws ClassNotFoundException {
-        return instanceOf(lookupClass(clazz), lookupClass(super_class));
+        return clazz.instanceOf(super_class);
     }
 
 
@@ -222,45 +187,80 @@ public abstract class Repository {
 
 
     /**
-     * @return true, if clazz is an implementation of interface inter
-     * @throws ClassNotFoundException if any superclasses or superinterfaces
-     *   of clazz can't be found
+     * @return true, if clazz is an instance of super_class
+     * @throws ClassNotFoundException if either clazz or super_class
+     *   can't be found
      */
-    public static boolean implementationOf( final JavaClass clazz, final JavaClass inter )
+    public static boolean instanceOf( final String clazz, final String super_class )
             throws ClassNotFoundException {
-        return clazz.implementationOf(inter);
+        return instanceOf(lookupClass(clazz), lookupClass(super_class));
     }
 
 
     /**
-     * @return true, if clazz is an implementation of interface inter
-     * @throws ClassNotFoundException if clazz, inter, or any superclasses
-     *   or superinterfaces of clazz can't be found
+     * Tries to find class source using the internal repository instance.
+     *
+     * @see Class
+     * @return JavaClass object for given runtime class
+     * @throws ClassNotFoundException if the class could not be found or
+     * parsed correctly
      */
-    public static boolean implementationOf( final String clazz, final String inter )
-            throws ClassNotFoundException {
-        return implementationOf(lookupClass(clazz), lookupClass(inter));
+    public static JavaClass lookupClass( final Class<?> clazz ) throws ClassNotFoundException {
+        return repository.loadClass(clazz);
     }
 
 
     /**
-     * @return true, if clazz is an implementation of interface inter
-     * @throws ClassNotFoundException if inter or any superclasses
-     *   or superinterfaces of clazz can't be found
+     * Lookups class somewhere found on your CLASSPATH, or whereever the
+     * repository instance looks for it.
+     *
+     * @return class object for given fully qualified class name
+     * @throws ClassNotFoundException if the class could not be found or
+     * parsed correctly
      */
-    public static boolean implementationOf( final JavaClass clazz, final String inter )
-            throws ClassNotFoundException {
-        return implementationOf(clazz, lookupClass(inter));
+    public static JavaClass lookupClass( final String class_name ) throws ClassNotFoundException {
+        return repository.loadClass(class_name);
     }
 
 
     /**
-     * @return true, if clazz is an implementation of interface inter
-     * @throws ClassNotFoundException if clazz or any superclasses or
-     *   superinterfaces of clazz can't be found
+     * @return class file object for given Java class by looking on the
+     *  system class path; returns null if the class file can't be
+     *  found
      */
-    public static boolean implementationOf( final String clazz, final JavaClass inter )
-            throws ClassNotFoundException {
-        return implementationOf(lookupClass(clazz), inter);
+    public static ClassPath.ClassFile lookupClassFile( final String class_name ) {
+        try {
+            final ClassPath path = repository.getClassPath();
+            if (path == null) {
+                return null;
+            }
+            return path.getClassFile(class_name);
+        } catch (final IOException e) {
+            return null;
+        }
+    }
+
+
+    /**
+     * Removes given class from repository.
+     */
+    public static void removeClass( final JavaClass clazz ) {
+        repository.removeClass(clazz);
+    }
+
+
+    /**
+     * Removes class with given (fully qualified) name from repository.
+     */
+    public static void removeClass( final String clazz ) {
+        repository.removeClass(repository.findClass(clazz));
+    }
+
+
+    /**
+     * Sets repository instance to be used for class loading
+     */
+    public static void setRepository( final org.apache.bcel.util.Repository rep ) {
+        repository = rep;
     }
 }
diff --git a/src/main/java/org/apache/bcel/classfile/AccessFlags.java b/src/main/java/org/apache/bcel/classfile/AccessFlags.java
index 28ae68f8..52b4b4a8 100644
--- a/src/main/java/org/apache/bcel/classfile/AccessFlags.java
+++ b/src/main/java/org/apache/bcel/classfile/AccessFlags.java
@@ -56,161 +56,161 @@ public abstract class AccessFlags {
         return access_flags;
     }
 
-    /**
-     * Set access flags aka "modifiers".
-     *
-     * @param access_flags
-     *            Access flags of the object.
-     */
-    public final void setAccessFlags(final int access_flags) {
-        this.access_flags = access_flags;
-    }
-
-    /**
-     * Set access flags aka "modifiers".
-     *
-     * @param access_flags
-     *            Access flags of the object.
-     */
-    public final void setModifiers(final int access_flags) {
-        setAccessFlags(access_flags);
-    }
-
-    private void setFlag(final int flag, final boolean set) {
-        if ((access_flags & flag) != 0) { // Flag is set already
-            if (!set) {
-                access_flags ^= flag;
-            }
-        } else if (set) {
-            access_flags |= flag;
-        }
-    }
-
-    public final void isPublic(final boolean flag) {
-        setFlag(Const.ACC_PUBLIC, flag);
-    }
-
-    public final boolean isPublic() {
-        return (access_flags & Const.ACC_PUBLIC) != 0;
+    public final boolean isAbstract() {
+        return (access_flags & Const.ACC_ABSTRACT) != 0;
     }
 
-    public final void isPrivate(final boolean flag) {
-        setFlag(Const.ACC_PRIVATE, flag);
+    public final void isAbstract(final boolean flag) {
+        setFlag(Const.ACC_ABSTRACT, flag);
     }
 
-    public final boolean isPrivate() {
-        return (access_flags & Const.ACC_PRIVATE) != 0;
+    public final boolean isAnnotation() {
+        return (access_flags & Const.ACC_ANNOTATION) != 0;
     }
 
-    public final void isProtected(final boolean flag) {
-        setFlag(Const.ACC_PROTECTED, flag);
+    public final void isAnnotation(final boolean flag) {
+        setFlag(Const.ACC_ANNOTATION, flag);
     }
 
-    public final boolean isProtected() {
-        return (access_flags & Const.ACC_PROTECTED) != 0;
+    public final boolean isEnum() {
+        return (access_flags & Const.ACC_ENUM) != 0;
     }
 
-    public final void isStatic(final boolean flag) {
-        setFlag(Const.ACC_STATIC, flag);
+    public final void isEnum(final boolean flag) {
+        setFlag(Const.ACC_ENUM, flag);
     }
 
-    public final boolean isStatic() {
-        return (access_flags & Const.ACC_STATIC) != 0;
+    public final boolean isFinal() {
+        return (access_flags & Const.ACC_FINAL) != 0;
     }
 
     public final void isFinal(final boolean flag) {
         setFlag(Const.ACC_FINAL, flag);
     }
 
-    public final boolean isFinal() {
-        return (access_flags & Const.ACC_FINAL) != 0;
+    public final boolean isInterface() {
+        return (access_flags & Const.ACC_INTERFACE) != 0;
     }
 
-    public final void isSynchronized(final boolean flag) {
-        setFlag(Const.ACC_SYNCHRONIZED, flag);
+    public final void isInterface(final boolean flag) {
+        setFlag(Const.ACC_INTERFACE, flag);
     }
 
-    public final boolean isSynchronized() {
-        return (access_flags & Const.ACC_SYNCHRONIZED) != 0;
+    public final boolean isNative() {
+        return (access_flags & Const.ACC_NATIVE) != 0;
     }
 
-    public final void isVolatile(final boolean flag) {
-        setFlag(Const.ACC_VOLATILE, flag);
+    public final void isNative(final boolean flag) {
+        setFlag(Const.ACC_NATIVE, flag);
     }
 
-    public final boolean isVolatile() {
-        return (access_flags & Const.ACC_VOLATILE) != 0;
+    public final boolean isPrivate() {
+        return (access_flags & Const.ACC_PRIVATE) != 0;
     }
 
-    public final void isTransient(final boolean flag) {
-        setFlag(Const.ACC_TRANSIENT, flag);
+    public final void isPrivate(final boolean flag) {
+        setFlag(Const.ACC_PRIVATE, flag);
     }
 
-    public final boolean isTransient() {
-        return (access_flags & Const.ACC_TRANSIENT) != 0;
+    public final boolean isProtected() {
+        return (access_flags & Const.ACC_PROTECTED) != 0;
     }
 
-    public final void isNative(final boolean flag) {
-        setFlag(Const.ACC_NATIVE, flag);
+    public final void isProtected(final boolean flag) {
+        setFlag(Const.ACC_PROTECTED, flag);
     }
 
-    public final boolean isNative() {
-        return (access_flags & Const.ACC_NATIVE) != 0;
+    public final boolean isPublic() {
+        return (access_flags & Const.ACC_PUBLIC) != 0;
     }
 
-    public final void isInterface(final boolean flag) {
-        setFlag(Const.ACC_INTERFACE, flag);
+    public final void isPublic(final boolean flag) {
+        setFlag(Const.ACC_PUBLIC, flag);
     }
 
-    public final boolean isInterface() {
-        return (access_flags & Const.ACC_INTERFACE) != 0;
+    public final boolean isStatic() {
+        return (access_flags & Const.ACC_STATIC) != 0;
     }
 
-    public final void isAbstract(final boolean flag) {
-        setFlag(Const.ACC_ABSTRACT, flag);
+    public final void isStatic(final boolean flag) {
+        setFlag(Const.ACC_STATIC, flag);
     }
 
-    public final boolean isAbstract() {
-        return (access_flags & Const.ACC_ABSTRACT) != 0;
+    public final boolean isStrictfp() {
+        return (access_flags & Const.ACC_STRICT) != 0;
     }
 
     public final void isStrictfp(final boolean flag) {
         setFlag(Const.ACC_STRICT, flag);
     }
 
-    public final boolean isStrictfp() {
-        return (access_flags & Const.ACC_STRICT) != 0;
+    public final boolean isSynchronized() {
+        return (access_flags & Const.ACC_SYNCHRONIZED) != 0;
     }
 
-    public final void isSynthetic(final boolean flag) {
-        setFlag(Const.ACC_SYNTHETIC, flag);
+    public final void isSynchronized(final boolean flag) {
+        setFlag(Const.ACC_SYNCHRONIZED, flag);
     }
 
     public final boolean isSynthetic() {
         return (access_flags & Const.ACC_SYNTHETIC) != 0;
     }
 
-    public final void isAnnotation(final boolean flag) {
-        setFlag(Const.ACC_ANNOTATION, flag);
+    public final void isSynthetic(final boolean flag) {
+        setFlag(Const.ACC_SYNTHETIC, flag);
     }
 
-    public final boolean isAnnotation() {
-        return (access_flags & Const.ACC_ANNOTATION) != 0;
+    public final boolean isTransient() {
+        return (access_flags & Const.ACC_TRANSIENT) != 0;
     }
 
-    public final void isEnum(final boolean flag) {
-        setFlag(Const.ACC_ENUM, flag);
+    public final void isTransient(final boolean flag) {
+        setFlag(Const.ACC_TRANSIENT, flag);
     }
 
-    public final boolean isEnum() {
-        return (access_flags & Const.ACC_ENUM) != 0;
+    public final boolean isVarArgs() {
+        return (access_flags & Const.ACC_VARARGS) != 0;
     }
 
     public final void isVarArgs(final boolean flag) {
         setFlag(Const.ACC_VARARGS, flag);
     }
 
-    public final boolean isVarArgs() {
-        return (access_flags & Const.ACC_VARARGS) != 0;
+    public final boolean isVolatile() {
+        return (access_flags & Const.ACC_VOLATILE) != 0;
+    }
+
+    public final void isVolatile(final boolean flag) {
+        setFlag(Const.ACC_VOLATILE, flag);
+    }
+
+    /**
+     * Set access flags aka "modifiers".
+     *
+     * @param access_flags
+     *            Access flags of the object.
+     */
+    public final void setAccessFlags(final int access_flags) {
+        this.access_flags = access_flags;
+    }
+
+    private void setFlag(final int flag, final boolean set) {
+        if ((access_flags & flag) != 0) { // Flag is set already
+            if (!set) {
+                access_flags ^= flag;
+            }
+        } else if (set) {
+            access_flags |= flag;
+        }
+    }
+
+    /**
+     * Set access flags aka "modifiers".
+     *
+     * @param access_flags
+     *            Access flags of the object.
+     */
+    public final void setModifiers(final int access_flags) {
+        setAccessFlags(access_flags);
     }
 }
diff --git a/src/main/java/org/apache/bcel/classfile/AnnotationDefault.java b/src/main/java/org/apache/bcel/classfile/AnnotationDefault.java
index c0efe4c2..695e34b4 100644
--- a/src/main/java/org/apache/bcel/classfile/AnnotationDefault.java
+++ b/src/main/java/org/apache/bcel/classfile/AnnotationDefault.java
@@ -66,20 +66,6 @@ public class AnnotationDefault extends Attribute {
         v.visitAnnotationDefault(this);
     }
 
-    /**
-     * @param defaultValue the default value of this methodinfo's annotation
-     */
-    public final void setDefaultValue(final ElementValue defaultValue) {
-        this.defaultValue = defaultValue;
-    }
-
-    /**
-     * @return the default value
-     */
-    public final ElementValue getDefaultValue() {
-        return defaultValue;
-    }
-
     @Override
     public Attribute copy(final ConstantPool _constant_pool) {
         return (Attribute) clone();
@@ -90,4 +76,18 @@ public class AnnotationDefault extends Attribute {
         super.dump(dos);
         defaultValue.dump(dos);
     }
+
+    /**
+     * @return the default value
+     */
+    public final ElementValue getDefaultValue() {
+        return defaultValue;
+    }
+
+    /**
+     * @param defaultValue the default value of this methodinfo's annotation
+     */
+    public final void setDefaultValue(final ElementValue defaultValue) {
+        this.defaultValue = defaultValue;
+    }
 }
diff --git a/src/main/java/org/apache/bcel/classfile/AnnotationElementValue.java b/src/main/java/org/apache/bcel/classfile/AnnotationElementValue.java
index 86e68ea1..16df88e0 100644
--- a/src/main/java/org/apache/bcel/classfile/AnnotationElementValue.java
+++ b/src/main/java/org/apache/bcel/classfile/AnnotationElementValue.java
@@ -46,6 +46,11 @@ public class AnnotationElementValue extends ElementValue
                 annotationEntry.dump(dos);
         }
 
+        public AnnotationEntry getAnnotationEntry()
+        {
+                return annotationEntry;
+        }
+
         @Override
         public String stringifyValue()
         {
@@ -57,9 +62,4 @@ public class AnnotationElementValue extends ElementValue
         {
                 return stringifyValue();
         }
-
-        public AnnotationEntry getAnnotationEntry()
-        {
-                return annotationEntry;
-        }
 }
diff --git a/src/main/java/org/apache/bcel/classfile/AnnotationEntry.java b/src/main/java/org/apache/bcel/classfile/AnnotationEntry.java
index 02aadb37..543f1ecc 100644
--- a/src/main/java/org/apache/bcel/classfile/AnnotationEntry.java
+++ b/src/main/java/org/apache/bcel/classfile/AnnotationEntry.java
@@ -35,12 +35,17 @@ public class AnnotationEntry implements Node {
 
     public static final AnnotationEntry[] EMPTY_ARRAY = {};
 
-    private final int typeIndex;
-    private final ConstantPool constantPool;
-    private final boolean isRuntimeVisible;
-
-    private List<ElementValuePair> elementValuePairs;
-
+    public static AnnotationEntry[] createAnnotationEntries(final Attribute[] attrs) {
+        // Find attributes that contain annotation data
+        final List<AnnotationEntry> accumulatedAnnotations = new ArrayList<>(attrs.length);
+        for (final Attribute attribute : attrs) {
+            if (attribute instanceof Annotations) {
+                final Annotations runtimeAnnotations = (Annotations) attribute;
+                Collections.addAll(accumulatedAnnotations, runtimeAnnotations.getAnnotationEntries());
+            }
+        }
+        return accumulatedAnnotations.toArray(AnnotationEntry.EMPTY_ARRAY);
+    }
     /*
      * Factory method to create an AnnotionEntry from a DataInput
      *
@@ -62,6 +67,13 @@ public class AnnotationEntry implements Node {
         }
         return annotationEntry;
     }
+    private final int typeIndex;
+
+    private final ConstantPool constantPool;
+
+    private final boolean isRuntimeVisible;
+
+    private List<ElementValuePair> elementValuePairs;
 
     public AnnotationEntry(final int type_index, final ConstantPool constant_pool, final boolean isRuntimeVisible) {
         this.typeIndex = type_index;
@@ -69,18 +81,6 @@ public class AnnotationEntry implements Node {
         this.isRuntimeVisible = isRuntimeVisible;
     }
 
-    public int getTypeIndex() {
-        return typeIndex;
-    }
-
-    public ConstantPool getConstantPool() {
-        return constantPool;
-    }
-
-    public boolean isRuntimeVisible() {
-        return isRuntimeVisible;
-    }
-
     /**
      * 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.
@@ -92,6 +92,19 @@ public class AnnotationEntry implements Node {
         v.visitAnnotationEntry(this);
     }
 
+    public void addElementNameValuePair(final ElementValuePair elementNameValuePair) {
+        elementValuePairs.add(elementNameValuePair);
+    }
+
+    public void dump(final DataOutputStream dos) throws IOException {
+        dos.writeShort(typeIndex); // u2 index of type name in cpool
+        dos.writeShort(elementValuePairs.size()); // u2 element_value pair
+        // count
+        for (final ElementValuePair envp : elementValuePairs) {
+            envp.dump(dos);
+        }
+    }
+
     /**
      * @return the annotation type name
      */
@@ -107,11 +120,8 @@ public class AnnotationEntry implements Node {
         return typeIndex;
     }
 
-    /**
-     * @return the number of element value pairs in this annotation entry
-     */
-    public final int getNumElementValuePairs() {
-        return elementValuePairs.size();
+    public ConstantPool getConstantPool() {
+        return constantPool;
     }
 
     /**
@@ -122,17 +132,19 @@ public class AnnotationEntry implements Node {
         return elementValuePairs.toArray(ElementValuePair.EMPTY_ARRAY);
     }
 
-    public void dump(final DataOutputStream dos) throws IOException {
-        dos.writeShort(typeIndex); // u2 index of type name in cpool
-        dos.writeShort(elementValuePairs.size()); // u2 element_value pair
-        // count
-        for (final ElementValuePair envp : elementValuePairs) {
-            envp.dump(dos);
-        }
+    /**
+     * @return the number of element value pairs in this annotation entry
+     */
+    public final int getNumElementValuePairs() {
+        return elementValuePairs.size();
     }
 
-    public void addElementNameValuePair(final ElementValuePair elementNameValuePair) {
-        elementValuePairs.add(elementNameValuePair);
+    public int getTypeIndex() {
+        return typeIndex;
+    }
+
+    public boolean isRuntimeVisible() {
+        return isRuntimeVisible;
     }
 
     public String toShortString() {
@@ -157,16 +169,4 @@ public class AnnotationEntry implements Node {
     public String toString() {
         return toShortString();
     }
-
-    public static AnnotationEntry[] createAnnotationEntries(final Attribute[] attrs) {
-        // Find attributes that contain annotation data
-        final List<AnnotationEntry> accumulatedAnnotations = new ArrayList<>(attrs.length);
-        for (final Attribute attribute : attrs) {
-            if (attribute instanceof Annotations) {
-                final Annotations runtimeAnnotations = (Annotations) attribute;
-                Collections.addAll(accumulatedAnnotations, runtimeAnnotations.getAnnotationEntries());
-            }
-        }
-        return accumulatedAnnotations.toArray(AnnotationEntry.EMPTY_ARRAY);
-    }
 }
diff --git a/src/main/java/org/apache/bcel/classfile/Annotations.java b/src/main/java/org/apache/bcel/classfile/Annotations.java
index 8202b847..4dee8518 100644
--- a/src/main/java/org/apache/bcel/classfile/Annotations.java
+++ b/src/main/java/org/apache/bcel/classfile/Annotations.java
@@ -33,6 +33,21 @@ public abstract class Annotations extends Attribute {
     private AnnotationEntry[] annotationTable;
     private final boolean isRuntimeVisible;
 
+    /**
+     * @param annotationType the subclass type of the annotation
+     * @param nameIndex Index pointing to the name <em>Code</em>
+     * @param length Content length in bytes
+     * @param annotationTable the actual annotations
+     * @param constantPool Array of constants
+     * @param isRuntimeVisible whether this Annotation visible at runtime
+     */
+    public Annotations(final byte annotationType, final int nameIndex, final int length, final AnnotationEntry[] annotationTable,
+            final ConstantPool constantPool, final boolean isRuntimeVisible) {
+        super(annotationType, nameIndex, length, constantPool);
+        this.annotationTable = annotationTable;
+        this.isRuntimeVisible = isRuntimeVisible;
+    }
+
     /**
      * @param annotation_type the subclass type of the annotation
      * @param name_index Index pointing to the name <em>Code</em>
@@ -52,21 +67,6 @@ public abstract class Annotations extends Attribute {
         }
     }
 
-    /**
-     * @param annotationType the subclass type of the annotation
-     * @param nameIndex Index pointing to the name <em>Code</em>
-     * @param length Content length in bytes
-     * @param annotationTable the actual annotations
-     * @param constantPool Array of constants
-     * @param isRuntimeVisible whether this Annotation visible at runtime
-     */
-    public Annotations(final byte annotationType, final int nameIndex, final int length, final AnnotationEntry[] annotationTable,
-            final ConstantPool constantPool, final boolean isRuntimeVisible) {
-        super(annotationType, nameIndex, length, constantPool);
-        this.annotationTable = annotationTable;
-        this.isRuntimeVisible = isRuntimeVisible;
-    }
-
     /**
      * 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.
@@ -78,13 +78,6 @@ public abstract class Annotations extends Attribute {
         v.visitAnnotation(this);
     }
 
-    /**
-     * @param annotationTable the entries to set in this annotation
-     */
-    public final void setAnnotationTable(final AnnotationEntry[] annotationTable) {
-        this.annotationTable = annotationTable;
-    }
-
     /**
      * returns the array of annotation entries in this annotation
      */
@@ -106,14 +99,11 @@ public abstract class Annotations extends Attribute {
         return isRuntimeVisible;
     }
 
-    protected void writeAnnotations(final DataOutputStream dos) throws IOException {
-        if (annotationTable == null) {
-            return;
-        }
-        dos.writeShort(annotationTable.length);
-        for (final AnnotationEntry element : annotationTable) {
-            element.dump(dos);
-        }
+    /**
+     * @param annotationTable the entries to set in this annotation
+     */
+    public final void setAnnotationTable(final AnnotationEntry[] annotationTable) {
+        this.annotationTable = annotationTable;
     }
 
     /**
@@ -132,4 +122,14 @@ public abstract class Annotations extends Attribute {
         return buf.toString();
     }
 
+    protected void writeAnnotations(final DataOutputStream dos) throws IOException {
+        if (annotationTable == null) {
+            return;
+        }
+        dos.writeShort(annotationTable.length);
+        for (final AnnotationEntry element : annotationTable) {
+            element.dump(dos);
+        }
+    }
+
 }
diff --git a/src/main/java/org/apache/bcel/classfile/ArrayElementValue.java b/src/main/java/org/apache/bcel/classfile/ArrayElementValue.java
index eba7ef1e..dbfcec0a 100644
--- a/src/main/java/org/apache/bcel/classfile/ArrayElementValue.java
+++ b/src/main/java/org/apache/bcel/classfile/ArrayElementValue.java
@@ -28,22 +28,6 @@ public class ArrayElementValue extends ElementValue
     // For array types, this is the array
     private final ElementValue[] elementValues;
 
-    @Override
-    public String toString()
-    {
-        final StringBuilder sb = new StringBuilder();
-        sb.append("{");
-        for (int i = 0; i < elementValues.length; i++)
-        {
-            sb.append(elementValues[i]);
-            if (i + 1 < elementValues.length) {
-                sb.append(",");
-            }
-        }
-        sb.append("}");
-        return sb.toString();
-    }
-
     public ArrayElementValue(final int type, final ElementValue[] datums, final ConstantPool cpool)
     {
         super(type, cpool);
@@ -64,6 +48,16 @@ public class ArrayElementValue extends ElementValue
         }
     }
 
+    public ElementValue[] getElementValuesArray()
+    {
+        return elementValues;
+    }
+
+    public int getElementValuesArraySize()
+    {
+        return elementValues.length;
+    }
+
     @Override
     public String stringifyValue()
     {
@@ -80,13 +74,19 @@ public class ArrayElementValue extends ElementValue
         return sb.toString();
     }
 
-    public ElementValue[] getElementValuesArray()
-    {
-        return elementValues;
-    }
-
-    public int getElementValuesArraySize()
+    @Override
+    public String toString()
     {
-        return elementValues.length;
+        final StringBuilder sb = new StringBuilder();
+        sb.append("{");
+        for (int i = 0; i < elementValues.length; i++)
+        {
+            sb.append(elementValues[i]);
+            if (i + 1 < elementValues.length) {
+                sb.append(",");
+            }
+        }
+        sb.append("}");
+        return sb.toString();
     }
 }
diff --git a/src/main/java/org/apache/bcel/classfile/BootstrapMethod.java b/src/main/java/org/apache/bcel/classfile/BootstrapMethod.java
index 0835a659..dec65a9c 100644
--- a/src/main/java/org/apache/bcel/classfile/BootstrapMethod.java
+++ b/src/main/java/org/apache/bcel/classfile/BootstrapMethod.java
@@ -78,17 +78,29 @@ public class BootstrapMethod implements Cloneable {
     }
 
     /**
-     * @return index into constant_pool of bootstrap_method
+     * @return deep copy of this object
      */
-    public int getBootstrapMethodRef() {
-        return bootstrapMethodRef;
+    public BootstrapMethod copy() {
+        try {
+            return (BootstrapMethod) clone();
+        } catch (final CloneNotSupportedException e) {
+            // TODO should this throw?
+        }
+        return null;
     }
 
     /**
-     * @param bootstrapMethodRef int index into constant_pool of CONSTANT_MethodHandle
+     * Dump object to file stream in binary format.
+     *
+     * @param file Output file stream
+     * @throws IOException
      */
-    public void setBootstrapMethodRef(final int bootstrapMethodRef) {
-        this.bootstrapMethodRef = bootstrapMethodRef;
+    public final void dump(final DataOutputStream file) throws IOException {
+        file.writeShort(bootstrapMethodRef);
+        file.writeShort(bootstrapArguments.length);
+        for (final int bootstrap_argument : bootstrapArguments) {
+            file.writeShort(bootstrap_argument);
+        }
     }
 
     /**
@@ -98,6 +110,13 @@ public class BootstrapMethod implements Cloneable {
         return bootstrapArguments;
     }
 
+    /**
+     * @return index into constant_pool of bootstrap_method
+     */
+    public int getBootstrapMethodRef() {
+        return bootstrapMethodRef;
+    }
+
     /**
      * @return count of number of boostrap arguments
      */
@@ -112,6 +131,13 @@ public class BootstrapMethod implements Cloneable {
         this.bootstrapArguments = bootstrapArguments;
     }
 
+    /**
+     * @param bootstrapMethodRef int index into constant_pool of CONSTANT_MethodHandle
+     */
+    public void setBootstrapMethodRef(final int bootstrapMethodRef) {
+        this.bootstrapMethodRef = bootstrapMethodRef;
+    }
+
     /**
      * @return String representation.
      */
@@ -140,30 +166,4 @@ public class BootstrapMethod implements Cloneable {
         }
         return buf.toString();
     }
-
-    /**
-     * Dump object to file stream in binary format.
-     *
-     * @param file Output file stream
-     * @throws IOException
-     */
-    public final void dump(final DataOutputStream file) throws IOException {
-        file.writeShort(bootstrapMethodRef);
-        file.writeShort(bootstrapArguments.length);
-        for (final int bootstrap_argument : bootstrapArguments) {
-            file.writeShort(bootstrap_argument);
-        }
-    }
-
-    /**
-     * @return deep copy of this object
-     */
-    public BootstrapMethod copy() {
-        try {
-            return (BootstrapMethod) clone();
-        } catch (final CloneNotSupportedException e) {
-            // TODO should this throw?
-        }
-        return null;
-    }
 }
diff --git a/src/main/java/org/apache/bcel/classfile/BootstrapMethods.java b/src/main/java/org/apache/bcel/classfile/BootstrapMethods.java
index 91885231..ab16e1ca 100644
--- a/src/main/java/org/apache/bcel/classfile/BootstrapMethods.java
+++ b/src/main/java/org/apache/bcel/classfile/BootstrapMethods.java
@@ -73,20 +73,6 @@ public class BootstrapMethods extends Attribute {
         }
     }
 
-    /**
-     * @return array of bootstrap method "records"
-     */
-    public final BootstrapMethod[] getBootstrapMethods() {
-        return bootstrapMethods;
-    }
-
-    /**
-     * @param bootstrapMethods the array of bootstrap methods
-     */
-    public final void setBootstrapMethods(final BootstrapMethod[] bootstrapMethods) {
-        this.bootstrapMethods = bootstrapMethods;
-    }
-
     /**
      * @param v Visitor object
      */
@@ -126,6 +112,20 @@ public class BootstrapMethods extends Attribute {
         }
     }
 
+    /**
+     * @return array of bootstrap method "records"
+     */
+    public final BootstrapMethod[] getBootstrapMethods() {
+        return bootstrapMethods;
+    }
+
+    /**
+     * @param bootstrapMethods the array of bootstrap methods
+     */
+    public final void setBootstrapMethods(final BootstrapMethod[] bootstrapMethods) {
+        this.bootstrapMethods = bootstrapMethods;
+    }
+
     /**
      * @return String representation.
      */
diff --git a/src/main/java/org/apache/bcel/classfile/ClassElementValue.java b/src/main/java/org/apache/bcel/classfile/ClassElementValue.java
index 2a62a872..12571f41 100644
--- a/src/main/java/org/apache/bcel/classfile/ClassElementValue.java
+++ b/src/main/java/org/apache/bcel/classfile/ClassElementValue.java
@@ -38,9 +38,11 @@ public class ClassElementValue extends ElementValue
         this.idx = idx;
     }
 
-    public int getIndex()
+    @Override
+    public void dump(final DataOutputStream dos) throws IOException
     {
-        return idx;
+        dos.writeByte(super.getType()); // u1 kind of value
+        dos.writeShort(idx);
     }
 
     public String getClassString()
@@ -50,6 +52,11 @@ public class ClassElementValue extends ElementValue
         return c.getBytes();
     }
 
+    public int getIndex()
+    {
+        return idx;
+    }
+
     @Override
     public String stringifyValue()
     {
@@ -57,11 +64,4 @@ public class ClassElementValue extends ElementValue
                 Const.CONSTANT_Utf8);
         return cu8.getBytes();
     }
-
-    @Override
-    public void dump(final DataOutputStream dos) throws IOException
-    {
-        dos.writeByte(super.getType()); // u1 kind of value
-        dos.writeShort(idx);
-    }
 }
diff --git a/src/main/java/org/apache/bcel/classfile/ClassParser.java b/src/main/java/org/apache/bcel/classfile/ClassParser.java
index 53313aac..b49c2c4b 100644
--- a/src/main/java/org/apache/bcel/classfile/ClassParser.java
+++ b/src/main/java/org/apache/bcel/classfile/ClassParser.java
@@ -42,6 +42,7 @@ import org.apache.bcel.Const;
  */
 public final class ClassParser {
 
+    private static final int BUFSIZE = 8192;
     private DataInputStream dataInputStream;
     private final boolean fileOwned;
     private final String fileName;
@@ -57,7 +58,6 @@ public final class ClassParser {
     private Method[] methods; // methods defined in the class
     private Attribute[] attributes; // attributes defined in the class
     private final boolean isZip; // Loaded from zip file
-    private static final int BUFSIZE = 8192;
 
 
     /**
diff --git a/src/main/java/org/apache/bcel/classfile/Code.java b/src/main/java/org/apache/bcel/classfile/Code.java
index cedc5352..7bdd0a2d 100644
--- a/src/main/java/org/apache/bcel/classfile/Code.java
+++ b/src/main/java/org/apache/bcel/classfile/Code.java
@@ -133,6 +133,46 @@ public final class Code extends Attribute {
     }
 
 
+    /**
+     * @return the full size of this code attribute, minus its first 6 bytes,
+     * including the size of all its contained attributes
+     */
+    private int calculateLength() {
+        int len = 0;
+        if (attributes != null) {
+            for (final Attribute attribute : attributes) {
+                len += attribute.getLength() + 6 /*attribute header size*/;
+            }
+        }
+        return len + getInternalLength();
+    }
+
+
+    /**
+     * @return deep copy of this attribute
+     *
+     * @param _constant_pool the constant pool to duplicate
+     */
+    @Override
+    public Attribute copy( final ConstantPool _constant_pool ) {
+        final Code c = (Code) clone();
+        if (code != null) {
+            c.code = new byte[code.length];
+            System.arraycopy(code, 0, c.code, 0, code.length);
+        }
+        c.setConstantPool(_constant_pool);
+        c.exceptionTable = new CodeException[exceptionTable.length];
+        for (int i = 0; i < exceptionTable.length; i++) {
+            c.exceptionTable[i] = exceptionTable[i].copy();
+        }
+        c.attributes = new Attribute[attributes.length];
+        for (int i = 0; i < attributes.length; i++) {
+            c.attributes[i] = attributes[i].copy(_constant_pool);
+        }
+        return c;
+    }
+
+
     /**
      * Dump code attribute to file stream in binary format.
      *
@@ -166,6 +206,36 @@ public final class Code extends Attribute {
     }
 
 
+    /**
+     * @return Actual byte code of the method.
+     */
+    public byte[] getCode() {
+        return code;
+    }
+
+
+    /**
+     * @return Table of handled exceptions.
+     * @see CodeException
+     */
+    public CodeException[] getExceptionTable() {
+        return exceptionTable;
+    }
+
+
+    /**
+     * @return the internal length of this code attribute (minus the first 6 bytes)
+     * and excluding all its attributes
+     */
+    private int getInternalLength() {
+        return 2 /*maxStack*/+ 2 /*maxLocals*/+ 4 /*code length*/
+                + code.length /*byte-code*/
+                + 2 /*exception-table length*/
+                + 8 * (exceptionTable == null ? 0 : exceptionTable.length) /* exception table */
+                + 2 /* attributes count */;
+    }
+
+
     /**
      * @return LineNumberTable of Code, if it has one
      */
@@ -192,23 +262,6 @@ public final class Code extends Attribute {
     }
 
 
-    /**
-     * @return Actual byte code of the method.
-     */
-    public byte[] getCode() {
-        return code;
-    }
-
-
-    /**
-     * @return Table of handled exceptions.
-     * @see CodeException
-     */
-    public CodeException[] getExceptionTable() {
-        return exceptionTable;
-    }
-
-
     /**
      * @return Number of local variables.
      */
@@ -225,34 +278,6 @@ public final class Code extends Attribute {
     }
 
 
-    /**
-     * @return the internal length of this code attribute (minus the first 6 bytes)
-     * and excluding all its attributes
-     */
-    private int getInternalLength() {
-        return 2 /*maxStack*/+ 2 /*maxLocals*/+ 4 /*code length*/
-                + code.length /*byte-code*/
-                + 2 /*exception-table length*/
-                + 8 * (exceptionTable == null ? 0 : exceptionTable.length) /* exception table */
-                + 2 /* attributes count */;
-    }
-
-
-    /**
-     * @return the full size of this code attribute, minus its first 6 bytes,
-     * including the size of all its contained attributes
-     */
-    private int calculateLength() {
-        int len = 0;
-        if (attributes != null) {
-            for (final Attribute attribute : attributes) {
-                len += attribute.getLength() + 6 /*attribute header size*/;
-            }
-        }
-        return len + getInternalLength();
-    }
-
-
     /**
      * @param attributes the attributes to set for this Code
      */
@@ -296,6 +321,15 @@ public final class Code extends Attribute {
     }
 
 
+    /**
+     * @return String representation of code chunk.
+     */
+    @Override
+    public String toString() {
+        return toString(true);
+    }
+
+
     /**
      * @return String representation of code chunk.
      */
@@ -319,38 +353,4 @@ public final class Code extends Attribute {
         }
         return buf.toString();
     }
-
-
-    /**
-     * @return String representation of code chunk.
-     */
-    @Override
-    public String toString() {
-        return toString(true);
-    }
-
-
-    /**
-     * @return deep copy of this attribute
-     *
-     * @param _constant_pool the constant pool to duplicate
-     */
-    @Override
-    public Attribute copy( final ConstantPool _constant_pool ) {
-        final Code c = (Code) clone();
-        if (code != null) {
-            c.code = new byte[code.length];
-            System.arraycopy(code, 0, c.code, 0, code.length);
-        }
-        c.setConstantPool(_constant_pool);
-        c.exceptionTable = new CodeException[exceptionTable.length];
-        for (int i = 0; i < exceptionTable.length; i++) {
-            c.exceptionTable[i] = exceptionTable[i].copy();
-        }
-        c.attributes = new Attribute[attributes.length];
-        for (int i = 0; i < attributes.length; i++) {
-            c.attributes[i] = attributes[i].copy(_constant_pool);
-        }
-        return c;
-    }
 }
diff --git a/src/main/java/org/apache/bcel/classfile/CodeException.java b/src/main/java/org/apache/bcel/classfile/CodeException.java
index c0fdfeeb..8181f004 100644
--- a/src/main/java/org/apache/bcel/classfile/CodeException.java
+++ b/src/main/java/org/apache/bcel/classfile/CodeException.java
@@ -33,21 +33,21 @@ import org.apache.bcel.Constants;
  */
 public final class CodeException implements Cloneable, Node, Constants {
 
+    /**
+     * Empty array.
+     */
+    static final CodeException[] EMPTY_CODE_EXCEPTION_ARRAY = {};
     private int startPc; // Range in the code the exception handler is
     private int endPc; // active. startPc is inclusive, endPc exclusive
     private int handlerPc; /* Starting address of exception handler, i.e.,
      * an offset from start of code.
      */
+
     private int catchType; /* If this is zero the handler catches any
      * exception, otherwise it points to the
      * exception class which is to be caught.
      */
 
-    /**
-     * Empty array.
-     */
-    static final CodeException[] EMPTY_CODE_EXCEPTION_ARRAY = {};
-
 
     /**
      * Initialize from another object.
@@ -99,6 +99,19 @@ public final class CodeException implements Cloneable, Node, Constants {
     }
 
 
+    /**
+     * @return deep copy of this object
+     */
+    public CodeException copy() {
+        try {
+            return (CodeException) clone();
+        } catch (final CloneNotSupportedException e) {
+            // TODO should this throw?
+        }
+        return null;
+    }
+
+
     /**
      * Dump code exception to file stream in binary format.
      *
@@ -188,6 +201,11 @@ public final class CodeException implements Cloneable, Node, Constants {
     }
 
 
+    public String toString( final ConstantPool cp ) {
+        return toString(cp, true);
+    }
+
+
     /**
      * @return String representation.
      */
@@ -201,22 +219,4 @@ public final class CodeException implements Cloneable, Node, Constants {
         }
         return startPc + "\t" + endPc + "\t" + handlerPc + "\t" + str;
     }
-
-
-    public String toString( final ConstantPool cp ) {
-        return toString(cp, true);
-    }
-
-
-    /**
-     * @return deep copy of this object
-     */
-    public CodeException copy() {
-        try {
-            return (CodeException) clone();
-        } catch (final CloneNotSupportedException e) {
-            // TODO should this throw?
-        }
-        return null;
-    }
 }
diff --git a/src/main/java/org/apache/bcel/classfile/Constant.java b/src/main/java/org/apache/bcel/classfile/Constant.java
index 36061ed2..579632ee 100644
--- a/src/main/java/org/apache/bcel/classfile/Constant.java
+++ b/src/main/java/org/apache/bcel/classfile/Constant.java
@@ -49,71 +49,11 @@ public abstract class Constant implements Cloneable, Node {
         }
     };
 
-    /* In fact this tag is redundant since we can distinguish different
-     * `Constant' objects by their type, i.e., via `instanceof'. In some
-     * places we will use the tag for switch()es anyway.
-     *
-     * First, we want match the specification as closely as possible. Second we
-     * need the tag as an index to select the corresponding class name from the
-     * `CONSTANT_NAMES' array.
-     */
-    /**
-     * @deprecated (since 6.0) will be made private; do not access directly, use getter/setter
-     */
-    @java.lang.Deprecated
-    protected byte tag; // TODO should be private & final
-
-    Constant(final byte tag) {
-        this.tag = tag;
-    }
-
     /**
-     * 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
-     */
-    @Override
-    public abstract void accept( Visitor v );
-
-    public abstract void dump( DataOutputStream file ) throws IOException;
-
-    /**
-     * @return Tag of constant, i.e., its type. No setTag() method to avoid
-     * confusion.
-     */
-    public final byte getTag() {
-        return tag;
-    }
-
-    /**
-     * @return String representation.
-     */
-    @Override
-    public String toString() {
-        return Const.getConstantName(tag) + "[" + tag + "]";
-    }
-
-    /**
-     * @return deep copy of this constant
+     * @return Comparison strategy object
      */
-    public Constant copy() {
-        try {
-            return (Constant) super.clone();
-        } catch (final CloneNotSupportedException e) {
-            // TODO should this throw?
-        }
-        return null;
-    }
-
-    @Override
-    public Object clone() {
-        try {
-            return super.clone();
-        } catch (final CloneNotSupportedException e) {
-            throw new Error("Clone Not Supported"); // never happens
-        }
+    public static BCELComparator getComparator() {
+        return bcelComparator;
     }
 
     /**
@@ -168,19 +108,63 @@ public abstract class Constant implements Cloneable, Node {
     }
 
     /**
-     * @return Comparison strategy object
+     * @param comparator Comparison strategy object
      */
-    public static BCELComparator getComparator() {
-        return bcelComparator;
+    public static void setComparator( final BCELComparator comparator ) {
+        bcelComparator = comparator;
     }
 
+    /* In fact this tag is redundant since we can distinguish different
+     * `Constant' objects by their type, i.e., via `instanceof'. In some
+     * places we will use the tag for switch()es anyway.
+     *
+     * First, we want match the specification as closely as possible. Second we
+     * need the tag as an index to select the corresponding class name from the
+     * `CONSTANT_NAMES' array.
+     */
     /**
-     * @param comparator Comparison strategy object
+     * @deprecated (since 6.0) will be made private; do not access directly, use getter/setter
      */
-    public static void setComparator( final BCELComparator comparator ) {
-        bcelComparator = comparator;
+    @java.lang.Deprecated
+    protected byte tag; // TODO should be private & final
+
+    Constant(final byte tag) {
+        this.tag = tag;
     }
 
+    /**
+     * 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
+     */
+    @Override
+    public abstract void accept( Visitor v );
+
+    @Override
+    public Object clone() {
+        try {
+            return super.clone();
+        } catch (final CloneNotSupportedException e) {
+            throw new Error("Clone Not Supported"); // never happens
+        }
+    }
+
+    /**
+     * @return deep copy of this constant
+     */
+    public Constant copy() {
+        try {
+            return (Constant) super.clone();
+        } catch (final CloneNotSupportedException e) {
+            // TODO should this throw?
+        }
+        return null;
+    }
+
+    public abstract void dump( DataOutputStream file ) throws IOException;
+
     /**
      * Returns value as defined by given BCELComparator strategy.
      * By default two Constant objects are said to be equal when
@@ -193,6 +177,14 @@ public abstract class Constant implements Cloneable, Node {
         return bcelComparator.equals(this, obj);
     }
 
+    /**
+     * @return Tag of constant, i.e., its type. No setTag() method to avoid
+     * confusion.
+     */
+    public final byte getTag() {
+        return tag;
+    }
+
     /**
      * Returns value as defined by given BCELComparator strategy.
      * By default return the hashcode of the result of toString().
@@ -203,4 +195,12 @@ public abstract class Constant implements Cloneable, Node {
     public int hashCode() {
         return bcelComparator.hashCode(this);
     }
+
+    /**
+     * @return String representation.
+     */
+    @Override
+    public String toString() {
+        return Const.getConstantName(tag) + "[" + tag + "]";
+    }
 }
diff --git a/src/main/java/org/apache/bcel/classfile/ConstantCP.java b/src/main/java/org/apache/bcel/classfile/ConstantCP.java
index 73e675c7..f83d76b7 100644
--- a/src/main/java/org/apache/bcel/classfile/ConstantCP.java
+++ b/src/main/java/org/apache/bcel/classfile/ConstantCP.java
@@ -52,14 +52,6 @@ public abstract class ConstantCP extends Constant {
     protected int name_and_type_index; // TODO make private (has getter & setter)
 
 
-    /**
-     * Initialize from another object.
-     */
-    public ConstantCP(final ConstantCP c) {
-        this(c.getTag(), c.getClassIndex(), c.getNameAndTypeIndex());
-    }
-
-
     /**
      * Initialize instance from file data.
      *
@@ -83,6 +75,14 @@ public abstract class ConstantCP extends Constant {
     }
 
 
+    /**
+     * Initialize from another object.
+     */
+    public ConstantCP(final ConstantCP c) {
+        this(c.getTag(), c.getClassIndex(), c.getNameAndTypeIndex());
+    }
+
+
     /**
      * Dump constant field reference to file stream in binary format.
      *
@@ -98,18 +98,18 @@ public abstract class ConstantCP extends Constant {
 
 
     /**
-     * @return Reference (index) to class this constant refers to.
+     * @return Class this field belongs to.
      */
-    public final int getClassIndex() {
-        return class_index;
+    public String getClass( final ConstantPool cp ) {
+        return cp.constantToString(class_index, Const.CONSTANT_Class);
     }
 
 
     /**
-     * @param class_index points to Constant_class
+     * @return Reference (index) to class this constant refers to.
      */
-    public final void setClassIndex( final int class_index ) {
-        this.class_index = class_index;
+    public final int getClassIndex() {
+        return class_index;
     }
 
 
@@ -122,18 +122,18 @@ public abstract class ConstantCP extends Constant {
 
 
     /**
-     * @param name_and_type_index points to Constant_NameAndType
+     * @param class_index points to Constant_class
      */
-    public final void setNameAndTypeIndex( final int name_and_type_index ) {
-        this.name_and_type_index = name_and_type_index;
+    public final void setClassIndex( final int class_index ) {
+        this.class_index = class_index;
     }
 
 
     /**
-     * @return Class this field belongs to.
+     * @param name_and_type_index points to Constant_NameAndType
      */
-    public String getClass( final ConstantPool cp ) {
-        return cp.constantToString(class_index, Const.CONSTANT_Class);
+    public final void setNameAndTypeIndex( final int name_and_type_index ) {
+        this.name_and_type_index = name_and_type_index;
     }
 
 
diff --git a/src/main/java/org/apache/bcel/classfile/ConstantClass.java b/src/main/java/org/apache/bcel/classfile/ConstantClass.java
index f77ecc3d..c25318b6 100644
--- a/src/main/java/org/apache/bcel/classfile/ConstantClass.java
+++ b/src/main/java/org/apache/bcel/classfile/ConstantClass.java
@@ -89,19 +89,10 @@ public final class ConstantClass extends Constant implements ConstantObject {
     }
 
 
-    /**
-     * @return Name index in constant pool of class name.
-     */
-    public int getNameIndex() {
-        return nameIndex;
-    }
-
-
-    /**
-     * @param nameIndex the name index in the constant pool of this Constant Class
+    /** @return dereferenced string
      */
-    public void setNameIndex( final int nameIndex ) {
-        this.nameIndex = nameIndex;
+    public String getBytes( final ConstantPool cp ) {
+        return (String) getConstantValue(cp);
     }
 
 
@@ -114,10 +105,19 @@ public final class ConstantClass extends Constant implements ConstantObject {
     }
 
 
-    /** @return dereferenced string
+    /**
+     * @return Name index in constant pool of class name.
      */
-    public String getBytes( final ConstantPool cp ) {
-        return (String) getConstantValue(cp);
+    public int getNameIndex() {
+        return nameIndex;
+    }
+
+
+    /**
+     * @param nameIndex the name index in the constant pool of this Constant Class
+     */
+    public void setNameIndex( final int nameIndex ) {
+        this.nameIndex = nameIndex;
     }
 
 
diff --git a/src/main/java/org/apache/bcel/classfile/ConstantDouble.java b/src/main/java/org/apache/bcel/classfile/ConstantDouble.java
index 3f7b8b41..6267f944 100644
--- a/src/main/java/org/apache/bcel/classfile/ConstantDouble.java
+++ b/src/main/java/org/apache/bcel/classfile/ConstantDouble.java
@@ -34,15 +34,6 @@ public final class ConstantDouble extends Constant implements ConstantObject {
     private double bytes;
 
 
-    /**
-     * @param bytes Data
-     */
-    public ConstantDouble(final double bytes) {
-        super(Const.CONSTANT_Double);
-        this.bytes = bytes;
-    }
-
-
     /**
      * Initialize from another object.
      */
@@ -62,6 +53,15 @@ public final class ConstantDouble extends Constant implements ConstantObject {
     }
 
 
+    /**
+     * @param bytes Data
+     */
+    public ConstantDouble(final double bytes) {
+        super(Const.CONSTANT_Double);
+        this.bytes = bytes;
+    }
+
+
     /**
      * 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,
@@ -96,6 +96,14 @@ public final class ConstantDouble extends Constant implements ConstantObject {
     }
 
 
+    /** @return Double object
+     */
+    @Override
+    public Object getConstantValue( final ConstantPool cp ) {
+        return Double.valueOf(bytes);
+    }
+
+
     /**
      * @param bytes the raw bytes that represent the double value
      */
@@ -111,12 +119,4 @@ public final class ConstantDouble extends Constant implements ConstantObject {
     public String toString() {
         return super.toString() + "(bytes = " + bytes + ")";
     }
-
-
-    /** @return Double object
-     */
-    @Override
-    public Object getConstantValue( final ConstantPool cp ) {
-        return Double.valueOf(bytes);
-    }
 }
diff --git a/src/main/java/org/apache/bcel/classfile/ConstantFloat.java b/src/main/java/org/apache/bcel/classfile/ConstantFloat.java
index fad62e71..c5b3e7b3 100644
--- a/src/main/java/org/apache/bcel/classfile/ConstantFloat.java
+++ b/src/main/java/org/apache/bcel/classfile/ConstantFloat.java
@@ -34,15 +34,6 @@ public final class ConstantFloat extends Constant implements ConstantObject {
     private float bytes;
 
 
-    /**
-     * @param bytes Data
-     */
-    public ConstantFloat(final float bytes) {
-        super(Const.CONSTANT_Float);
-        this.bytes = bytes;
-    }
-
-
     /**
      * Initialize from another object. Note that both objects use the same
      * references (shallow copy). Use clone() for a physical copy.
@@ -63,6 +54,15 @@ public final class ConstantFloat extends Constant implements ConstantObject {
     }
 
 
+    /**
+     * @param bytes Data
+     */
+    public ConstantFloat(final float bytes) {
+        super(Const.CONSTANT_Float);
+        this.bytes = bytes;
+    }
+
+
     /**
      * 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,
@@ -97,6 +97,14 @@ public final class ConstantFloat extends Constant implements ConstantObject {
     }
 
 
+    /** @return Float object
+     */
+    @Override
+    public Object getConstantValue( final ConstantPool cp ) {
+        return Float.valueOf(bytes);
+    }
+
+
     /**
      * @param bytes the raw bytes that represent this float
      */
@@ -112,12 +120,4 @@ public final class ConstantFloat extends Constant implements ConstantObject {
     public String toString() {
         return super.toString() + "(bytes = " + bytes + ")";
     }
-
-
-    /** @return Float object
-     */
-    @Override
-    public Object getConstantValue( final ConstantPool cp ) {
-        return Float.valueOf(bytes);
-    }
 }
diff --git a/src/main/java/org/apache/bcel/classfile/ConstantInteger.java b/src/main/java/org/apache/bcel/classfile/ConstantInteger.java
index 68b524da..7769913e 100644
--- a/src/main/java/org/apache/bcel/classfile/ConstantInteger.java
+++ b/src/main/java/org/apache/bcel/classfile/ConstantInteger.java
@@ -34,15 +34,6 @@ public final class ConstantInteger extends Constant implements ConstantObject {
     private int bytes;
 
 
-    /**
-     * @param bytes Data
-     */
-    public ConstantInteger(final int bytes) {
-        super(Const.CONSTANT_Integer);
-        this.bytes = bytes;
-    }
-
-
     /**
      * Initialize from another object.
      */
@@ -62,6 +53,15 @@ public final class ConstantInteger extends Constant implements ConstantObject {
     }
 
 
+    /**
+     * @param bytes Data
+     */
+    public ConstantInteger(final int bytes) {
+        super(Const.CONSTANT_Integer);
+        this.bytes = bytes;
+    }
+
+
     /**
      * 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,
@@ -96,6 +96,14 @@ public final class ConstantInteger extends Constant implements ConstantObject {
     }
 
 
+    /** @return Integer object
+     */
+    @Override
+    public Object getConstantValue( final ConstantPool cp ) {
+        return Integer.valueOf(bytes);
+    }
+
+
     /**
      * @param bytes the raw bytes that represent this integer
      */
@@ -111,12 +119,4 @@ public final class ConstantInteger extends Constant implements ConstantObject {
     public String toString() {
         return super.toString() + "(bytes = " + bytes + ")";
     }
-
-
-    /** @return Integer object
-     */
-    @Override
-    public Object getConstantValue( final ConstantPool cp ) {
-        return Integer.valueOf(bytes);
-    }
 }
diff --git a/src/main/java/org/apache/bcel/classfile/ConstantLong.java b/src/main/java/org/apache/bcel/classfile/ConstantLong.java
index 821c3397..b2981a16 100644
--- a/src/main/java/org/apache/bcel/classfile/ConstantLong.java
+++ b/src/main/java/org/apache/bcel/classfile/ConstantLong.java
@@ -34,15 +34,6 @@ public final class ConstantLong extends Constant implements ConstantObject {
     private long bytes;
 
 
-    /**
-     * @param bytes Data
-     */
-    public ConstantLong(final long bytes) {
-        super(Const.CONSTANT_Long);
-        this.bytes = bytes;
-    }
-
-
     /**
      * Initialize from another object.
      */
@@ -62,6 +53,15 @@ public final class ConstantLong extends Constant implements ConstantObject {
     }
 
 
+    /**
+     * @param bytes Data
+     */
+    public ConstantLong(final long bytes) {
+        super(Const.CONSTANT_Long);
+        this.bytes = bytes;
+    }
+
+
     /**
      * 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,
@@ -96,6 +96,14 @@ public final class ConstantLong extends Constant implements ConstantObject {
     }
 
 
+    /** @return Long object
+     */
+    @Override
+    public Object getConstantValue( final ConstantPool cp ) {
+        return Long.valueOf(bytes);
+    }
+
+
     /**
      * @param bytes the raw bytes that represent this long
      */
@@ -111,12 +119,4 @@ public final class ConstantLong extends Constant implements ConstantObject {
     public String toString() {
         return super.toString() + "(bytes = " + bytes + ")";
     }
-
-
-    /** @return Long object
-     */
-    @Override
-    public Object getConstantValue( final ConstantPool cp ) {
-        return Long.valueOf(bytes);
-    }
 }
diff --git a/src/main/java/org/apache/bcel/classfile/ConstantMethodHandle.java b/src/main/java/org/apache/bcel/classfile/ConstantMethodHandle.java
index cd68fd4b..524be707 100644
--- a/src/main/java/org/apache/bcel/classfile/ConstantMethodHandle.java
+++ b/src/main/java/org/apache/bcel/classfile/ConstantMethodHandle.java
@@ -89,23 +89,23 @@ public final class ConstantMethodHandle extends Constant {
     }
 
 
-    public int getReferenceKind() {
-        return referenceKind;
+    public int getReferenceIndex() {
+        return referenceIndex;
     }
 
 
-    public void setReferenceKind(final int reference_kind) {
-        this.referenceKind = reference_kind;
+    public int getReferenceKind() {
+        return referenceKind;
     }
 
 
-    public int getReferenceIndex() {
-        return referenceIndex;
+    public void setReferenceIndex(final int reference_index) {
+        this.referenceIndex = reference_index;
     }
 
 
-    public void setReferenceIndex(final int reference_index) {
-        this.referenceIndex = reference_index;
+    public void setReferenceKind(final int reference_kind) {
+        this.referenceKind = reference_kind;
     }
 
 
diff --git a/src/main/java/org/apache/bcel/classfile/ConstantModule.java b/src/main/java/org/apache/bcel/classfile/ConstantModule.java
index 66cc2035..53646d3f 100644
--- a/src/main/java/org/apache/bcel/classfile/ConstantModule.java
+++ b/src/main/java/org/apache/bcel/classfile/ConstantModule.java
@@ -92,19 +92,10 @@ public final class ConstantModule extends Constant implements ConstantObject {
     }
 
 
-    /**
-     * @return Name index in constant pool of module name.
-     */
-    public int getNameIndex() {
-        return nameIndex;
-    }
-
-
-    /**
-     * @param nameIndex the name index in the constant pool of this Constant Module
+    /** @return dereferenced string
      */
-    public void setNameIndex( final int nameIndex ) {
-        this.nameIndex = nameIndex;
+    public String getBytes( final ConstantPool cp ) {
+        return (String) getConstantValue(cp);
     }
 
 
@@ -117,10 +108,19 @@ public final class ConstantModule extends Constant implements ConstantObject {
     }
 
 
-    /** @return dereferenced string
+    /**
+     * @return Name index in constant pool of module name.
      */
-    public String getBytes( final ConstantPool cp ) {
-        return (String) getConstantValue(cp);
+    public int getNameIndex() {
+        return nameIndex;
+    }
+
+
+    /**
+     * @param nameIndex the name index in the constant pool of this Constant Module
+     */
+    public void setNameIndex( final int nameIndex ) {
+        this.nameIndex = nameIndex;
     }
 
 
diff --git a/src/main/java/org/apache/bcel/classfile/ConstantNameAndType.java b/src/main/java/org/apache/bcel/classfile/ConstantNameAndType.java
index 01982ea5..b8f8bf5f 100644
--- a/src/main/java/org/apache/bcel/classfile/ConstantNameAndType.java
+++ b/src/main/java/org/apache/bcel/classfile/ConstantNameAndType.java
@@ -93,6 +93,13 @@ public final class ConstantNameAndType extends Constant {
     }
 
 
+    /** @return name
+     */
+    public String getName( final ConstantPool cp ) {
+        return cp.constantToString(getNameIndex(), Const.CONSTANT_Utf8);
+    }
+
+
     /**
      * @return Name index in constant pool of field/method name.
      */
@@ -101,10 +108,10 @@ public final class ConstantNameAndType extends Constant {
     }
 
 
-    /** @return name
+    /** @return signature
      */
-    public String getName( final ConstantPool cp ) {
-        return cp.constantToString(getNameIndex(), Const.CONSTANT_Utf8);
+    public String getSignature( final ConstantPool cp ) {
+        return cp.constantToString(getSignatureIndex(), Const.CONSTANT_Utf8);
     }
 
 
@@ -116,13 +123,6 @@ public final class ConstantNameAndType extends Constant {
     }
 
 
-    /** @return signature
-     */
-    public String getSignature( final ConstantPool cp ) {
-        return cp.constantToString(getSignatureIndex(), Const.CONSTANT_Utf8);
-    }
-
-
     /**
      * @param nameIndex the name index of this constant
      */
diff --git a/src/main/java/org/apache/bcel/classfile/ConstantPackage.java b/src/main/java/org/apache/bcel/classfile/ConstantPackage.java
index 3f94c749..54ae7288 100644
--- a/src/main/java/org/apache/bcel/classfile/ConstantPackage.java
+++ b/src/main/java/org/apache/bcel/classfile/ConstantPackage.java
@@ -92,19 +92,10 @@ public final class ConstantPackage extends Constant implements ConstantObject {
     }
 
 
-    /**
-     * @return Name index in constant pool of package name.
-     */
-    public int getNameIndex() {
-        return nameIndex;
-    }
-
-
-    /**
-     * @param nameIndex the name index in the constant pool of this Constant Package
+    /** @return dereferenced string
      */
-    public void setNameIndex( final int nameIndex ) {
-        this.nameIndex = nameIndex;
+    public String getBytes( final ConstantPool cp ) {
+        return (String) getConstantValue(cp);
     }
 
 
@@ -117,10 +108,19 @@ public final class ConstantPackage extends Constant implements ConstantObject {
     }
 
 
-    /** @return dereferenced string
+    /**
+     * @return Name index in constant pool of package name.
      */
-    public String getBytes( final ConstantPool cp ) {
-        return (String) getConstantValue(cp);
+    public int getNameIndex() {
+        return nameIndex;
+    }
+
+
+    /**
+     * @param nameIndex the name index in the constant pool of this Constant Package
+     */
+    public void setNameIndex( final int nameIndex ) {
+        this.nameIndex = nameIndex;
     }
 
 
diff --git a/src/main/java/org/apache/bcel/classfile/ConstantPool.java b/src/main/java/org/apache/bcel/classfile/ConstantPool.java
index 5b36e8ab..d8a5514f 100644
--- a/src/main/java/org/apache/bcel/classfile/ConstantPool.java
+++ b/src/main/java/org/apache/bcel/classfile/ConstantPool.java
@@ -36,6 +36,34 @@ import org.apache.bcel.Const;
  */
 public class ConstantPool implements Cloneable, Node {
 
+    private static String escape( final String str ) {
+        final int len = str.length();
+        final StringBuilder buf = new StringBuilder(len + 5);
+        final char[] ch = str.toCharArray();
+        for (int i = 0; i < len; i++) {
+            switch (ch[i]) {
+                case '\n':
+                    buf.append("\\n");
+                    break;
+                case '\r':
+                    buf.append("\\r");
+                    break;
+                case '\t':
+                    buf.append("\\t");
+                    break;
+                case '\b':
+                    buf.append("\\b");
+                    break;
+                case '"':
+                    buf.append("\\\"");
+                    break;
+                default:
+                    buf.append(ch[i]);
+            }
+        }
+        return buf.toString();
+    }
+
     private Constant[] constantPool;
 
     /**
@@ -170,34 +198,6 @@ public class ConstantPool implements Cloneable, Node {
         return str;
     }
 
-    private static String escape( final String str ) {
-        final int len = str.length();
-        final StringBuilder buf = new StringBuilder(len + 5);
-        final char[] ch = str.toCharArray();
-        for (int i = 0; i < len; i++) {
-            switch (ch[i]) {
-                case '\n':
-                    buf.append("\\n");
-                    break;
-                case '\r':
-                    buf.append("\\r");
-                    break;
-                case '\t':
-                    buf.append("\\t");
-                    break;
-                case '\b':
-                    buf.append("\\b");
-                    break;
-                case '"':
-                    buf.append("\\\"");
-                    break;
-                default:
-                    buf.append(ch[i]);
-            }
-        }
-        return buf.toString();
-    }
-
     /**
      * Retrieves constant at `index' from constant pool and resolve it to
      * a string representation.
@@ -211,6 +211,25 @@ public class ConstantPool implements Cloneable, Node {
         return constantToString(c);
     }
 
+    /**
+     * @return deep copy of this constant pool
+     */
+    public ConstantPool copy() {
+        ConstantPool c = null;
+        try {
+            c = (ConstantPool) clone();
+            c.constantPool = new Constant[constantPool.length];
+            for (int i = 1; i < constantPool.length; i++) {
+                if (constantPool[i] != null) {
+                    c.constantPool[i] = constantPool[i].copy();
+                }
+            }
+        } catch (final CloneNotSupportedException e) {
+            // TODO should this throw?
+        }
+        return c;
+    }
+
     /**
      * Dump constant pool to file stream in binary format.
      *
@@ -273,6 +292,7 @@ public class ConstantPool implements Cloneable, Node {
         return constantPool;
     }
 
+
     /**
      * Gets string from constant pool and bypass the indirection of
      * `ConstantClass' and `ConstantString' objects. I.e. these classes have
@@ -357,24 +377,4 @@ public class ConstantPool implements Cloneable, Node {
         }
         return buf.toString();
     }
-
-
-    /**
-     * @return deep copy of this constant pool
-     */
-    public ConstantPool copy() {
-        ConstantPool c = null;
-        try {
-            c = (ConstantPool) clone();
-            c.constantPool = new Constant[constantPool.length];
-            for (int i = 1; i < constantPool.length; i++) {
-                if (constantPool[i] != null) {
-                    c.constantPool[i] = constantPool[i].copy();
-                }
-            }
-        } catch (final CloneNotSupportedException e) {
-            // TODO should this throw?
-        }
-        return c;
-    }
 }
diff --git a/src/main/java/org/apache/bcel/classfile/ConstantString.java b/src/main/java/org/apache/bcel/classfile/ConstantString.java
index e3458d2b..f77a96b2 100644
--- a/src/main/java/org/apache/bcel/classfile/ConstantString.java
+++ b/src/main/java/org/apache/bcel/classfile/ConstantString.java
@@ -88,6 +88,22 @@ public final class ConstantString extends Constant implements ConstantObject {
     }
 
 
+    /** @return dereferenced string
+     */
+    public String getBytes( final ConstantPool cp ) {
+        return (String) getConstantValue(cp);
+    }
+
+
+    /** @return String object
+     */
+    @Override
+    public Object getConstantValue( final ConstantPool cp ) {
+        final Constant c = cp.getConstant(stringIndex, Const.CONSTANT_Utf8);
+        return ((ConstantUtf8) c).getBytes();
+    }
+
+
     /**
      * @return Index in constant pool of the string (ConstantUtf8).
      */
@@ -111,20 +127,4 @@ public final class ConstantString extends Constant implements ConstantObject {
     public String toString() {
         return super.toString() + "(stringIndex = " + stringIndex + ")";
     }
-
-
-    /** @return String object
-     */
-    @Override
-    public Object getConstantValue( final ConstantPool cp ) {
-        final Constant c = cp.getConstant(stringIndex, Const.CONSTANT_Utf8);
-        return ((ConstantUtf8) c).getBytes();
-    }
-
-
-    /** @return dereferenced string
-     */
-    public String getBytes( final ConstantPool cp ) {
-        return (String) getConstantValue(cp);
-    }
 }
diff --git a/src/main/java/org/apache/bcel/classfile/ConstantValue.java b/src/main/java/org/apache/bcel/classfile/ConstantValue.java
index 0ca63b8e..cb46b524 100644
--- a/src/main/java/org/apache/bcel/classfile/ConstantValue.java
+++ b/src/main/java/org/apache/bcel/classfile/ConstantValue.java
@@ -84,6 +84,17 @@ public final class ConstantValue extends Attribute {
     }
 
 
+    /**
+     * @return deep copy of this attribute
+     */
+    @Override
+    public Attribute copy( final ConstantPool _constant_pool ) {
+        final ConstantValue c = (ConstantValue) clone();
+        c.setConstantPool(_constant_pool);
+        return c;
+    }
+
+
     /**
      * Dump constant value attribute to file stream on binary format.
      *
@@ -145,15 +156,4 @@ public final class ConstantValue extends Attribute {
         }
         return buf;
     }
-
-
-    /**
-     * @return deep copy of this attribute
-     */
-    @Override
-    public Attribute copy( final ConstantPool _constant_pool ) {
-        final ConstantValue c = (ConstantValue) clone();
-        c.setConstantPool(_constant_pool);
-        return c;
-    }
 }
diff --git a/src/main/java/org/apache/bcel/classfile/Deprecated.java b/src/main/java/org/apache/bcel/classfile/Deprecated.java
index e7c6184d..d136525f 100644
--- a/src/main/java/org/apache/bcel/classfile/Deprecated.java
+++ b/src/main/java/org/apache/bcel/classfile/Deprecated.java
@@ -89,6 +89,21 @@ public final class Deprecated extends Attribute {
     }
 
 
+    /**
+     * @return deep copy of this attribute
+     */
+    @Override
+    public Attribute copy( final ConstantPool _constant_pool ) {
+        final Deprecated c = (Deprecated) clone();
+        if (bytes != null) {
+            c.bytes = new byte[bytes.length];
+            System.arraycopy(bytes, 0, c.bytes, 0, bytes.length);
+        }
+        c.setConstantPool(_constant_pool);
+        return c;
+    }
+
+
     /**
      * Dump source file attribute to file stream in binary format.
      *
@@ -127,19 +142,4 @@ public final class Deprecated extends Attribute {
     public String toString() {
         return Const.getAttributeName(Const.ATTR_DEPRECATED) + ": true";
     }
-
-
-    /**
-     * @return deep copy of this attribute
-     */
-    @Override
-    public Attribute copy( final ConstantPool _constant_pool ) {
-        final Deprecated c = (Deprecated) clone();
-        if (bytes != null) {
-            c.bytes = new byte[bytes.length];
-            System.arraycopy(bytes, 0, c.bytes, 0, bytes.length);
-        }
-        c.setConstantPool(_constant_pool);
-        return c;
-    }
 }
diff --git a/src/main/java/org/apache/bcel/classfile/DescendingVisitor.java b/src/main/java/org/apache/bcel/classfile/DescendingVisitor.java
index 87e5d5d2..90280f9e 100644
--- a/src/main/java/org/apache/bcel/classfile/DescendingVisitor.java
+++ b/src/main/java/org/apache/bcel/classfile/DescendingVisitor.java
@@ -33,6 +33,26 @@ public class DescendingVisitor implements Visitor
 
     private final Stack<Object> stack = new Stack<>();
 
+    /**
+     * @param clazz
+     *            Class to traverse
+     * @param visitor
+     *            visitor object to apply to all components
+     */
+    public DescendingVisitor(final JavaClass clazz, final Visitor visitor)
+    {
+        this.clazz = clazz;
+        this.visitor = visitor;
+    }
+
+    /**
+     * @return current object
+     */
+    public Object current()
+    {
+        return stack.peek();
+    }
+
     /**
      * @return container of current entitity, i.e., predecessor during traversal
      */
@@ -56,26 +76,6 @@ public class DescendingVisitor implements Visitor
         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(final JavaClass clazz, final Visitor visitor)
-    {
-        this.clazz = clazz;
-        this.visitor = visitor;
-    }
-
     /**
      * Start traversal.
      */
@@ -84,27 +84,6 @@ public class DescendingVisitor implements Visitor
         clazz.accept(this);
     }
 
-    @Override
-    public void visitJavaClass(final JavaClass _clazz)
-    {
-        stack.push(_clazz);
-        _clazz.accept(visitor);
-        final Field[] fields = _clazz.getFields();
-        for (final Field field : fields) {
-            field.accept(this);
-        }
-        final Method[] methods = _clazz.getMethods();
-        for (final Method method : methods) {
-            method.accept(this);
-        }
-        final Attribute[] attributes = _clazz.getAttributes();
-        for (final Attribute attribute : attributes) {
-            attribute.accept(this);
-        }
-        _clazz.getConstantPool().accept(this);
-        stack.pop();
-    }
-
     /**
      * @since 6.0
      */
@@ -124,50 +103,37 @@ public class DescendingVisitor implements Visitor
      * @since 6.0
      */
     @Override
-    public void visitAnnotationEntry(final AnnotationEntry annotationEntry)
-    {
-        stack.push(annotationEntry);
-        annotationEntry.accept(visitor);
-        stack.pop();
-    }
-
-    @Override
-    public void visitField(final Field field)
-    {
-        stack.push(field);
-        field.accept(visitor);
-        final Attribute[] attributes = field.getAttributes();
-        for (final Attribute attribute : attributes) {
-            attribute.accept(this);
-        }
-        stack.pop();
-    }
-
-    @Override
-    public void visitConstantValue(final ConstantValue cv)
+    public void visitAnnotationDefault(final AnnotationDefault obj)
     {
-        stack.push(cv);
-        cv.accept(visitor);
+        stack.push(obj);
+        obj.accept(visitor);
         stack.pop();
     }
 
+    /**
+     * @since 6.0
+     */
     @Override
-    public void visitMethod(final Method method)
+    public void visitAnnotationEntry(final AnnotationEntry annotationEntry)
     {
-        stack.push(method);
-        method.accept(visitor);
-        final Attribute[] attributes = method.getAttributes();
-        for (final Attribute attribute : attributes) {
-            attribute.accept(this);
-        }
+        stack.push(annotationEntry);
+        annotationEntry.accept(visitor);
         stack.pop();
     }
 
+    /**
+     * @since 6.0
+     */
     @Override
-    public void visitExceptionTable(final ExceptionTable table)
+    public void visitBootstrapMethods(final BootstrapMethods bm)
     {
-        stack.push(table);
-        table.accept(visitor);
+        stack.push(bm);
+        bm.accept(visitor);
+        // BootstrapMethod[] bms = bm.getBootstrapMethods();
+        // for (int i = 0; i < bms.length; i++)
+        // {
+        //     bms[i].accept(this);
+        // }
         stack.pop();
     }
 
@@ -195,82 +161,6 @@ public class DescendingVisitor implements Visitor
         stack.pop();
     }
 
-    @Override
-    public void visitLineNumberTable(final LineNumberTable table)
-    {
-        stack.push(table);
-        table.accept(visitor);
-        final LineNumber[] numbers = table.getLineNumberTable();
-        for (final LineNumber number : numbers) {
-            number.accept(this);
-        }
-        stack.pop();
-    }
-
-    @Override
-    public void visitLineNumber(final LineNumber number)
-    {
-        stack.push(number);
-        number.accept(visitor);
-        stack.pop();
-    }
-
-    @Override
-    public void visitLocalVariableTable(final LocalVariableTable table)
-    {
-        stack.push(table);
-        table.accept(visitor);
-        final LocalVariable[] vars = table.getLocalVariableTable();
-        for (final LocalVariable var : vars) {
-            var.accept(this);
-        }
-        stack.pop();
-    }
-
-    @Override
-    public void visitStackMap(final StackMap table)
-    {
-        stack.push(table);
-        table.accept(visitor);
-        final StackMapEntry[] vars = table.getStackMap();
-        for (final StackMapEntry var : vars) {
-            var.accept(this);
-        }
-        stack.pop();
-    }
-
-    @Override
-    public void visitStackMapEntry(final StackMapEntry var)
-    {
-        stack.push(var);
-        var.accept(visitor);
-        stack.pop();
-    }
-
-    @Override
-    public void visitLocalVariable(final LocalVariable var)
-    {
-        stack.push(var);
-        var.accept(visitor);
-        stack.pop();
-    }
-
-    @Override
-    public void visitConstantPool(final ConstantPool cp)
-    {
-        stack.push(cp);
-        cp.accept(visitor);
-        final Constant[] constants = cp.getConstantPool();
-        for (int i = 1; i < constants.length; i++)
-        {
-            if (constants[i] != null)
-            {
-                constants[i].accept(this);
-            }
-        }
-        stack.pop();
-    }
-
     @Override
     public void visitConstantClass(final ConstantClass constant)
     {
@@ -287,6 +177,14 @@ public class DescendingVisitor implements Visitor
         stack.pop();
     }
 
+    /** @since 6.3 */
+    @Override
+    public void visitConstantDynamic(final ConstantDynamic obj) {
+        stack.push(obj);
+        obj.accept(visitor);
+        stack.pop();
+    }
+
     @Override
     public void visitConstantFieldref(final ConstantFieldref constant)
     {
@@ -340,6 +238,14 @@ public class DescendingVisitor implements Visitor
         stack.pop();
     }
 
+    /** @since 6.0 */
+    @Override
+    public void visitConstantMethodHandle(final ConstantMethodHandle obj) {
+        stack.push(obj);
+        obj.accept(visitor);
+        stack.pop();
+    }
+
     @Override
     public void visitConstantMethodref(final ConstantMethodref constant)
     {
@@ -348,6 +254,22 @@ public class DescendingVisitor implements Visitor
         stack.pop();
     }
 
+    /** @since 6.0 */
+    @Override
+    public void visitConstantMethodType(final ConstantMethodType obj) {
+        stack.push(obj);
+        obj.accept(visitor);
+        stack.pop();
+    }
+
+    /** @since 6.1 */
+    @Override
+    public void visitConstantModule(final ConstantModule obj) {
+        stack.push(obj);
+        obj.accept(visitor);
+        stack.pop();
+    }
+
     @Override
     public void visitConstantNameAndType(final ConstantNameAndType constant)
     {
@@ -356,6 +278,30 @@ public class DescendingVisitor implements Visitor
         stack.pop();
     }
 
+    /** @since 6.1 */
+    @Override
+    public void visitConstantPackage(final ConstantPackage obj) {
+        stack.push(obj);
+        obj.accept(visitor);
+        stack.pop();
+    }
+
+    @Override
+    public void visitConstantPool(final ConstantPool cp)
+    {
+        stack.push(cp);
+        cp.accept(visitor);
+        final Constant[] constants = cp.getConstantPool();
+        for (int i = 1; i < constants.length; i++)
+        {
+            if (constants[i] != null)
+            {
+                constants[i].accept(this);
+            }
+        }
+        stack.pop();
+    }
+
     @Override
     public void visitConstantString(final ConstantString constant)
     {
@@ -373,22 +319,18 @@ public class DescendingVisitor implements Visitor
     }
 
     @Override
-    public void visitInnerClasses(final InnerClasses ic)
+    public void visitConstantValue(final ConstantValue cv)
     {
-        stack.push(ic);
-        ic.accept(visitor);
-        final InnerClass[] ics = ic.getInnerClasses();
-        for (final InnerClass ic2 : ics) {
-            ic2.accept(this);
-        }
+        stack.push(cv);
+        cv.accept(visitor);
         stack.pop();
     }
 
     @Override
-    public void visitInnerClass(final InnerClass inner)
+    public void visitDeprecated(final Deprecated attribute)
     {
-        stack.push(inner);
-        inner.accept(visitor);
+        stack.push(attribute);
+        attribute.accept(visitor);
         stack.pop();
     }
 
@@ -396,77 +338,111 @@ public class DescendingVisitor implements Visitor
      * @since 6.0
      */
     @Override
-    public void visitBootstrapMethods(final BootstrapMethods bm)
+    public void visitEnclosingMethod(final EnclosingMethod obj)
     {
-        stack.push(bm);
-        bm.accept(visitor);
-        // BootstrapMethod[] bms = bm.getBootstrapMethods();
-        // for (int i = 0; i < bms.length; i++)
-        // {
-        //     bms[i].accept(this);
-        // }
+        stack.push(obj);
+        obj.accept(visitor);
         stack.pop();
     }
 
     @Override
-    public void visitDeprecated(final Deprecated attribute)
+    public void visitExceptionTable(final ExceptionTable table)
     {
-        stack.push(attribute);
-        attribute.accept(visitor);
+        stack.push(table);
+        table.accept(visitor);
         stack.pop();
     }
 
     @Override
-    public void visitSignature(final Signature attribute)
+    public void visitField(final Field field)
     {
-        stack.push(attribute);
-        attribute.accept(visitor);
+        stack.push(field);
+        field.accept(visitor);
+        final Attribute[] attributes = field.getAttributes();
+        for (final Attribute attribute : attributes) {
+            attribute.accept(this);
+        }
         stack.pop();
     }
 
     @Override
-    public void visitSourceFile(final SourceFile attribute)
+    public void visitInnerClass(final InnerClass inner)
     {
-        stack.push(attribute);
-        attribute.accept(visitor);
+        stack.push(inner);
+        inner.accept(visitor);
         stack.pop();
     }
 
     @Override
-    public void visitSynthetic(final Synthetic attribute)
+    public void visitInnerClasses(final InnerClasses ic)
     {
-        stack.push(attribute);
-        attribute.accept(visitor);
+        stack.push(ic);
+        ic.accept(visitor);
+        final InnerClass[] ics = ic.getInnerClasses();
+        for (final InnerClass ic2 : ics) {
+            ic2.accept(this);
+        }
         stack.pop();
     }
 
     @Override
-    public void visitUnknown(final Unknown attribute)
+    public void visitJavaClass(final JavaClass _clazz)
     {
-        stack.push(attribute);
-        attribute.accept(visitor);
+        stack.push(_clazz);
+        _clazz.accept(visitor);
+        final Field[] fields = _clazz.getFields();
+        for (final Field field : fields) {
+            field.accept(this);
+        }
+        final Method[] methods = _clazz.getMethods();
+        for (final Method method : methods) {
+            method.accept(this);
+        }
+        final Attribute[] attributes = _clazz.getAttributes();
+        for (final Attribute attribute : attributes) {
+            attribute.accept(this);
+        }
+        _clazz.getConstantPool().accept(this);
         stack.pop();
     }
 
-    /**
-     * @since 6.0
-     */
     @Override
-    public void visitAnnotationDefault(final AnnotationDefault obj)
+    public void visitLineNumber(final LineNumber number)
     {
-        stack.push(obj);
-        obj.accept(visitor);
+        stack.push(number);
+        number.accept(visitor);
         stack.pop();
     }
 
-    /**
-     * @since 6.0
-     */
     @Override
-    public void visitEnclosingMethod(final EnclosingMethod obj)
+    public void visitLineNumberTable(final LineNumberTable table)
     {
-        stack.push(obj);
-        obj.accept(visitor);
+        stack.push(table);
+        table.accept(visitor);
+        final LineNumber[] numbers = table.getLineNumberTable();
+        for (final LineNumber number : numbers) {
+            number.accept(this);
+        }
+        stack.pop();
+    }
+
+    @Override
+    public void visitLocalVariable(final LocalVariable var)
+    {
+        stack.push(var);
+        var.accept(visitor);
+        stack.pop();
+    }
+
+    @Override
+    public void visitLocalVariableTable(final LocalVariableTable table)
+    {
+        stack.push(table);
+        table.accept(visitor);
+        final LocalVariable[] vars = table.getLocalVariableTable();
+        for (final LocalVariable var : vars) {
+            var.accept(this);
+        }
         stack.pop();
     }
 
@@ -481,11 +457,23 @@ public class DescendingVisitor implements Visitor
         stack.pop();
     }
 
+    @Override
+    public void visitMethod(final Method method)
+    {
+        stack.push(method);
+        method.accept(visitor);
+        final Attribute[] attributes = method.getAttributes();
+        for (final Attribute attribute : attributes) {
+            attribute.accept(this);
+        }
+        stack.pop();
+    }
+
     /**
-     * @since 6.0
+     * @since 6.4.0
      */
     @Override
-    public void visitParameterAnnotation(final ParameterAnnotations obj)
+    public void visitMethodParameter(final MethodParameter obj)
     {
         stack.push(obj);
         obj.accept(visitor);
@@ -507,60 +495,73 @@ public class DescendingVisitor implements Visitor
         stack.pop();
     }
 
-    /**
-     * @since 6.4.0
-     */
+    /** @since 6.4.0 */
     @Override
-    public void visitMethodParameter(final MethodParameter obj)
-    {
+    public void visitModule(final Module obj) {
         stack.push(obj);
         obj.accept(visitor);
+        final ModuleRequires[] rtable = obj.getRequiresTable();
+        for (final ModuleRequires element : rtable) {
+            element.accept(this);
+        }
+        final ModuleExports[] etable = obj.getExportsTable();
+        for (final ModuleExports element : etable) {
+            element.accept(this);
+        }
+        final ModuleOpens[] otable = obj.getOpensTable();
+        for (final ModuleOpens element : otable) {
+            element.accept(this);
+        }
+        final ModuleProvides[] ptable = obj.getProvidesTable();
+        for (final ModuleProvides element : ptable) {
+            element.accept(this);
+        }
         stack.pop();
     }
 
-    /** @since 6.0 */
+    /** @since 6.4.0 */
     @Override
-    public void visitConstantMethodType(final ConstantMethodType obj) {
+    public void visitModuleExports(final ModuleExports obj) {
         stack.push(obj);
         obj.accept(visitor);
         stack.pop();
     }
 
-    /** @since 6.0 */
+    /** @since 6.4.0 */
     @Override
-    public void visitConstantMethodHandle(final ConstantMethodHandle obj) {
+    public void visitModuleMainClass(final ModuleMainClass obj) {
         stack.push(obj);
         obj.accept(visitor);
         stack.pop();
     }
 
-    /** @since 6.0 */
+    /** @since 6.4.0 */
     @Override
-    public void visitParameterAnnotationEntry(final ParameterAnnotationEntry obj) {
+    public void visitModuleOpens(final ModuleOpens obj) {
         stack.push(obj);
         obj.accept(visitor);
         stack.pop();
     }
 
-    /** @since 6.1 */
+    /** @since 6.4.0 */
     @Override
-    public void visitConstantPackage(final ConstantPackage obj) {
+    public void visitModulePackages(final ModulePackages obj) {
         stack.push(obj);
         obj.accept(visitor);
         stack.pop();
     }
 
-    /** @since 6.1 */
+    /** @since 6.4.0 */
     @Override
-    public void visitConstantModule(final ConstantModule obj) {
+    public void visitModuleProvides(final ModuleProvides obj) {
         stack.push(obj);
         obj.accept(visitor);
         stack.pop();
     }
 
-    /** @since 6.3 */
+    /** @since 6.4.0 */
     @Override
-    public void visitConstantDynamic(final ConstantDynamic obj) {
+    public void visitModuleRequires(final ModuleRequires obj) {
         stack.push(obj);
         obj.accept(visitor);
         stack.pop();
@@ -568,89 +569,88 @@ public class DescendingVisitor implements Visitor
 
     /** @since 6.4.0 */
     @Override
-    public void visitModule(final Module obj) {
+    public void visitNestHost(final NestHost obj) {
         stack.push(obj);
         obj.accept(visitor);
-        final ModuleRequires[] rtable = obj.getRequiresTable();
-        for (final ModuleRequires element : rtable) {
-            element.accept(this);
-        }
-        final ModuleExports[] etable = obj.getExportsTable();
-        for (final ModuleExports element : etable) {
-            element.accept(this);
-        }
-        final ModuleOpens[] otable = obj.getOpensTable();
-        for (final ModuleOpens element : otable) {
-            element.accept(this);
-        }
-        final ModuleProvides[] ptable = obj.getProvidesTable();
-        for (final ModuleProvides element : ptable) {
-            element.accept(this);
-        }
         stack.pop();
     }
 
     /** @since 6.4.0 */
     @Override
-    public void visitModuleRequires(final ModuleRequires obj) {
+    public void visitNestMembers(final NestMembers obj) {
         stack.push(obj);
         obj.accept(visitor);
         stack.pop();
     }
 
-    /** @since 6.4.0 */
+    /**
+     * @since 6.0
+     */
     @Override
-    public void visitModuleExports(final ModuleExports obj) {
+    public void visitParameterAnnotation(final ParameterAnnotations obj)
+    {
         stack.push(obj);
         obj.accept(visitor);
         stack.pop();
     }
 
-    /** @since 6.4.0 */
+    /** @since 6.0 */
     @Override
-    public void visitModuleOpens(final ModuleOpens obj) {
+    public void visitParameterAnnotationEntry(final ParameterAnnotationEntry obj) {
         stack.push(obj);
         obj.accept(visitor);
         stack.pop();
     }
 
-    /** @since 6.4.0 */
     @Override
-    public void visitModuleProvides(final ModuleProvides obj) {
-        stack.push(obj);
-        obj.accept(visitor);
+    public void visitSignature(final Signature attribute)
+    {
+        stack.push(attribute);
+        attribute.accept(visitor);
         stack.pop();
     }
 
-    /** @since 6.4.0 */
     @Override
-    public void visitModulePackages(final ModulePackages obj) {
-        stack.push(obj);
-        obj.accept(visitor);
+    public void visitSourceFile(final SourceFile attribute)
+    {
+        stack.push(attribute);
+        attribute.accept(visitor);
         stack.pop();
     }
 
-    /** @since 6.4.0 */
     @Override
-    public void visitModuleMainClass(final ModuleMainClass obj) {
-        stack.push(obj);
-        obj.accept(visitor);
+    public void visitStackMap(final StackMap table)
+    {
+        stack.push(table);
+        table.accept(visitor);
+        final StackMapEntry[] vars = table.getStackMap();
+        for (final StackMapEntry var : vars) {
+            var.accept(this);
+        }
         stack.pop();
     }
 
-    /** @since 6.4.0 */
     @Override
-    public void visitNestHost(final NestHost obj) {
-        stack.push(obj);
-        obj.accept(visitor);
+    public void visitStackMapEntry(final StackMapEntry var)
+    {
+        stack.push(var);
+        var.accept(visitor);
         stack.pop();
     }
 
-    /** @since 6.4.0 */
     @Override
-    public void visitNestMembers(final NestMembers obj) {
-        stack.push(obj);
-        obj.accept(visitor);
+    public void visitSynthetic(final Synthetic attribute)
+    {
+        stack.push(attribute);
+        attribute.accept(visitor);
+        stack.pop();
+    }
+
+    @Override
+    public void visitUnknown(final Unknown attribute)
+    {
+        stack.push(attribute);
+        attribute.accept(visitor);
         stack.pop();
     }
 }
diff --git a/src/main/java/org/apache/bcel/classfile/ElementValue.java b/src/main/java/org/apache/bcel/classfile/ElementValue.java
index b96a97ff..381f0f60 100644
--- a/src/main/java/org/apache/bcel/classfile/ElementValue.java
+++ b/src/main/java/org/apache/bcel/classfile/ElementValue.java
@@ -26,53 +26,26 @@ import java.io.IOException;
  */
 public abstract class ElementValue
 {
-    /**
-     * @deprecated (since 6.0) will be made private and final; do not access directly, use getter
-     */
-    @java.lang.Deprecated
-    protected int type; // TODO should be final
-
-    /**
-     * @deprecated (since 6.0) will be made private and final; do not access directly, use getter
-     */
-    @java.lang.Deprecated
-    protected ConstantPool cpool; // TODO should be final
-
-    @Override
-    public String toString()
-    {
-        return stringifyValue();
-    }
-
-    protected ElementValue(final int type, final 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 byte STRING            = 's';
+
     public static final byte ENUM_CONSTANT     = 'e';
+
     public static final byte CLASS             = 'c';
+
     public static final byte ANNOTATION        = '@';
+
     public static final byte ARRAY             = '[';
+
     public static final byte PRIMITIVE_INT     = 'I';
+
     public static final byte PRIMITIVE_BYTE    = 'B';
+
     public static final byte PRIMITIVE_CHAR    = 'C';
     public static final byte PRIMITIVE_DOUBLE  = 'D';
     public static final byte PRIMITIVE_FLOAT   = 'F';
     public static final byte PRIMITIVE_LONG    = 'J';
     public static final byte PRIMITIVE_SHORT   = 'S';
     public static final byte PRIMITIVE_BOOLEAN = 'Z';
-
     public static ElementValue readElementValue(final DataInput input, final ConstantPool cpool) throws IOException
     {
         final byte type = input.readByte();
@@ -112,19 +85,46 @@ public abstract class ElementValue
                 throw new IllegalArgumentException("Unexpected element value kind in annotation: " + type);
         }
     }
-
+    /**
+     * @deprecated (since 6.0) will be made private and final; do not access directly, use getter
+     */
+    @java.lang.Deprecated
+    protected int type; // TODO should be final
+    /**
+     * @deprecated (since 6.0) will be made private and final; do not access directly, use getter
+     */
+    @java.lang.Deprecated
+    protected ConstantPool cpool; // TODO should be final
+    protected ElementValue(final int type, final ConstantPool cpool)
+    {
+        this.type = type;
+        this.cpool = cpool;
+    }
+    public abstract void dump(DataOutputStream dos) throws IOException;
     /** @since 6.0 */
     final ConstantPool getConstantPool() {
         return cpool;
     }
+    public int getElementValueType()
+    {
+        return type;
+    }
 
     /** @since 6.0 */
     final int getType() {
         return type;
     }
 
+    public abstract String stringifyValue();
+
     public String toShortString()
     {
         return stringifyValue();
     }
+
+    @Override
+    public String toString()
+    {
+        return stringifyValue();
+    }
 }
diff --git a/src/main/java/org/apache/bcel/classfile/ElementValuePair.java b/src/main/java/org/apache/bcel/classfile/ElementValuePair.java
index 1971a225..a866261e 100644
--- a/src/main/java/org/apache/bcel/classfile/ElementValuePair.java
+++ b/src/main/java/org/apache/bcel/classfile/ElementValuePair.java
@@ -46,6 +46,16 @@ public class ElementValuePair
         this.constantPool = constantPool;
     }
 
+    protected void dump(final DataOutputStream dos) throws IOException {
+        dos.writeShort(elementNameIndex); // u2 name of the element
+        elementValue.dump(dos);
+    }
+
+    public int getNameIndex()
+    {
+        return elementNameIndex;
+    }
+
     public String getNameString()
     {
         final ConstantUtf8 c = (ConstantUtf8) constantPool.getConstant(
@@ -58,11 +68,6 @@ public class ElementValuePair
         return elementValue;
     }
 
-    public int getNameIndex()
-    {
-        return elementNameIndex;
-    }
-
     public String toShortString()
     {
         final StringBuilder result = new StringBuilder();
@@ -70,9 +75,4 @@ public class ElementValuePair
                 getValue().toShortString());
         return result.toString();
     }
-
-    protected void dump(final DataOutputStream dos) throws IOException {
-        dos.writeShort(elementNameIndex); // u2 name of the element
-        elementValue.dump(dos);
-    }
 }
diff --git a/src/main/java/org/apache/bcel/classfile/EmptyVisitor.java b/src/main/java/org/apache/bcel/classfile/EmptyVisitor.java
index 3955ff7b..706f42f8 100644
--- a/src/main/java/org/apache/bcel/classfile/EmptyVisitor.java
+++ b/src/main/java/org/apache/bcel/classfile/EmptyVisitor.java
@@ -41,7 +41,7 @@ public class EmptyVisitor implements Visitor
      * @since 6.0
      */
     @Override
-    public void visitParameterAnnotation(final ParameterAnnotations obj)
+    public void visitAnnotationDefault(final AnnotationDefault obj)
     {
     }
 
@@ -57,7 +57,7 @@ public class EmptyVisitor implements Visitor
      * @since 6.0
      */
     @Override
-    public void visitAnnotationDefault(final AnnotationDefault obj)
+    public void visitBootstrapMethods(final BootstrapMethods obj)
     {
     }
 
@@ -81,6 +81,13 @@ public class EmptyVisitor implements Visitor
     {
     }
 
+    /**
+     * @since 6.3
+     */
+    @Override
+    public void visitConstantDynamic(final ConstantDynamic obj) {
+    }
+
     @Override
     public void visitConstantFieldref(final ConstantFieldref obj)
     {
@@ -111,58 +118,67 @@ public class EmptyVisitor implements Visitor
     {
     }
 
+    /**
+     * @since 6.0
+     */
     @Override
-    public void visitConstantMethodref(final ConstantMethodref obj)
-    {
+    public void visitConstantMethodHandle(final ConstantMethodHandle constantMethodHandle) {
     }
 
     @Override
-    public void visitConstantNameAndType(final ConstantNameAndType obj)
+    public void visitConstantMethodref(final ConstantMethodref obj)
     {
     }
 
+    /**
+     * @since 6.0
+     */
     @Override
-    public void visitConstantPool(final ConstantPool obj)
+    public void visitConstantMethodType(final ConstantMethodType obj)
     {
     }
 
+    /**
+     * @since 6.1
+     */
     @Override
-    public void visitConstantString(final ConstantString obj)
-    {
+    public void visitConstantModule(final ConstantModule constantModule) {
     }
 
     @Override
-    public void visitConstantUtf8(final ConstantUtf8 obj)
+    public void visitConstantNameAndType(final ConstantNameAndType obj)
     {
     }
 
+    /**
+     * @since 6.1
+     */
     @Override
-    public void visitConstantValue(final ConstantValue obj)
-    {
+    public void visitConstantPackage(final ConstantPackage constantPackage) {
     }
 
     @Override
-    public void visitDeprecated(final Deprecated obj)
+    public void visitConstantPool(final ConstantPool obj)
     {
     }
 
     @Override
-    public void visitExceptionTable(final ExceptionTable obj)
+    public void visitConstantString(final ConstantString obj)
     {
     }
 
     @Override
-    public void visitField(final Field obj)
+    public void visitConstantUtf8(final ConstantUtf8 obj)
     {
     }
 
     @Override
-    public void visitInnerClass(final InnerClass obj)
+    public void visitConstantValue(final ConstantValue obj)
     {
     }
 
     @Override
-    public void visitInnerClasses(final InnerClasses obj)
+    public void visitDeprecated(final Deprecated obj)
     {
     }
 
@@ -170,67 +186,65 @@ public class EmptyVisitor implements Visitor
      * @since 6.0
      */
     @Override
-    public void visitBootstrapMethods(final BootstrapMethods obj)
-    {
-    }
-
-    @Override
-    public void visitJavaClass(final JavaClass obj)
+    public void visitEnclosingMethod(final EnclosingMethod obj)
     {
     }
 
     @Override
-    public void visitLineNumber(final LineNumber obj)
+    public void visitExceptionTable(final ExceptionTable obj)
     {
     }
 
     @Override
-    public void visitLineNumberTable(final LineNumberTable obj)
+    public void visitField(final Field obj)
     {
     }
 
     @Override
-    public void visitLocalVariable(final LocalVariable obj)
+    public void visitInnerClass(final InnerClass obj)
     {
     }
 
     @Override
-    public void visitLocalVariableTable(final LocalVariableTable obj)
+    public void visitInnerClasses(final InnerClasses obj)
     {
     }
 
     @Override
-    public void visitMethod(final Method obj)
+    public void visitJavaClass(final JavaClass obj)
     {
     }
 
     @Override
-    public void visitSignature(final Signature obj)
+    public void visitLineNumber(final LineNumber obj)
     {
     }
 
     @Override
-    public void visitSourceFile(final SourceFile obj)
+    public void visitLineNumberTable(final LineNumberTable obj)
     {
     }
 
     @Override
-    public void visitSynthetic(final Synthetic obj)
+    public void visitLocalVariable(final LocalVariable obj)
     {
     }
 
     @Override
-    public void visitUnknown(final Unknown obj)
+    public void visitLocalVariableTable(final LocalVariableTable obj)
     {
     }
 
+    /**
+     * @since 6.0
+     */
     @Override
-    public void visitStackMap(final StackMap obj)
+    public void visitLocalVariableTypeTable(final LocalVariableTypeTable obj)
     {
     }
 
     @Override
-    public void visitStackMapEntry(final StackMapEntry obj)
+    public void visitMethod(final Method obj)
     {
     }
 
@@ -251,10 +265,10 @@ public class EmptyVisitor implements Visitor
      */
 
     /**
-     * @since 6.0
+     * @since 6.4.0
      */
     @Override
-    public void visitEnclosingMethod(final EnclosingMethod obj)
+    public void visitMethodParameter(final MethodParameter obj)
     {
     }
 
@@ -262,111 +276,97 @@ public class EmptyVisitor implements Visitor
      * @since 6.0
      */
     @Override
-    public void visitLocalVariableTypeTable(final LocalVariableTypeTable obj)
+    public void visitMethodParameters(final MethodParameters obj)
     {
     }
 
-    /**
-     * @since 6.0
-     */
+    /** @since 6.4.0 */
     @Override
-    public void visitMethodParameters(final MethodParameters obj)
-    {
+    public void visitModule(final Module obj) {
     }
 
-    /**
-     * @since 6.4.0
-     */
+    /** @since 6.4.0 */
     @Override
-    public void visitMethodParameter(final MethodParameter obj)
-    {
+    public void visitModuleExports(final ModuleExports obj) {
     }
 
-    /**
-     * @since 6.0
-     */
+    /** @since 6.4.0 */
     @Override
-    public void visitConstantMethodType(final ConstantMethodType obj)
-    {
+    public void visitModuleMainClass(final ModuleMainClass obj) {
     }
 
-    /**
-     * @since 6.0
-     */
+    /** @since 6.4.0 */
     @Override
-    public void visitConstantMethodHandle(final ConstantMethodHandle constantMethodHandle) {
+    public void visitModuleOpens(final ModuleOpens obj) {
     }
 
-    /**
-     * @since 6.0
-     */
+    /** @since 6.4.0 */
     @Override
-    public void visitParameterAnnotationEntry(final ParameterAnnotationEntry parameterAnnotationEntry) {
+    public void visitModulePackages(final ModulePackages obj) {
     }
 
-    /**
-     * @since 6.1
-     */
+    /** @since 6.4.0 */
     @Override
-    public void visitConstantPackage(final ConstantPackage constantPackage) {
+    public void visitModuleProvides(final ModuleProvides obj) {
     }
 
-    /**
-     * @since 6.1
-     */
+    /** @since 6.4.0 */
     @Override
-    public void visitConstantModule(final ConstantModule constantModule) {
+    public void visitModuleRequires(final ModuleRequires obj) {
     }
 
-    /**
-     * @since 6.3
-     */
+    /** @since 6.4.0 */
     @Override
-    public void visitConstantDynamic(final ConstantDynamic obj) {
+    public void visitNestHost(final NestHost obj) {
     }
 
     /** @since 6.4.0 */
     @Override
-    public void visitModule(final Module obj) {
+    public void visitNestMembers(final NestMembers obj) {
     }
 
-    /** @since 6.4.0 */
+    /**
+     * @since 6.0
+     */
     @Override
-    public void visitModuleRequires(final ModuleRequires obj) {
+    public void visitParameterAnnotation(final ParameterAnnotations obj)
+    {
     }
 
-    /** @since 6.4.0 */
+    /**
+     * @since 6.0
+     */
     @Override
-    public void visitModuleExports(final ModuleExports obj) {
+    public void visitParameterAnnotationEntry(final ParameterAnnotationEntry parameterAnnotationEntry) {
     }
 
-    /** @since 6.4.0 */
     @Override
-    public void visitModuleOpens(final ModuleOpens obj) {
+    public void visitSignature(final Signature obj)
+    {
     }
 
-    /** @since 6.4.0 */
     @Override
-    public void visitModuleProvides(final ModuleProvides obj) {
+    public void visitSourceFile(final SourceFile obj)
+    {
     }
 
-    /** @since 6.4.0 */
     @Override
-    public void visitModulePackages(final ModulePackages obj) {
+    public void visitStackMap(final StackMap obj)
+    {
     }
 
-    /** @since 6.4.0 */
     @Override
-    public void visitModuleMainClass(final ModuleMainClass obj) {
+    public void visitStackMapEntry(final StackMapEntry obj)
+    {
     }
 
-    /** @since 6.4.0 */
     @Override
-    public void visitNestHost(final NestHost obj) {
+    public void visitSynthetic(final Synthetic obj)
+    {
     }
 
-    /** @since 6.4.0 */
     @Override
-    public void visitNestMembers(final NestMembers obj) {
+    public void visitUnknown(final Unknown obj)
+    {
     }
 }
diff --git a/src/main/java/org/apache/bcel/classfile/EnclosingMethod.java b/src/main/java/org/apache/bcel/classfile/EnclosingMethod.java
index d1885262..9c9a25b9 100644
--- a/src/main/java/org/apache/bcel/classfile/EnclosingMethod.java
+++ b/src/main/java/org/apache/bcel/classfile/EnclosingMethod.java
@@ -65,11 +65,29 @@ public class EnclosingMethod extends Attribute {
         return (Attribute) clone();
     }
 
+    @Override
+    public final void dump(final DataOutputStream file) throws IOException {
+        super.dump(file);
+        file.writeShort(classIndex);
+        file.writeShort(methodIndex);
+    }
+
+    public final ConstantClass getEnclosingClass() {
+        return (ConstantClass)super.getConstantPool().getConstant(classIndex,Const.CONSTANT_Class);
+    }
+
     // Accessors
     public final int getEnclosingClassIndex() {
         return classIndex;
     }
 
+    public final ConstantNameAndType getEnclosingMethod() {
+        if (methodIndex == 0) {
+            return null;
+        }
+        return (ConstantNameAndType)super.getConstantPool().getConstant(methodIndex,Const.CONSTANT_NameAndType);
+    }
+
     public final int getEnclosingMethodIndex() {
         return methodIndex;
     }
@@ -81,22 +99,4 @@ public class EnclosingMethod extends Attribute {
     public final void setEnclosingMethodIndex(final int idx) {
         methodIndex = idx;
     }
-
-    public final ConstantClass getEnclosingClass() {
-        return (ConstantClass)super.getConstantPool().getConstant(classIndex,Const.CONSTANT_Class);
-    }
-
-    public final ConstantNameAndType getEnclosingMethod() {
-        if (methodIndex == 0) {
-            return null;
-        }
-        return (ConstantNameAndType)super.getConstantPool().getConstant(methodIndex,Const.CONSTANT_NameAndType);
-    }
-
-    @Override
-    public final void dump(final DataOutputStream file) throws IOException {
-        super.dump(file);
-        file.writeShort(classIndex);
-        file.writeShort(methodIndex);
-    }
 }
diff --git a/src/main/java/org/apache/bcel/classfile/EnumElementValue.java b/src/main/java/org/apache/bcel/classfile/EnumElementValue.java
index 523d64eb..f615c11c 100644
--- a/src/main/java/org/apache/bcel/classfile/EnumElementValue.java
+++ b/src/main/java/org/apache/bcel/classfile/EnumElementValue.java
@@ -52,14 +52,6 @@ public class EnumElementValue extends ElementValue
         dos.writeShort(valueIdx); // u2
     }
 
-    @Override
-    public String stringifyValue()
-    {
-        final ConstantUtf8 cu8 = (ConstantUtf8) super.getConstantPool().getConstant(valueIdx,
-                Const.CONSTANT_Utf8);
-        return cu8.getBytes();
-    }
-
     public String getEnumTypeString()
     {
         final ConstantUtf8 cu8 = (ConstantUtf8) super.getConstantPool().getConstant(typeIdx,
@@ -74,13 +66,21 @@ public class EnumElementValue extends ElementValue
         return cu8.getBytes();
     }
 
+    public int getTypeIndex()
+    {
+        return typeIdx;
+    }
+
     public int getValueIndex()
     {
         return valueIdx;
     }
 
-    public int getTypeIndex()
+    @Override
+    public String stringifyValue()
     {
-        return typeIdx;
+        final ConstantUtf8 cu8 = (ConstantUtf8) super.getConstantPool().getConstant(valueIdx,
+                Const.CONSTANT_Utf8);
+        return cu8.getBytes();
     }
 }
diff --git a/src/main/java/org/apache/bcel/classfile/ExceptionTable.java b/src/main/java/org/apache/bcel/classfile/ExceptionTable.java
index 6333f2b0..cd33ee35 100644
--- a/src/main/java/org/apache/bcel/classfile/ExceptionTable.java
+++ b/src/main/java/org/apache/bcel/classfile/ExceptionTable.java
@@ -48,19 +48,6 @@ public final class ExceptionTable extends Attribute {
     }
 
 
-    /**
-     * @param name_index Index in constant pool
-     * @param length Content length in bytes
-     * @param exceptionIndexTable Table of indices in constant pool
-     * @param constant_pool Array of constants
-     */
-    public ExceptionTable(final int name_index, final int length, final int[] exceptionIndexTable,
-            final ConstantPool constant_pool) {
-        super(Const.ATTR_EXCEPTIONS, name_index, length, constant_pool);
-        this.exceptionIndexTable = exceptionIndexTable != null ? exceptionIndexTable : ArrayUtils.EMPTY_INT_ARRAY;
-    }
-
-
     /**
      * Construct object from input stream.
      * @param nameIndex Index in constant pool
@@ -79,6 +66,19 @@ public final class ExceptionTable extends Attribute {
     }
 
 
+    /**
+     * @param name_index Index in constant pool
+     * @param length Content length in bytes
+     * @param exceptionIndexTable Table of indices in constant pool
+     * @param constant_pool Array of constants
+     */
+    public ExceptionTable(final int name_index, final int length, final int[] exceptionIndexTable,
+            final ConstantPool constant_pool) {
+        super(Const.ATTR_EXCEPTIONS, name_index, length, constant_pool);
+        this.exceptionIndexTable = exceptionIndexTable != null ? exceptionIndexTable : ArrayUtils.EMPTY_INT_ARRAY;
+    }
+
+
     /**
      * 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,
@@ -92,6 +92,22 @@ public final class ExceptionTable extends Attribute {
     }
 
 
+    /**
+     * @return deep copy of this attribute
+     */
+    @Override
+    public Attribute copy( final ConstantPool _constant_pool ) {
+        final ExceptionTable c = (ExceptionTable) clone();
+        if (exceptionIndexTable != null) {
+            c.exceptionIndexTable = new int[exceptionIndexTable.length];
+            System.arraycopy(exceptionIndexTable, 0, c.exceptionIndexTable, 0,
+                    exceptionIndexTable.length);
+        }
+        c.setConstantPool(_constant_pool);
+        return c;
+    }
+
+
     /**
      * Dump exceptions attribute to file stream in binary format.
      *
@@ -116,14 +132,6 @@ public final class ExceptionTable extends Attribute {
     }
 
 
-    /**
-     * @return Length of exception table.
-     */
-    public int getNumberOfExceptions() {
-        return exceptionIndexTable == null ? 0 : exceptionIndexTable.length;
-    }
-
-
     /**
      * @return class names of thrown exceptions
      */
@@ -137,6 +145,14 @@ public final class ExceptionTable extends Attribute {
     }
 
 
+    /**
+     * @return Length of exception table.
+     */
+    public int getNumberOfExceptions() {
+        return exceptionIndexTable == null ? 0 : exceptionIndexTable.length;
+    }
+
+
     /**
      * @param exceptionIndexTable the list of exception indexes
      * Also redefines number_of_exceptions according to table length.
@@ -163,20 +179,4 @@ public final class ExceptionTable extends Attribute {
         }
         return buf.toString();
     }
-
-
-    /**
-     * @return deep copy of this attribute
-     */
-    @Override
-    public Attribute copy( final ConstantPool _constant_pool ) {
-        final ExceptionTable c = (ExceptionTable) clone();
-        if (exceptionIndexTable != null) {
-            c.exceptionIndexTable = new int[exceptionIndexTable.length];
-            System.arraycopy(exceptionIndexTable, 0, c.exceptionIndexTable, 0,
-                    exceptionIndexTable.length);
-        }
-        c.setConstantPool(_constant_pool);
-        return c;
-    }
 }
diff --git a/src/main/java/org/apache/bcel/classfile/Field.java b/src/main/java/org/apache/bcel/classfile/Field.java
index b4a58236..a6463bdc 100644
--- a/src/main/java/org/apache/bcel/classfile/Field.java
+++ b/src/main/java/org/apache/bcel/classfile/Field.java
@@ -64,11 +64,18 @@ public final class Field extends FieldOrMethod {
 
 
     /**
-     * Initialize from another object. Note that both objects use the same
-     * references (shallow copy). Use clone() for a physical copy.
+     * @return Comparison strategy object
      */
-    public Field(final Field c) {
-        super(c);
+    public static BCELComparator getComparator() {
+        return bcelComparator;
+    }
+
+
+    /**
+     * @param comparator Comparison strategy object
+     */
+    public static void setComparator( final BCELComparator comparator ) {
+        bcelComparator = comparator;
     }
 
 
@@ -82,6 +89,15 @@ public final class Field extends FieldOrMethod {
     }
 
 
+    /**
+     * Initialize from another object. Note that both objects use the same
+     * references (shallow copy). Use clone() for a physical copy.
+     */
+    public Field(final Field c) {
+        super(c);
+    }
+
+
     /**
      * @param access_flags Access rights of field
      * @param name_index Points to field name in constant pool
@@ -108,6 +124,27 @@ public final class Field extends FieldOrMethod {
     }
 
 
+    /**
+     * @return deep copy of this field
+     */
+    public Field copy( final ConstantPool _constant_pool ) {
+        return (Field) copy_(_constant_pool);
+    }
+
+
+    /**
+     * Return value as defined by given BCELComparator strategy.
+     * By default two Field objects are said to be equal when
+     * their names and signatures are equal.
+     *
+     * @see java.lang.Object#equals(java.lang.Object)
+     */
+    @Override
+    public boolean equals( final Object obj ) {
+        return bcelComparator.equals(this, obj);
+    }
+
+
     /**
      * @return constant value associated with this field (may be null)
      */
@@ -121,6 +158,26 @@ public final class Field extends FieldOrMethod {
     }
 
 
+    /**
+     * @return type of field
+     */
+    public Type getType() {
+        return Type.getReturnType(getSignature());
+    }
+
+
+    /**
+     * Return value as defined by given BCELComparator strategy.
+     * By default return the hashcode of the field's name XOR signature.
+     *
+     * @see java.lang.Object#hashCode()
+     */
+    @Override
+    public int hashCode() {
+        return bcelComparator.hashCode(this);
+    }
+
+
     /**
      * Return string representation close to declaration format,
      * `public static final short MAX = 100', e.g..
@@ -151,61 +208,4 @@ public final class Field extends FieldOrMethod {
         }
         return buf.toString();
     }
-
-
-    /**
-     * @return deep copy of this field
-     */
-    public Field copy( final ConstantPool _constant_pool ) {
-        return (Field) copy_(_constant_pool);
-    }
-
-
-    /**
-     * @return type of field
-     */
-    public Type getType() {
-        return Type.getReturnType(getSignature());
-    }
-
-
-    /**
-     * @return Comparison strategy object
-     */
-    public static BCELComparator getComparator() {
-        return bcelComparator;
-    }
-
-
-    /**
-     * @param comparator Comparison strategy object
-     */
-    public static void setComparator( final BCELComparator comparator ) {
-        bcelComparator = comparator;
-    }
-
-
-    /**
-     * Return value as defined by given BCELComparator strategy.
-     * By default two Field objects are said to be equal when
-     * their names and signatures are equal.
-     *
-     * @see java.lang.Object#equals(java.lang.Object)
-     */
-    @Override
-    public boolean equals( final Object obj ) {
-        return bcelComparator.equals(this, obj);
-    }
-
-
-    /**
-     * Return value as defined by given BCELComparator strategy.
-     * By default return the hashcode of the field's name XOR signature.
-     *
-     * @see java.lang.Object#hashCode()
-     */
-    @Override
-    public int hashCode() {
-        return bcelComparator.hashCode(this);
-    }
 }
diff --git a/src/main/java/org/apache/bcel/classfile/FieldOrMethod.java b/src/main/java/org/apache/bcel/classfile/FieldOrMethod.java
index 53c90165..f461b967 100644
--- a/src/main/java/org/apache/bcel/classfile/FieldOrMethod.java
+++ b/src/main/java/org/apache/bcel/classfile/FieldOrMethod.java
@@ -71,12 +71,20 @@ public abstract class FieldOrMethod extends AccessFlags implements Cloneable, No
 
 
     /**
-     * Initialize from another object. Note that both objects use the same
-     * references (shallow copy). Use clone() for a physical copy.
+     * Construct object from file stream.
+     * @param file Input stream
+     * @throws IOException
+     * @throws ClassFormatException
      */
-    protected FieldOrMethod(final FieldOrMethod c) {
-        this(c.getAccessFlags(), c.getNameIndex(), c.getSignatureIndex(), c.getAttributes(), c
-                .getConstantPool());
+    protected FieldOrMethod(final DataInput file, final ConstantPool constant_pool) throws IOException, ClassFormatException {
+        this(file.readUnsignedShort(), file.readUnsignedShort(), file.readUnsignedShort(), null,
+                constant_pool);
+        final int attributes_count = file.readUnsignedShort();
+        attributes = new Attribute[attributes_count];
+        for (int i = 0; i < attributes_count; i++) {
+            attributes[i] = Attribute.readAttribute(file, constant_pool);
+        }
+        this.attributes_count = attributes_count; // init deprecated field
     }
 
 
@@ -94,20 +102,12 @@ public abstract class FieldOrMethod extends AccessFlags implements Cloneable, No
     }
 
     /**
-     * Construct object from file stream.
-     * @param file Input stream
-     * @throws IOException
-     * @throws ClassFormatException
+     * Initialize from another object. Note that both objects use the same
+     * references (shallow copy). Use clone() for a physical copy.
      */
-    protected FieldOrMethod(final DataInput file, final ConstantPool constant_pool) throws IOException, ClassFormatException {
-        this(file.readUnsignedShort(), file.readUnsignedShort(), file.readUnsignedShort(), null,
-                constant_pool);
-        final int attributes_count = file.readUnsignedShort();
-        attributes = new Attribute[attributes_count];
-        for (int i = 0; i < attributes_count; i++) {
-            attributes[i] = Attribute.readAttribute(file, constant_pool);
-        }
-        this.attributes_count = attributes_count; // init deprecated field
+    protected FieldOrMethod(final FieldOrMethod c) {
+        this(c.getAccessFlags(), c.getNameIndex(), c.getSignatureIndex(), c.getAttributes(), c
+                .getConstantPool());
     }
 
 
@@ -128,6 +128,30 @@ public abstract class FieldOrMethod extends AccessFlags implements Cloneable, No
     }
 
 
+    /**
+     * @return deep copy of this field
+     */
+    protected FieldOrMethod copy_( final ConstantPool _constant_pool ) {
+        FieldOrMethod c = null;
+
+        try {
+          c = (FieldOrMethod)clone();
+        } catch(final CloneNotSupportedException e) {
+            // ignored, but will cause NPE ...
+        }
+
+        c.constant_pool    = constant_pool;
+        c.attributes       = new Attribute[attributes.length];
+        c.attributes_count = attributes_count; // init deprecated field
+
+        for (int i = 0; i < attributes.length; i++) {
+            c.attributes[i] = attributes[i].copy(constant_pool);
+        }
+
+        return c;
+    }
+
+
     /**
      * Dump object to file stream on binary format.
      *
@@ -148,19 +172,23 @@ public abstract class FieldOrMethod extends AccessFlags implements Cloneable, No
 
 
     /**
-     * @return Collection of object attributes.
+     * @return Annotations on the field or method
+     * @since 6.0
      */
-    public final Attribute[] getAttributes() {
-        return attributes;
+    public AnnotationEntry[] getAnnotationEntries() {
+        if (annotationEntries == null) {
+            annotationEntries = AnnotationEntry.createAnnotationEntries(getAttributes());
+        }
+
+        return annotationEntries;
     }
 
 
     /**
-     * @param attributes Collection of object attributes.
+     * @return Collection of object attributes.
      */
-    public final void setAttributes( final Attribute[] attributes ) {
-        this.attributes = attributes;
-        this.attributes_count = attributes != null ? attributes.length : 0; // init deprecated field
+    public final Attribute[] getAttributes() {
+        return attributes;
     }
 
 
@@ -173,10 +201,38 @@ public abstract class FieldOrMethod extends AccessFlags implements Cloneable, No
 
 
     /**
-     * @param constant_pool Constant pool to be used for this object.
+     * Hunts for a signature attribute on the member and returns its contents.  So where the 'regular' signature
+     * may be (Ljava/util/Vector;)V the signature attribute may in fact say 'Ljava/lang/Vector&lt;Ljava/lang/String&gt;;'
+     * Coded for performance - searches for the attribute only when requested - only searches for it once.
+     * @since 6.0
      */
-    public final void setConstantPool( final ConstantPool constant_pool ) {
-        this.constant_pool = constant_pool;
+    public final String getGenericSignature()
+    {
+        if (!searchedForSignatureAttribute)
+        {
+            boolean found = false;
+            for (int i = 0; !found && i < attributes.length; i++)
+            {
+                if (attributes[i] instanceof Signature)
+                {
+                    signatureAttributeString = ((Signature) attributes[i])
+                            .getSignature();
+                    found = true;
+                }
+            }
+            searchedForSignatureAttribute = true;
+        }
+        return signatureAttributeString;
+    }
+
+
+    /**
+     * @return Name of object, i.e., method name or field name
+     */
+    public final String getName() {
+        ConstantUtf8 c;
+        c = (ConstantUtf8) constant_pool.getConstant(name_index, Const.CONSTANT_Utf8);
+        return c.getBytes();
     }
 
 
@@ -189,10 +245,12 @@ public abstract class FieldOrMethod extends AccessFlags implements Cloneable, No
 
 
     /**
-     * @param name_index Index in constant pool of object's name.
+     * @return String representation of object's type signature (java style)
      */
-    public final void setNameIndex( final int name_index ) {
-        this.name_index = name_index;
+    public final String getSignature() {
+        ConstantUtf8 c;
+        c = (ConstantUtf8) constant_pool.getConstant(signature_index, Const.CONSTANT_Utf8);
+        return c.getBytes();
     }
 
 
@@ -205,90 +263,32 @@ public abstract class FieldOrMethod extends AccessFlags implements Cloneable, No
 
 
     /**
-     * @param signature_index Index in constant pool of field signature.
-     */
-    public final void setSignatureIndex( final int signature_index ) {
-        this.signature_index = signature_index;
-    }
-
-
-    /**
-     * @return Name of object, i.e., method name or field name
-     */
-    public final String getName() {
-        ConstantUtf8 c;
-        c = (ConstantUtf8) constant_pool.getConstant(name_index, Const.CONSTANT_Utf8);
-        return c.getBytes();
-    }
-
-
-    /**
-     * @return String representation of object's type signature (java style)
+     * @param attributes Collection of object attributes.
      */
-    public final String getSignature() {
-        ConstantUtf8 c;
-        c = (ConstantUtf8) constant_pool.getConstant(signature_index, Const.CONSTANT_Utf8);
-        return c.getBytes();
+    public final void setAttributes( final Attribute[] attributes ) {
+        this.attributes = attributes;
+        this.attributes_count = attributes != null ? attributes.length : 0; // init deprecated field
     }
 
 
     /**
-     * @return deep copy of this field
+     * @param constant_pool Constant pool to be used for this object.
      */
-    protected FieldOrMethod copy_( final ConstantPool _constant_pool ) {
-        FieldOrMethod c = null;
-
-        try {
-          c = (FieldOrMethod)clone();
-        } catch(final CloneNotSupportedException e) {
-            // ignored, but will cause NPE ...
-        }
-
-        c.constant_pool    = constant_pool;
-        c.attributes       = new Attribute[attributes.length];
-        c.attributes_count = attributes_count; // init deprecated field
-
-        for (int i = 0; i < attributes.length; i++) {
-            c.attributes[i] = attributes[i].copy(constant_pool);
-        }
-
-        return c;
+    public final void setConstantPool( final ConstantPool constant_pool ) {
+        this.constant_pool = constant_pool;
     }
 
     /**
-     * @return Annotations on the field or method
-     * @since 6.0
+     * @param name_index Index in constant pool of object's name.
      */
-    public AnnotationEntry[] getAnnotationEntries() {
-        if (annotationEntries == null) {
-            annotationEntries = AnnotationEntry.createAnnotationEntries(getAttributes());
-        }
-
-        return annotationEntries;
+    public final void setNameIndex( final int name_index ) {
+        this.name_index = name_index;
     }
 
     /**
-     * Hunts for a signature attribute on the member and returns its contents.  So where the 'regular' signature
-     * may be (Ljava/util/Vector;)V the signature attribute may in fact say 'Ljava/lang/Vector&lt;Ljava/lang/String&gt;;'
-     * Coded for performance - searches for the attribute only when requested - only searches for it once.
-     * @since 6.0
+     * @param signature_index Index in constant pool of field signature.
      */
-    public final String getGenericSignature()
-    {
-        if (!searchedForSignatureAttribute)
-        {
-            boolean found = false;
-            for (int i = 0; !found && i < attributes.length; i++)
-            {
-                if (attributes[i] instanceof Signature)
-                {
-                    signatureAttributeString = ((Signature) attributes[i])
-                            .getSignature();
-                    found = true;
-                }
-            }
-            searchedForSignatureAttribute = true;
-        }
-        return signatureAttributeString;
+    public final void setSignatureIndex( final int signature_index ) {
+        this.signature_index = signature_index;
     }
 }
diff --git a/src/main/java/org/apache/bcel/classfile/InnerClass.java b/src/main/java/org/apache/bcel/classfile/InnerClass.java
index b1916c73..c76cce1e 100644
--- a/src/main/java/org/apache/bcel/classfile/InnerClass.java
+++ b/src/main/java/org/apache/bcel/classfile/InnerClass.java
@@ -38,15 +38,6 @@ public final class InnerClass implements Cloneable, Node {
     private int innerAccessFlags;
 
 
-    /**
-     * Initialize from another object.
-     */
-    public InnerClass(final InnerClass c) {
-        this(c.getInnerClassIndex(), c.getOuterClassIndex(), c.getInnerNameIndex(), c
-                .getInnerAccessFlags());
-    }
-
-
     /**
      * Construct object from file stream.
      * @param file Input stream
@@ -58,6 +49,15 @@ public final class InnerClass implements Cloneable, Node {
     }
 
 
+    /**
+     * Initialize from another object.
+     */
+    public InnerClass(final InnerClass c) {
+        this(c.getInnerClassIndex(), c.getOuterClassIndex(), c.getInnerNameIndex(), c
+                .getInnerAccessFlags());
+    }
+
+
     /**
      * @param innerClassIndex Class index in constant pool of inner class
      * @param outerClassIndex Class index in constant pool of outer class
@@ -86,6 +86,19 @@ public final class InnerClass implements Cloneable, Node {
     }
 
 
+    /**
+     * @return deep copy of this object
+     */
+    public InnerClass copy() {
+        try {
+            return (InnerClass) clone();
+        } catch (final CloneNotSupportedException e) {
+            // TODO should this throw?
+        }
+        return null;
+    }
+
+
     /**
      * Dump inner class attribute to file stream in binary format.
      *
@@ -200,17 +213,4 @@ public final class InnerClass implements Cloneable, Node {
         access = access.isEmpty() ? "" : access + " ";
         return "  " + access + inner_name + "=class " + inner_class_name + outer_class_name;
     }
-
-
-    /**
-     * @return deep copy of this object
-     */
-    public InnerClass copy() {
-        try {
-            return (InnerClass) clone();
-        } catch (final CloneNotSupportedException e) {
-            // TODO should this throw?
-        }
-        return null;
-    }
 }
diff --git a/src/main/java/org/apache/bcel/classfile/InnerClasses.java b/src/main/java/org/apache/bcel/classfile/InnerClasses.java
index 67f2fd8c..97383bac 100644
--- a/src/main/java/org/apache/bcel/classfile/InnerClasses.java
+++ b/src/main/java/org/apache/bcel/classfile/InnerClasses.java
@@ -50,19 +50,6 @@ public final class InnerClasses extends Attribute {
     }
 
 
-    /**
-     * @param name_index Index in constant pool to CONSTANT_Utf8
-     * @param length Content length in bytes
-     * @param innerClasses array of inner classes attributes
-     * @param constant_pool Array of constants
-     */
-    public InnerClasses(final int name_index, final int length, final InnerClass[] innerClasses,
-            final ConstantPool constant_pool) {
-        super(Const.ATTR_INNER_CLASSES, name_index, length, constant_pool);
-        this.innerClasses = innerClasses != null ? innerClasses : EMPTY_INNER_CLASSE_ARRAY;
-    }
-
-
     /**
      * Construct object from input stream.
      *
@@ -83,6 +70,19 @@ public final class InnerClasses extends Attribute {
     }
 
 
+    /**
+     * @param name_index Index in constant pool to CONSTANT_Utf8
+     * @param length Content length in bytes
+     * @param innerClasses array of inner classes attributes
+     * @param constant_pool Array of constants
+     */
+    public InnerClasses(final int name_index, final int length, final InnerClass[] innerClasses,
+            final ConstantPool constant_pool) {
+        super(Const.ATTR_INNER_CLASSES, name_index, length, constant_pool);
+        this.innerClasses = innerClasses != null ? innerClasses : EMPTY_INNER_CLASSE_ARRAY;
+    }
+
+
     /**
      * 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,
@@ -96,6 +96,22 @@ public final class InnerClasses extends Attribute {
     }
 
 
+    /**
+     * @return deep copy of this attribute
+     */
+    @Override
+    public Attribute copy( final ConstantPool _constant_pool ) {
+        // TODO this could be recoded to use a lower level constructor after creating a copy of the inner classes
+        final InnerClasses c = (InnerClasses) clone();
+        c.innerClasses = new InnerClass[innerClasses.length];
+        for (int i = 0; i < innerClasses.length; i++) {
+            c.innerClasses[i] = innerClasses[i].copy();
+        }
+        c.setConstantPool(_constant_pool);
+        return c;
+    }
+
+
     /**
      * Dump source file attribute to file stream in binary format.
      *
@@ -142,20 +158,4 @@ public final class InnerClasses extends Attribute {
         }
         return buf.substring(0, buf.length()-1); // remove the last newline
     }
-
-
-    /**
-     * @return deep copy of this attribute
-     */
-    @Override
-    public Attribute copy( final ConstantPool _constant_pool ) {
-        // TODO this could be recoded to use a lower level constructor after creating a copy of the inner classes
-        final InnerClasses c = (InnerClasses) clone();
-        c.innerClasses = new InnerClass[innerClasses.length];
-        for (int i = 0; i < innerClasses.length; i++) {
-            c.innerClasses[i] = innerClasses[i].copy();
-        }
-        c.setConstantPool(_constant_pool);
-        return c;
-    }
 }
diff --git a/src/main/java/org/apache/bcel/classfile/JavaClass.java b/src/main/java/org/apache/bcel/classfile/JavaClass.java
index 875701d9..e744af16 100644
--- a/src/main/java/org/apache/bcel/classfile/JavaClass.java
+++ b/src/main/java/org/apache/bcel/classfile/JavaClass.java
@@ -51,6 +51,53 @@ public class JavaClass extends AccessFlags implements Cloneable, Node, Comparabl
 
     static final JavaClass[] EMPTY_ARRAY = {};
 
+    public static final byte HEAP = 1;
+    public static final byte FILE = 2;
+    public static final byte ZIP = 3;
+    private static final boolean debug = Boolean.getBoolean("JavaClass.debug"); // Debugging on/off
+    private static BCELComparator bcelComparator = new BCELComparator() {
+
+        @Override
+        public boolean equals( final Object o1, final Object o2 ) {
+            final JavaClass THIS = (JavaClass) o1;
+            final JavaClass THAT = (JavaClass) o2;
+            return Objects.equals(THIS.getClassName(), THAT.getClassName());
+        }
+
+
+        @Override
+        public int hashCode( final Object o ) {
+            final JavaClass THIS = (JavaClass) o;
+            return THIS.getClassName().hashCode();
+        }
+    };
+    /* Print debug information depending on `JavaClass.debug'
+     */
+    static void Debug( final String str ) {
+        if (debug) {
+            System.out.println(str);
+        }
+    }
+    /**
+     * @return Comparison strategy object
+     */
+    public static BCELComparator getComparator() {
+        return bcelComparator;
+    }
+    private static String indent( final Object obj ) {
+        final StringTokenizer tok = new StringTokenizer(obj.toString(), "\n");
+        final StringBuilder buf = new StringBuilder();
+        while (tok.hasMoreTokens()) {
+            buf.append("\t").append(tok.nextToken()).append("\n");
+        }
+        return buf.toString();
+    }
+    /**
+     * @param comparator Comparison strategy object
+     */
+    public static void setComparator( final BCELComparator comparator ) {
+        bcelComparator = comparator;
+    }
     private String fileName;
     private final String packageName;
     private String sourceFileName = "<Unknown>";
@@ -66,32 +113,20 @@ public class JavaClass extends AccessFlags implements Cloneable, Node, Comparabl
     private Field[] fields; // Fields, i.e., variables of class
     private Method[] methods; // methods defined in the class
     private Attribute[] attributes; // attributes defined in the class
+
     private AnnotationEntry[] annotations;   // annotations defined on the class
     private byte source = HEAP; // Generated in memory
+
+
     private boolean isAnonymous;
+
+
     private boolean isNested;
-    private boolean computedNestedTypeStatus;
-    public static final byte HEAP = 1;
-    public static final byte FILE = 2;
-    public static final byte ZIP = 3;
-    private static final boolean debug = Boolean.getBoolean("JavaClass.debug"); // Debugging on/off
 
-    private static BCELComparator bcelComparator = new BCELComparator() {
 
-        @Override
-        public boolean equals( final Object o1, final Object o2 ) {
-            final JavaClass THIS = (JavaClass) o1;
-            final JavaClass THAT = (JavaClass) o2;
-            return Objects.equals(THIS.getClassName(), THAT.getClassName());
-        }
+    private boolean computedNestedTypeStatus;
 
 
-        @Override
-        public int hashCode( final Object o ) {
-            final JavaClass THIS = (JavaClass) o;
-            return THIS.getClassName().hashCode();
-        }
-    };
     /**
      * In cases where we go ahead and create something,
      * use the default SyntheticRepository, because we
@@ -101,6 +136,29 @@ public class JavaClass extends AccessFlags implements Cloneable, Node, Comparabl
             .getInstance();
 
 
+    /**
+     * Constructor gets all contents as arguments.
+     *
+     * @param classNameIndex Class name
+     * @param superclassNameIndex Superclass name
+     * @param fileName File name
+     * @param major Major compiler version
+     * @param minor Minor compiler version
+     * @param access_flags Access rights defined by bit flags
+     * @param constantPool Array of constants
+     * @param interfaces Implemented interfaces
+     * @param fields Class fields
+     * @param methods Class methods
+     * @param attributes Class attributes
+     */
+    public JavaClass(final int classNameIndex, final int superclassNameIndex, final String fileName, final int major,
+            final int minor, final int access_flags, final ConstantPool constantPool, final int[] interfaces,
+            final Field[] fields, final Method[] methods, final Attribute[] attributes) {
+        this(classNameIndex, superclassNameIndex, fileName, major, minor, access_flags,
+                constantPool, interfaces, fields, methods, attributes, HEAP);
+    }
+
+
     /**
      * Constructor gets all contents as arguments.
      *
@@ -181,29 +239,6 @@ public class JavaClass extends AccessFlags implements Cloneable, Node, Comparabl
     }
 
 
-    /**
-     * Constructor gets all contents as arguments.
-     *
-     * @param classNameIndex Class name
-     * @param superclassNameIndex Superclass name
-     * @param fileName File name
-     * @param major Major compiler version
-     * @param minor Minor compiler version
-     * @param access_flags Access rights defined by bit flags
-     * @param constantPool Array of constants
-     * @param interfaces Implemented interfaces
-     * @param fields Class fields
-     * @param methods Class methods
-     * @param attributes Class attributes
-     */
-    public JavaClass(final int classNameIndex, final int superclassNameIndex, final String fileName, final int major,
-            final int minor, final int access_flags, final ConstantPool constantPool, final int[] interfaces,
-            final Field[] fields, final Method[] methods, final Attribute[] attributes) {
-        this(classNameIndex, superclassNameIndex, fileName, major, minor, access_flags,
-                constantPool, interfaces, fields, methods, attributes, HEAP);
-    }
-
-
     /**
      * 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,
@@ -217,78 +252,73 @@ public class JavaClass extends AccessFlags implements Cloneable, Node, Comparabl
     }
 
 
-    /* Print debug information depending on `JavaClass.debug'
+    /**
+     * Return the natural ordering of two JavaClasses.
+     * This ordering is based on the class name
+     * @since 6.0
      */
-    static void Debug( final String str ) {
-        if (debug) {
-            System.out.println(str);
-        }
+    @Override
+    public int compareTo( final JavaClass obj ) {
+        return getClassName().compareTo(obj.getClassName());
     }
 
 
-    /**
-     * Dump class to a file.
-     *
-     * @param file Output file
-     * @throws IOException
-     */
-    public void dump(final File file) throws IOException {
-        final String parent = file.getParent();
-        if (parent != null) {
-            final File dir = new File(parent);
-            if (!dir.mkdirs() && !dir.isDirectory()) {
-                throw new IOException("Could not create the directory " + dir);
-            }
+    private void computeNestedTypeStatus() {
+        if (computedNestedTypeStatus) {
+            return;
         }
-        try (DataOutputStream dos = new DataOutputStream(new FileOutputStream(file))) {
-            dump(dos);
+        for (final Attribute attribute : this.attributes) {
+              if (attribute instanceof InnerClasses) {
+                  final InnerClass[] innerClasses = ((InnerClasses) attribute).getInnerClasses();
+                  for (final InnerClass innerClasse : innerClasses) {
+                      boolean innerClassAttributeRefersToMe = false;
+                      String inner_class_name = constantPool.getConstantString(innerClasse.getInnerClassIndex(),
+                                 Const.CONSTANT_Class);
+                      inner_class_name = Utility.compactClassName(inner_class_name, false);
+                      if (inner_class_name.equals(getClassName())) {
+                          innerClassAttributeRefersToMe = true;
+                      }
+                      if (innerClassAttributeRefersToMe) {
+                          this.isNested = true;
+                          if (innerClasse.getInnerNameIndex() == 0) {
+                              this.isAnonymous = true;
+                          }
+                      }
+                  }
+              }
         }
+        this.computedNestedTypeStatus = true;
     }
 
 
     /**
-     * Dump class to a file named fileName.
-     *
-     * @param _file_name Output file name
-     * @throws IOException
-     */
-    public void dump( final String _file_name ) throws IOException {
-        dump(new File(_file_name));
-    }
-
-
-    /**
-     * @return class in binary format
+     * @return deep copy of this class
      */
-    public byte[] getBytes() {
-        final ByteArrayOutputStream s = new ByteArrayOutputStream();
-        final DataOutputStream ds = new DataOutputStream(s);
+    public JavaClass copy() {
+        JavaClass c = null;
         try {
-            dump(ds);
-        } catch (final IOException e) {
-            e.printStackTrace();
-        } finally {
-            try {
-                ds.close();
-            } catch (final IOException e2) {
-                e2.printStackTrace();
+            c = (JavaClass) clone();
+            c.constantPool = constantPool.copy();
+            c.interfaces = interfaces.clone();
+            c.interfaceNames = interfaceNames.clone();
+            c.fields = new Field[fields.length];
+            for (int i = 0; i < fields.length; i++) {
+                c.fields[i] = fields[i].copy(c.constantPool);
+            }
+            c.methods = new Method[methods.length];
+            for (int i = 0; i < methods.length; i++) {
+                c.methods[i] = methods[i].copy(c.constantPool);
+            }
+            c.attributes = new Attribute[attributes.length];
+            for (int i = 0; i < attributes.length; i++) {
+                c.attributes[i] = attributes[i].copy(c.constantPool);
             }
+        } catch (final CloneNotSupportedException e) {
+            // TODO should this throw?
         }
-        return s.toByteArray();
-    }
-
-
-    /**
-     * Dump Java class to output stream in binary format.
-     *
-     * @param file Output stream
-     * @throws IOException
-     */
-    public void dump( final OutputStream file ) throws IOException {
-        dump(new DataOutputStream(file));
+        return c;
     }
 
-
     /**
      * Dump Java class to output stream in binary format.
      *
@@ -326,39 +356,132 @@ public class JavaClass extends AccessFlags implements Cloneable, Node, Comparabl
         file.flush();
     }
 
-
-    /**
-     * @return Attributes of the class.
-     */
-    public Attribute[] getAttributes() {
-        return attributes;
-    }
-
     /**
-     * @return Annotations on the class
-     * @since 6.0
+     * Dump class to a file.
+     *
+     * @param file Output file
+     * @throws IOException
      */
-    public AnnotationEntry[] getAnnotationEntries() {
-        if (annotations == null) {
-            annotations = AnnotationEntry.createAnnotationEntries(getAttributes());
+    public void dump(final File file) throws IOException {
+        final String parent = file.getParent();
+        if (parent != null) {
+            final File dir = new File(parent);
+            if (!dir.mkdirs() && !dir.isDirectory()) {
+                throw new IOException("Could not create the directory " + dir);
+            }
+        }
+        try (DataOutputStream dos = new DataOutputStream(new FileOutputStream(file))) {
+            dump(dos);
         }
-
-        return annotations;
     }
 
+
     /**
-     * @return Class name.
-     */
-    public String getClassName() {
-        return className;
+     * Dump Java class to output stream in binary format.
+     *
+     * @param file Output stream
+     * @throws IOException
+     */
+    public void dump( final OutputStream file ) throws IOException {
+        dump(new DataOutputStream(file));
     }
 
 
     /**
-     * @return Package name.
+     * Dump class to a file named fileName.
+     *
+     * @param _file_name Output file name
+     * @throws IOException
      */
-    public String getPackageName() {
-        return packageName;
+    public void dump( final String _file_name ) throws IOException {
+        dump(new File(_file_name));
+    }
+
+
+    /**
+     * Return value as defined by given BCELComparator strategy.
+     * By default two JavaClass objects are said to be equal when
+     * their class names are equal.
+     *
+     * @see java.lang.Object#equals(java.lang.Object)
+     */
+    @Override
+    public boolean equals( final Object obj ) {
+        return bcelComparator.equals(this, obj);
+    }
+
+
+    /**
+     * Get all interfaces implemented by this JavaClass (transitively).
+     */
+    public JavaClass[] getAllInterfaces() throws ClassNotFoundException {
+        final ClassQueue queue = new ClassQueue();
+        final Set<JavaClass> allInterfaces = new TreeSet<>();
+        queue.enqueue(this);
+        while (!queue.empty()) {
+            final JavaClass clazz = queue.dequeue();
+            final JavaClass souper = clazz.getSuperClass();
+            final JavaClass[] _interfaces = clazz.getInterfaces();
+            if (clazz.isInterface()) {
+                allInterfaces.add(clazz);
+            } else if (souper != null) {
+                queue.enqueue(souper);
+            }
+            for (final JavaClass _interface : _interfaces) {
+                queue.enqueue(_interface);
+            }
+        }
+        return allInterfaces.toArray(JavaClass.EMPTY_ARRAY);
+    }
+
+
+    /**
+     * @return Annotations on the class
+     * @since 6.0
+     */
+    public AnnotationEntry[] getAnnotationEntries() {
+        if (annotations == null) {
+            annotations = AnnotationEntry.createAnnotationEntries(getAttributes());
+        }
+
+        return annotations;
+    }
+
+
+    /**
+     * @return Attributes of the class.
+     */
+    public Attribute[] getAttributes() {
+        return attributes;
+    }
+
+
+    /**
+     * @return class in binary format
+     */
+    public byte[] getBytes() {
+        final ByteArrayOutputStream s = new ByteArrayOutputStream();
+        final DataOutputStream ds = new DataOutputStream(s);
+        try {
+            dump(ds);
+        } catch (final IOException e) {
+            e.printStackTrace();
+        } finally {
+            try {
+                ds.close();
+            } catch (final IOException e2) {
+                e2.printStackTrace();
+            }
+        }
+        return s.toByteArray();
+    }
+
+
+    /**
+     * @return Class name.
+     */
+    public String getClassName() {
+        return className;
     }
 
 
@@ -396,6 +519,14 @@ public class JavaClass extends AccessFlags implements Cloneable, Node, Comparabl
     }
 
 
+    /**
+     * @return Indices in constant pool of implemented interfaces.
+     */
+    public int[] getInterfaceIndices() {
+        return interfaces;
+    }
+
+
     /**
      * @return Names of implemented interfaces.
      */
@@ -403,12 +534,16 @@ public class JavaClass extends AccessFlags implements Cloneable, Node, Comparabl
         return interfaceNames;
     }
 
-
     /**
-     * @return Indices in constant pool of implemented interfaces.
+     * Get interfaces directly implemented by this JavaClass.
      */
-    public int[] getInterfaceIndices() {
-        return interfaces;
+    public JavaClass[] getInterfaces() throws ClassNotFoundException {
+        final String[] _interfaces = getInterfaceNames();
+        final JavaClass[] classes = new JavaClass[_interfaces.length];
+        for (int i = 0; i < _interfaces.length; i++) {
+            classes[i] = repository.loadClass(_interfaces[i]);
+        }
+        return classes;
     }
 
 
@@ -420,14 +555,6 @@ public class JavaClass extends AccessFlags implements Cloneable, Node, Comparabl
     }
 
 
-    /**
-     * @return Methods of the class.
-     */
-    public Method[] getMethods() {
-        return methods;
-    }
-
-
     /**
      * @return A {@link Method} corresponding to
      * java.lang.reflect.Method if any
@@ -444,250 +571,165 @@ public class JavaClass extends AccessFlags implements Cloneable, Node, Comparabl
 
 
     /**
-     * @return Minor number of class file version.
+     * @return Methods of the class.
      */
-    public int getMinor() {
-        return minor;
+    public Method[] getMethods() {
+        return methods;
     }
 
 
     /**
-     * @return sbsolute path to file where this class was read from
+     * @return Minor number of class file version.
      */
-    public String getSourceFileName() {
-        return sourceFileName;
+    public int getMinor() {
+        return minor;
     }
 
 
     /**
-     * returns the super class name of this class. In the case that this class is
-     * java.lang.Object, it will return itself (java.lang.Object). This is probably incorrect
-     * but isn't fixed at this time to not break existing clients.
-     *
-     * @return Superclass name.
+     * @return Package name.
      */
-    public String getSuperclassName() {
-        return superclassName;
+    public String getPackageName() {
+        return packageName;
     }
 
 
+    /********************* New repository functionality *********************/
     /**
-     * @return Class name index.
-     */
-    public int getSuperclassNameIndex() {
-        return superclassNameIndex;
-    }
-
-    /**
-     * @param attributes .
+     * Gets the ClassRepository which holds its definition. By default
+     * this is the same as SyntheticRepository.getInstance();
      */
-    public void setAttributes( final Attribute[] attributes ) {
-        this.attributes = attributes;
+    public org.apache.bcel.util.Repository getRepository() {
+        return repository;
     }
 
 
-    /**
-     * @param className .
+    /** @return returns either HEAP (generated), FILE, or ZIP
      */
-    public void setClassName( final String className ) {
-        this.className = className;
+    public final byte getSource() {
+        return source;
     }
 
 
     /**
-     * @param classNameIndex .
+     * @return sbsolute path to file where this class was read from
      */
-    public void setClassNameIndex( final int classNameIndex ) {
-        this.classNameIndex = classNameIndex;
+    public String getSourceFileName() {
+        return sourceFileName;
     }
 
 
     /**
-     * @param constantPool .
+     * @return the superclass for this JavaClass object, or null if this
+     * is java.lang.Object
+     * @throws ClassNotFoundException if the superclass can't be found
      */
-    public void setConstantPool( final ConstantPool constantPool ) {
-        this.constantPool = constantPool;
+    public JavaClass getSuperClass() throws ClassNotFoundException {
+        if ("java.lang.Object".equals(getClassName())) {
+            return null;
+        }
+        return repository.loadClass(getSuperclassName());
     }
 
 
     /**
-     * @param fields .
+     * @return list of super classes of this class in ascending order, i.e.,
+     * java.lang.Object is always the last element
+     * @throws ClassNotFoundException if any of the superclasses can't be found
      */
-    public void setFields( final Field[] fields ) {
-        this.fields = fields;
+    public JavaClass[] getSuperClasses() throws ClassNotFoundException {
+        JavaClass clazz = this;
+        final List<JavaClass> allSuperClasses = new ArrayList<>();
+        for (clazz = clazz.getSuperClass(); clazz != null; clazz = clazz.getSuperClass()) {
+            allSuperClasses.add(clazz);
+        }
+        return allSuperClasses.toArray(JavaClass.EMPTY_ARRAY);
     }
 
 
     /**
-     * Set File name of class, aka SourceFile attribute value
+     * returns the super class name of this class. In the case that this class is
+     * java.lang.Object, it will return itself (java.lang.Object). This is probably incorrect
+     * but isn't fixed at this time to not break existing clients.
+     *
+     * @return Superclass name.
      */
-    public void setFileName( final String fileName ) {
-        this.fileName = fileName;
+    public String getSuperclassName() {
+        return superclassName;
     }
 
 
     /**
-     * @param interfaceNames .
+     * @return Class name index.
      */
-    public void setInterfaceNames( final String[] interfaceNames ) {
-        this.interfaceNames = interfaceNames;
+    public int getSuperclassNameIndex() {
+        return superclassNameIndex;
     }
 
 
     /**
-     * @param interfaces .
+     * Return value as defined by given BCELComparator strategy.
+     * By default return the hashcode of the class name.
+     *
+     * @see java.lang.Object#hashCode()
      */
-    public void setInterfaces( final int[] interfaces ) {
-        this.interfaces = interfaces;
+    @Override
+    public int hashCode() {
+        return bcelComparator.hashCode(this);
     }
 
 
     /**
-     * @param major .
+     * @return true, if this class is an implementation of interface inter
+     * @throws ClassNotFoundException if superclasses or superinterfaces
+     *   of this class can't be found
      */
-    public void setMajor( final int major ) {
-        this.major = major;
+    public boolean implementationOf( final JavaClass inter ) throws ClassNotFoundException {
+        if (!inter.isInterface()) {
+            throw new IllegalArgumentException(inter.getClassName() + " is no interface");
+        }
+        if (this.equals(inter)) {
+            return true;
+        }
+        final JavaClass[] super_interfaces = getAllInterfaces();
+        for (final JavaClass super_interface : super_interfaces) {
+            if (super_interface.equals(inter)) {
+                return true;
+            }
+        }
+        return false;
     }
 
 
-    /**
-     * @param methods .
-     */
-    public void setMethods( final Method[] methods ) {
-        this.methods = methods;
-    }
-
-
-    /**
-     * @param minor .
-     */
-    public void setMinor( final int minor ) {
-        this.minor = minor;
-    }
-
-
-    /**
-     * Set absolute path to file this class was read from.
-     */
-    public void setSourceFileName( final String sourceFileName ) {
-        this.sourceFileName = sourceFileName;
-    }
-
-
-    /**
-     * @param superclassName .
-     */
-    public void setSuperclassName( final String superclassName ) {
-        this.superclassName = superclassName;
-    }
-
-
-    /**
-     * @param superclassNameIndex .
-     */
-    public void setSuperclassNameIndex( final int superclassNameIndex ) {
-        this.superclassNameIndex = superclassNameIndex;
-    }
-
-
-    /**
-     * @return String representing class contents.
+    /** Equivalent to runtime "instanceof" operator.
+     *
+     * @return true if this JavaClass is derived from the super class
+     * @throws ClassNotFoundException if superclasses or superinterfaces
+     *   of this object can't be found
      */
-    @Override
-    public String toString() {
-        String access = Utility.accessToString(super.getAccessFlags(), true);
-        access = access.isEmpty() ? "" : access + " ";
-        final StringBuilder buf = new StringBuilder(128);
-        buf.append(access).append(Utility.classOrInterface(super.getAccessFlags())).append(" ").append(
-                className).append(" extends ").append(
-                Utility.compactClassName(superclassName, false)).append('\n');
-        final int size = interfaces.length;
-        if (size > 0) {
-            buf.append("implements\t\t");
-            for (int i = 0; i < size; i++) {
-                buf.append(interfaceNames[i]);
-                if (i < size - 1) {
-                    buf.append(", ");
-                }
-            }
-            buf.append('\n');
-        }
-        buf.append("file name\t\t").append(fileName).append('\n');
-        buf.append("compiled from\t\t").append(sourceFileName).append('\n');
-        buf.append("compiler version\t").append(major).append(".").append(minor).append('\n');
-        buf.append("access flags\t\t").append(super.getAccessFlags()).append('\n');
-        buf.append("constant pool\t\t").append(constantPool.getLength()).append(" entries\n");
-        buf.append("ACC_SUPER flag\t\t").append(isSuper()).append("\n");
-        if (attributes.length > 0) {
-            buf.append("\nAttribute(s):\n");
-            for (final Attribute attribute : attributes) {
-                buf.append(indent(attribute));
-            }
-        }
-        final AnnotationEntry[] annotations = getAnnotationEntries();
-        if (annotations!=null && annotations.length>0) {
-            buf.append("\nAnnotation(s):\n");
-            for (final AnnotationEntry annotation : annotations) {
-                buf.append(indent(annotation));
-            }
-        }
-        if (fields.length > 0) {
-            buf.append("\n").append(fields.length).append(" fields:\n");
-            for (final Field field : fields) {
-                buf.append("\t").append(field).append('\n');
-            }
+    public final boolean instanceOf( final JavaClass super_class ) throws ClassNotFoundException {
+        if (this.equals(super_class)) {
+            return true;
         }
-        if (methods.length > 0) {
-            buf.append("\n").append(methods.length).append(" methods:\n");
-            for (final Method method : methods) {
-                buf.append("\t").append(method).append('\n');
+        final JavaClass[] super_classes = getSuperClasses();
+        for (final JavaClass super_classe : super_classes) {
+            if (super_classe.equals(super_class)) {
+                return true;
             }
         }
-        return buf.toString();
-    }
-
-
-    private static String indent( final Object obj ) {
-        final StringTokenizer tok = new StringTokenizer(obj.toString(), "\n");
-        final StringBuilder buf = new StringBuilder();
-        while (tok.hasMoreTokens()) {
-            buf.append("\t").append(tok.nextToken()).append("\n");
+        if (super_class.isInterface()) {
+            return implementationOf(super_class);
         }
-        return buf.toString();
+        return false;
     }
 
 
     /**
-     * @return deep copy of this class
+     * @since 6.0
      */
-    public JavaClass copy() {
-        JavaClass c = null;
-        try {
-            c = (JavaClass) clone();
-            c.constantPool = constantPool.copy();
-            c.interfaces = interfaces.clone();
-            c.interfaceNames = interfaceNames.clone();
-            c.fields = new Field[fields.length];
-            for (int i = 0; i < fields.length; i++) {
-                c.fields[i] = fields[i].copy(c.constantPool);
-            }
-            c.methods = new Method[methods.length];
-            for (int i = 0; i < methods.length; i++) {
-                c.methods[i] = methods[i].copy(c.constantPool);
-            }
-            c.attributes = new Attribute[attributes.length];
-            for (int i = 0; i < attributes.length; i++) {
-                c.attributes[i] = attributes[i].copy(c.constantPool);
-            }
-        } catch (final CloneNotSupportedException e) {
-            // TODO should this throw?
-        }
-        return c;
-    }
-
-
-    public final boolean isSuper() {
-        return (super.getAccessFlags() & Const.ACC_SUPER) != 0;
+    public final boolean isAnonymous() {
+        computeNestedTypeStatus();
+        return this.isAnonymous;
     }
 
 
@@ -695,234 +737,192 @@ public class JavaClass extends AccessFlags implements Cloneable, Node, Comparabl
         return (super.getAccessFlags() & Const.ACC_INTERFACE) == 0;
     }
 
+
     /**
      * @since 6.0
      */
-    public final boolean isAnonymous() {
+    public final boolean isNested() {
         computeNestedTypeStatus();
-        return this.isAnonymous;
+        return this.isNested;
+    }
+
+    public final boolean isSuper() {
+        return (super.getAccessFlags() & Const.ACC_SUPER) != 0;
     }
 
     /**
-     * @since 6.0
+     * @param attributes .
      */
-    public final boolean isNested() {
-        computeNestedTypeStatus();
-        return this.isNested;
+    public void setAttributes( final Attribute[] attributes ) {
+        this.attributes = attributes;
     }
 
-    private void computeNestedTypeStatus() {
-        if (computedNestedTypeStatus) {
-            return;
-        }
-        for (final Attribute attribute : this.attributes) {
-              if (attribute instanceof InnerClasses) {
-                  final InnerClass[] innerClasses = ((InnerClasses) attribute).getInnerClasses();
-                  for (final InnerClass innerClasse : innerClasses) {
-                      boolean innerClassAttributeRefersToMe = false;
-                      String inner_class_name = constantPool.getConstantString(innerClasse.getInnerClassIndex(),
-                                 Const.CONSTANT_Class);
-                      inner_class_name = Utility.compactClassName(inner_class_name, false);
-                      if (inner_class_name.equals(getClassName())) {
-                          innerClassAttributeRefersToMe = true;
-                      }
-                      if (innerClassAttributeRefersToMe) {
-                          this.isNested = true;
-                          if (innerClasse.getInnerNameIndex() == 0) {
-                              this.isAnonymous = true;
-                          }
-                      }
-                  }
-              }
-        }
-        this.computedNestedTypeStatus = true;
+    /**
+     * @param className .
+     */
+    public void setClassName( final String className ) {
+        this.className = className;
     }
 
 
-    /** @return returns either HEAP (generated), FILE, or ZIP
+    /**
+     * @param classNameIndex .
      */
-    public final byte getSource() {
-        return source;
+    public void setClassNameIndex( final int classNameIndex ) {
+        this.classNameIndex = classNameIndex;
     }
 
 
-    /********************* New repository functionality *********************/
     /**
-     * Gets the ClassRepository which holds its definition. By default
-     * this is the same as SyntheticRepository.getInstance();
+     * @param constantPool .
      */
-    public org.apache.bcel.util.Repository getRepository() {
-        return repository;
+    public void setConstantPool( final ConstantPool constantPool ) {
+        this.constantPool = constantPool;
     }
 
 
     /**
-     * Sets the ClassRepository which loaded the JavaClass.
-     * Should be called immediately after parsing is done.
+     * @param fields .
      */
-    public void setRepository( final org.apache.bcel.util.Repository repository ) { // TODO make protected?
-        this.repository = repository;
+    public void setFields( final Field[] fields ) {
+        this.fields = fields;
     }
 
 
-    /** Equivalent to runtime "instanceof" operator.
-     *
-     * @return true if this JavaClass is derived from the super class
-     * @throws ClassNotFoundException if superclasses or superinterfaces
-     *   of this object can't be found
+    /**
+     * Set File name of class, aka SourceFile attribute value
      */
-    public final boolean instanceOf( final JavaClass super_class ) throws ClassNotFoundException {
-        if (this.equals(super_class)) {
-            return true;
-        }
-        final JavaClass[] super_classes = getSuperClasses();
-        for (final JavaClass super_classe : super_classes) {
-            if (super_classe.equals(super_class)) {
-                return true;
-            }
-        }
-        if (super_class.isInterface()) {
-            return implementationOf(super_class);
-        }
-        return false;
+    public void setFileName( final String fileName ) {
+        this.fileName = fileName;
     }
 
 
     /**
-     * @return true, if this class is an implementation of interface inter
-     * @throws ClassNotFoundException if superclasses or superinterfaces
-     *   of this class can't be found
+     * @param interfaceNames .
      */
-    public boolean implementationOf( final JavaClass inter ) throws ClassNotFoundException {
-        if (!inter.isInterface()) {
-            throw new IllegalArgumentException(inter.getClassName() + " is no interface");
-        }
-        if (this.equals(inter)) {
-            return true;
-        }
-        final JavaClass[] super_interfaces = getAllInterfaces();
-        for (final JavaClass super_interface : super_interfaces) {
-            if (super_interface.equals(inter)) {
-                return true;
-            }
-        }
-        return false;
+    public void setInterfaceNames( final String[] interfaceNames ) {
+        this.interfaceNames = interfaceNames;
     }
 
 
     /**
-     * @return the superclass for this JavaClass object, or null if this
-     * is java.lang.Object
-     * @throws ClassNotFoundException if the superclass can't be found
+     * @param interfaces .
      */
-    public JavaClass getSuperClass() throws ClassNotFoundException {
-        if ("java.lang.Object".equals(getClassName())) {
-            return null;
-        }
-        return repository.loadClass(getSuperclassName());
+    public void setInterfaces( final int[] interfaces ) {
+        this.interfaces = interfaces;
     }
 
 
     /**
-     * @return list of super classes of this class in ascending order, i.e.,
-     * java.lang.Object is always the last element
-     * @throws ClassNotFoundException if any of the superclasses can't be found
+     * @param major .
      */
-    public JavaClass[] getSuperClasses() throws ClassNotFoundException {
-        JavaClass clazz = this;
-        final List<JavaClass> allSuperClasses = new ArrayList<>();
-        for (clazz = clazz.getSuperClass(); clazz != null; clazz = clazz.getSuperClass()) {
-            allSuperClasses.add(clazz);
-        }
-        return allSuperClasses.toArray(JavaClass.EMPTY_ARRAY);
+    public void setMajor( final int major ) {
+        this.major = major;
     }
 
 
     /**
-     * Get interfaces directly implemented by this JavaClass.
+     * @param methods .
      */
-    public JavaClass[] getInterfaces() throws ClassNotFoundException {
-        final String[] _interfaces = getInterfaceNames();
-        final JavaClass[] classes = new JavaClass[_interfaces.length];
-        for (int i = 0; i < _interfaces.length; i++) {
-            classes[i] = repository.loadClass(_interfaces[i]);
-        }
-        return classes;
+    public void setMethods( final Method[] methods ) {
+        this.methods = methods;
     }
 
 
     /**
-     * Get all interfaces implemented by this JavaClass (transitively).
+     * @param minor .
      */
-    public JavaClass[] getAllInterfaces() throws ClassNotFoundException {
-        final ClassQueue queue = new ClassQueue();
-        final Set<JavaClass> allInterfaces = new TreeSet<>();
-        queue.enqueue(this);
-        while (!queue.empty()) {
-            final JavaClass clazz = queue.dequeue();
-            final JavaClass souper = clazz.getSuperClass();
-            final JavaClass[] _interfaces = clazz.getInterfaces();
-            if (clazz.isInterface()) {
-                allInterfaces.add(clazz);
-            } else if (souper != null) {
-                queue.enqueue(souper);
-            }
-            for (final JavaClass _interface : _interfaces) {
-                queue.enqueue(_interface);
-            }
-        }
-        return allInterfaces.toArray(JavaClass.EMPTY_ARRAY);
+    public void setMinor( final int minor ) {
+        this.minor = minor;
     }
 
 
     /**
-     * @return Comparison strategy object
+     * Sets the ClassRepository which loaded the JavaClass.
+     * Should be called immediately after parsing is done.
      */
-    public static BCELComparator getComparator() {
-        return bcelComparator;
+    public void setRepository( final org.apache.bcel.util.Repository repository ) { // TODO make protected?
+        this.repository = repository;
     }
 
 
     /**
-     * @param comparator Comparison strategy object
+     * Set absolute path to file this class was read from.
      */
-    public static void setComparator( final BCELComparator comparator ) {
-        bcelComparator = comparator;
+    public void setSourceFileName( final String sourceFileName ) {
+        this.sourceFileName = sourceFileName;
     }
 
 
     /**
-     * Return value as defined by given BCELComparator strategy.
-     * By default two JavaClass objects are said to be equal when
-     * their class names are equal.
-     *
-     * @see java.lang.Object#equals(java.lang.Object)
+     * @param superclassName .
      */
-    @Override
-    public boolean equals( final Object obj ) {
-        return bcelComparator.equals(this, obj);
+    public void setSuperclassName( final String superclassName ) {
+        this.superclassName = superclassName;
     }
 
 
     /**
-     * Return the natural ordering of two JavaClasses.
-     * This ordering is based on the class name
-     * @since 6.0
+     * @param superclassNameIndex .
      */
-    @Override
-    public int compareTo( final JavaClass obj ) {
-        return getClassName().compareTo(obj.getClassName());
+    public void setSuperclassNameIndex( final int superclassNameIndex ) {
+        this.superclassNameIndex = superclassNameIndex;
     }
 
 
     /**
-     * Return value as defined by given BCELComparator strategy.
-     * By default return the hashcode of the class name.
-     *
-     * @see java.lang.Object#hashCode()
+     * @return String representing class contents.
      */
     @Override
-    public int hashCode() {
-        return bcelComparator.hashCode(this);
+    public String toString() {
+        String access = Utility.accessToString(super.getAccessFlags(), true);
+        access = access.isEmpty() ? "" : access + " ";
+        final StringBuilder buf = new StringBuilder(128);
+        buf.append(access).append(Utility.classOrInterface(super.getAccessFlags())).append(" ").append(
+                className).append(" extends ").append(
+                Utility.compactClassName(superclassName, false)).append('\n');
+        final int size = interfaces.length;
+        if (size > 0) {
+            buf.append("implements\t\t");
+            for (int i = 0; i < size; i++) {
+                buf.append(interfaceNames[i]);
+                if (i < size - 1) {
+                    buf.append(", ");
+                }
+            }
+            buf.append('\n');
+        }
+        buf.append("file name\t\t").append(fileName).append('\n');
+        buf.append("compiled from\t\t").append(sourceFileName).append('\n');
+        buf.append("compiler version\t").append(major).append(".").append(minor).append('\n');
+        buf.append("access flags\t\t").append(super.getAccessFlags()).append('\n');
+        buf.append("constant pool\t\t").append(constantPool.getLength()).append(" entries\n");
+        buf.append("ACC_SUPER flag\t\t").append(isSuper()).append("\n");
+        if (attributes.length > 0) {
+            buf.append("\nAttribute(s):\n");
+            for (final Attribute attribute : attributes) {
+                buf.append(indent(attribute));
+            }
+        }
+        final AnnotationEntry[] annotations = getAnnotationEntries();
+        if (annotations!=null && annotations.length>0) {
+            buf.append("\nAnnotation(s):\n");
+            for (final AnnotationEntry annotation : annotations) {
+                buf.append(indent(annotation));
+            }
+        }
+        if (fields.length > 0) {
+            buf.append("\n").append(fields.length).append(" fields:\n");
+            for (final Field field : fields) {
+                buf.append("\t").append(field).append('\n');
+            }
+        }
+        if (methods.length > 0) {
+            buf.append("\n").append(methods.length).append(" methods:\n");
+            for (final Method method : methods) {
+                buf.append("\t").append(method).append('\n');
+            }
+        }
+        return buf.toString();
     }
 }
diff --git a/src/main/java/org/apache/bcel/classfile/LineNumber.java b/src/main/java/org/apache/bcel/classfile/LineNumber.java
index 24c4b02f..beba17ba 100644
--- a/src/main/java/org/apache/bcel/classfile/LineNumber.java
+++ b/src/main/java/org/apache/bcel/classfile/LineNumber.java
@@ -36,16 +36,6 @@ public final class LineNumber implements Cloneable, Node {
     /** number in source file */
     private short lineNumber;
 
-    /**
-     * Initialize from another object.
-     *
-     * @param c the object to copy
-     */
-    public LineNumber(final LineNumber c) {
-        this(c.getStartPC(), c.getLineNumber());
-    }
-
-
     /**
      * Construct object from file stream.
      *
@@ -67,6 +57,16 @@ public final class LineNumber implements Cloneable, Node {
     }
 
 
+    /**
+     * Initialize from another object.
+     *
+     * @param c the object to copy
+     */
+    public LineNumber(final LineNumber c) {
+        this(c.getStartPC(), c.getLineNumber());
+    }
+
+
     /**
      * 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,
@@ -80,6 +80,19 @@ public final class LineNumber implements Cloneable, Node {
     }
 
 
+    /**
+     * @return deep copy of this object
+     */
+    public LineNumber copy() {
+        try {
+            return (LineNumber) clone();
+        } catch (final CloneNotSupportedException e) {
+            // TODO should this throw?
+        }
+        return null;
+    }
+
+
     /**
      * Dump line number/pc pair to file stream in binary format.
      *
@@ -131,17 +144,4 @@ public final class LineNumber implements Cloneable, Node {
     public String toString() {
         return "LineNumber(" + getStartPC() + ", " + getLineNumber() + ")";
     }
-
-
-    /**
-     * @return deep copy of this object
-     */
-    public LineNumber copy() {
-        try {
-            return (LineNumber) clone();
-        } catch (final CloneNotSupportedException e) {
-            // TODO should this throw?
-        }
-        return null;
-    }
 }
diff --git a/src/main/java/org/apache/bcel/classfile/LineNumberTable.java b/src/main/java/org/apache/bcel/classfile/LineNumberTable.java
index 5ad08c94..7963ddb7 100644
--- a/src/main/java/org/apache/bcel/classfile/LineNumberTable.java
+++ b/src/main/java/org/apache/bcel/classfile/LineNumberTable.java
@@ -37,12 +37,22 @@ public final class LineNumberTable extends Attribute {
     private LineNumber[] lineNumberTable; // Table of line/numbers pairs
 
 
-    /*
-     * Initialize from another object. Note that both objects use the same
-     * references (shallow copy). Use copy() for a physical copy.
+    /**
+     * Construct object from input stream.
+     * @param name_index Index of name
+     * @param length Content length in bytes
+     * @param input Input stream
+     * @param constant_pool Array of constants
+     * @throws IOException if an I/O Exception occurs in readUnsignedShort
      */
-    public LineNumberTable(final LineNumberTable c) {
-        this(c.getNameIndex(), c.getLength(), c.getLineNumberTable(), c.getConstantPool());
+    LineNumberTable(final int name_index, final int length, final DataInput input, final ConstantPool constant_pool)
+            throws IOException {
+        this(name_index, length, (LineNumber[]) null, constant_pool);
+        final int line_number_table_length = input.readUnsignedShort();
+        lineNumberTable = new LineNumber[line_number_table_length];
+        for (int i = 0; i < line_number_table_length; i++) {
+            lineNumberTable[i] = new LineNumber(input);
+        }
     }
 
 
@@ -59,22 +69,12 @@ public final class LineNumberTable extends Attribute {
     }
 
 
-    /**
-     * Construct object from input stream.
-     * @param name_index Index of name
-     * @param length Content length in bytes
-     * @param input Input stream
-     * @param constant_pool Array of constants
-     * @throws IOException if an I/O Exception occurs in readUnsignedShort
+    /*
+     * Initialize from another object. Note that both objects use the same
+     * references (shallow copy). Use copy() for a physical copy.
      */
-    LineNumberTable(final int name_index, final int length, final DataInput input, final ConstantPool constant_pool)
-            throws IOException {
-        this(name_index, length, (LineNumber[]) null, constant_pool);
-        final int line_number_table_length = input.readUnsignedShort();
-        lineNumberTable = new LineNumber[line_number_table_length];
-        for (int i = 0; i < line_number_table_length; i++) {
-            lineNumberTable[i] = new LineNumber(input);
-        }
+    public LineNumberTable(final LineNumberTable c) {
+        this(c.getNameIndex(), c.getLength(), c.getLineNumberTable(), c.getConstantPool());
     }
 
 
@@ -91,6 +91,23 @@ public final class LineNumberTable extends Attribute {
     }
 
 
+    /**
+     * @return deep copy of this attribute
+     */
+    @Override
+    public Attribute copy( final ConstantPool _constant_pool ) {
+        // TODO could use the lower level constructor and thereby allow
+        // lineNumberTable to be made final
+        final LineNumberTable c = (LineNumberTable) clone();
+        c.lineNumberTable = new LineNumber[lineNumberTable.length];
+        for (int i = 0; i < lineNumberTable.length; i++) {
+            c.lineNumberTable[i] = lineNumberTable[i].copy();
+        }
+        c.setConstantPool(_constant_pool);
+        return c;
+    }
+
+
     /**
      * Dump line number table attribute to file stream in binary format.
      *
@@ -115,38 +132,6 @@ public final class LineNumberTable extends Attribute {
     }
 
 
-    /**
-     * @param lineNumberTable the line number entries for this table
-     */
-    public void setLineNumberTable( final LineNumber[] lineNumberTable ) {
-        this.lineNumberTable = lineNumberTable;
-    }
-
-
-    /**
-     * @return String representation.
-     */
-    @Override
-    public String toString() {
-        final StringBuilder buf = new StringBuilder();
-        final StringBuilder line = new StringBuilder();
-        final String newLine = System.getProperty("line.separator", "\n");
-        for (int i = 0; i < lineNumberTable.length; i++) {
-            line.append(lineNumberTable[i].toString());
-            if (i < lineNumberTable.length - 1) {
-                line.append(", ");
-            }
-            if (line.length() > MAX_LINE_LENGTH && i < lineNumberTable.length - 1) {
-                line.append(newLine);
-                buf.append(line);
-                line.setLength(0);
-            }
-        }
-        buf.append(line);
-        return buf.toString();
-    }
-
-
     /**
      * Map byte code positions to source code lines.
      *
@@ -193,24 +178,39 @@ public final class LineNumberTable extends Attribute {
     }
 
 
+    public int getTableLength() {
+        return lineNumberTable == null ? 0 : lineNumberTable.length;
+    }
+
+
     /**
-     * @return deep copy of this attribute
+     * @param lineNumberTable the line number entries for this table
      */
-    @Override
-    public Attribute copy( final ConstantPool _constant_pool ) {
-        // TODO could use the lower level constructor and thereby allow
-        // lineNumberTable to be made final
-        final LineNumberTable c = (LineNumberTable) clone();
-        c.lineNumberTable = new LineNumber[lineNumberTable.length];
-        for (int i = 0; i < lineNumberTable.length; i++) {
-            c.lineNumberTable[i] = lineNumberTable[i].copy();
-        }
-        c.setConstantPool(_constant_pool);
-        return c;
+    public void setLineNumberTable( final LineNumber[] lineNumberTable ) {
+        this.lineNumberTable = lineNumberTable;
     }
 
 
-    public int getTableLength() {
-        return lineNumberTable == null ? 0 : lineNumberTable.length;
+    /**
+     * @return String representation.
+     */
+    @Override
+    public String toString() {
+        final StringBuilder buf = new StringBuilder();
+        final StringBuilder line = new StringBuilder();
+        final String newLine = System.getProperty("line.separator", "\n");
+        for (int i = 0; i < lineNumberTable.length; i++) {
+            line.append(lineNumberTable[i].toString());
+            if (i < lineNumberTable.length - 1) {
+                line.append(", ");
+            }
+            if (line.length() > MAX_LINE_LENGTH && i < lineNumberTable.length - 1) {
+                line.append(newLine);
+                buf.append(line);
+                line.setLength(0);
+            }
+        }
+        buf.append(line);
+        return buf.toString();
     }
 }
diff --git a/src/main/java/org/apache/bcel/classfile/LocalVariable.java b/src/main/java/org/apache/bcel/classfile/LocalVariable.java
index 74538559..2963cd6c 100644
--- a/src/main/java/org/apache/bcel/classfile/LocalVariable.java
+++ b/src/main/java/org/apache/bcel/classfile/LocalVariable.java
@@ -52,18 +52,6 @@ public final class LocalVariable implements Cloneable, Node, Constants {
     private int origIndex; // never changes; used to match up with LocalVariableTypeTable entries
 
 
-    /**
-     * Initializes from another LocalVariable. Note that both objects use the same
-     * references (shallow copy). Use copy() for a physical copy.
-     *
-     * @param localVariable Another LocalVariable.
-     */
-    public LocalVariable(final LocalVariable localVariable) {
-        this(localVariable.getStartPC(), localVariable.getLength(), localVariable.getNameIndex(),
-                localVariable.getSignatureIndex(), localVariable.getIndex(), localVariable.getConstantPool());
-        this.origIndex = localVariable.getOrigIndex();
-    }
-
     /**
      * Constructs object from file stream.
      * @param file Input stream
@@ -74,7 +62,6 @@ public final class LocalVariable implements Cloneable, Node, Constants {
                 .readUnsignedShort(), file.readUnsignedShort(), constant_pool);
     }
 
-
     /**
      * @param startPc Range in which the variable
      * @param length ... is valid
@@ -116,6 +103,19 @@ public final class LocalVariable implements Cloneable, Node, Constants {
     }
 
 
+    /**
+     * Initializes from another LocalVariable. Note that both objects use the same
+     * references (shallow copy). Use copy() for a physical copy.
+     *
+     * @param localVariable Another LocalVariable.
+     */
+    public LocalVariable(final LocalVariable localVariable) {
+        this(localVariable.getStartPC(), localVariable.getLength(), localVariable.getNameIndex(),
+                localVariable.getSignatureIndex(), localVariable.getIndex(), localVariable.getConstantPool());
+        this.origIndex = localVariable.getOrigIndex();
+    }
+
+
     /**
      * 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,
@@ -129,6 +129,18 @@ public final class LocalVariable implements Cloneable, Node, Constants {
     }
 
 
+    /**
+     * @return deep copy of this object
+     */
+    public LocalVariable copy() {
+        try {
+            return (LocalVariable) clone();
+        } catch (final CloneNotSupportedException e) {
+            // TODO should this throw?
+        }
+        return null;
+    }
+
     /**
      * Dumps local variable to file stream in binary format.
      *
@@ -144,6 +156,7 @@ public final class LocalVariable implements Cloneable, Node, Constants {
         dataOutputStream.writeShort(index);
     }
 
+
     /**
      * @return Constant pool used by this object.
      */
@@ -152,6 +165,14 @@ public final class LocalVariable implements Cloneable, Node, Constants {
     }
 
 
+    /**
+     * @return index of register where variable is stored
+     */
+    public int getIndex() {
+        return index;
+    }
+
+
     /**
      * @return Variable is valid within getStartPC() .. getStartPC()+getLength()
      */
@@ -178,6 +199,14 @@ public final class LocalVariable implements Cloneable, Node, Constants {
     }
 
 
+    /**
+     * @return index of register where variable was originally stored
+     */
+    public int getOrigIndex() {
+        return origIndex;
+    }
+
+
     /**
      * @return Signature.
      */
@@ -196,22 +225,6 @@ public final class LocalVariable implements Cloneable, Node, Constants {
     }
 
 
-    /**
-     * @return index of register where variable is stored
-     */
-    public int getIndex() {
-        return index;
-    }
-
-
-    /**
-     * @return index of register where variable was originally stored
-     */
-    public int getOrigIndex() {
-        return origIndex;
-    }
-
-
     /**
      * @return Start of range where the variable is valid
      */
@@ -220,23 +233,19 @@ public final class LocalVariable implements Cloneable, Node, Constants {
     }
 
 
-    /*
-     * Helper method shared with LocalVariableTypeTable
+    /**
+     * @param constantPool Constant pool to be used for this object.
      */
-    String toStringShared( final boolean typeTable ) {
-        final String name = getName();
-        final String signature = Utility.signatureToString(getSignature(), false);
-        final String label = "LocalVariable" + (typeTable ? "Types" : "" );
-        return label + "(startPc = " + startPc + ", length = " + length + ", index = "
-                + index + ":" + signature + " " + name + ")";
+    public void setConstantPool( final ConstantPool constantPool ) {
+        this.constantPool = constantPool;
     }
 
 
     /**
-     * @param constantPool Constant pool to be used for this object.
+     * @param index the index in the local variable table of this variable
      */
-    public void setConstantPool( final ConstantPool constantPool ) {
-        this.constantPool = constantPool;
+    public void setIndex( final int index ) { // TODO unused
+        this.index = index;
     }
 
 
@@ -264,14 +273,6 @@ public final class LocalVariable implements Cloneable, Node, Constants {
     }
 
 
-    /**
-     * @param index the index in the local variable table of this variable
-     */
-    public void setIndex( final int index ) { // TODO unused
-        this.index = index;
-    }
-
-
     /**
      * @param startPc Specify range where the local variable is valid.
      */
@@ -289,15 +290,14 @@ public final class LocalVariable implements Cloneable, Node, Constants {
     }
 
 
-    /**
-     * @return deep copy of this object
+    /*
+     * Helper method shared with LocalVariableTypeTable
      */
-    public LocalVariable copy() {
-        try {
-            return (LocalVariable) clone();
-        } catch (final CloneNotSupportedException e) {
-            // TODO should this throw?
-        }
-        return null;
+    String toStringShared( final boolean typeTable ) {
+        final String name = getName();
+        final String signature = Utility.signatureToString(getSignature(), false);
+        final String label = "LocalVariable" + (typeTable ? "Types" : "" );
+        return label + "(startPc = " + startPc + ", length = " + length + ", index = "
+                + index + ":" + signature + " " + name + ")";
     }
 }
diff --git a/src/main/java/org/apache/bcel/classfile/LocalVariableTable.java b/src/main/java/org/apache/bcel/classfile/LocalVariableTable.java
index 6e32a9e3..8fa6767c 100644
--- a/src/main/java/org/apache/bcel/classfile/LocalVariableTable.java
+++ b/src/main/java/org/apache/bcel/classfile/LocalVariableTable.java
@@ -36,11 +36,21 @@ public class LocalVariableTable extends Attribute {
 
 
     /**
-     * Initialize from another object. Note that both objects use the same
-     * references (shallow copy). Use copy() for a physical copy.
+     * Construct object from input stream.
+     * @param name_index Index in constant pool
+     * @param length Content length in bytes
+     * @param input Input stream
+     * @param constant_pool Array of constants
+     * @throws IOException
      */
-    public LocalVariableTable(final LocalVariableTable c) {
-        this(c.getNameIndex(), c.getLength(), c.getLocalVariableTable(), c.getConstantPool());
+    LocalVariableTable(final int name_index, final int length, final DataInput input, final ConstantPool constant_pool)
+            throws IOException {
+        this(name_index, length, (LocalVariable[]) null, constant_pool);
+        final int local_variable_table_length = input.readUnsignedShort();
+        localVariableTable = new LocalVariable[local_variable_table_length];
+        for (int i = 0; i < local_variable_table_length; i++) {
+            localVariableTable[i] = new LocalVariable(input, constant_pool);
+        }
     }
 
 
@@ -58,21 +68,11 @@ public class LocalVariableTable extends Attribute {
 
 
     /**
-     * Construct object from input stream.
-     * @param name_index Index in constant pool
-     * @param length Content length in bytes
-     * @param input Input stream
-     * @param constant_pool Array of constants
-     * @throws IOException
+     * Initialize from another object. Note that both objects use the same
+     * references (shallow copy). Use copy() for a physical copy.
      */
-    LocalVariableTable(final int name_index, final int length, final DataInput input, final ConstantPool constant_pool)
-            throws IOException {
-        this(name_index, length, (LocalVariable[]) null, constant_pool);
-        final int local_variable_table_length = input.readUnsignedShort();
-        localVariableTable = new LocalVariable[local_variable_table_length];
-        for (int i = 0; i < local_variable_table_length; i++) {
-            localVariableTable[i] = new LocalVariable(input, constant_pool);
-        }
+    public LocalVariableTable(final LocalVariableTable c) {
+        this(c.getNameIndex(), c.getLength(), c.getLocalVariableTable(), c.getConstantPool());
     }
 
 
@@ -89,6 +89,21 @@ public class LocalVariableTable extends Attribute {
     }
 
 
+    /**
+     * @return deep copy of this attribute
+     */
+    @Override
+    public Attribute copy( final ConstantPool _constant_pool ) {
+        final LocalVariableTable c = (LocalVariableTable) clone();
+        c.localVariableTable = new LocalVariable[localVariableTable.length];
+        for (int i = 0; i < localVariableTable.length; i++) {
+            c.localVariableTable[i] = localVariableTable[i].copy();
+        }
+        c.setConstantPool(_constant_pool);
+        return c;
+    }
+
+
     /**
      * Dump local variable table attribute to file stream in binary format.
      *
@@ -105,14 +120,6 @@ public class LocalVariableTable extends Attribute {
     }
 
 
-    /**
-     * @return Array of local variables of method.
-     */
-    public final LocalVariable[] getLocalVariableTable() {
-        return localVariableTable;
-    }
-
-
     /**
      *
      * @param index the variable slot
@@ -154,6 +161,19 @@ public class LocalVariableTable extends Attribute {
     }
 
 
+    /**
+     * @return Array of local variables of method.
+     */
+    public final LocalVariable[] getLocalVariableTable() {
+        return localVariableTable;
+    }
+
+
+    public final int getTableLength() {
+        return localVariableTable == null ? 0 : localVariableTable.length;
+    }
+
+
     public final void setLocalVariableTable( final LocalVariable[] local_variable_table ) {
         this.localVariableTable = local_variable_table;
     }
@@ -173,24 +193,4 @@ public class LocalVariableTable extends Attribute {
         }
         return buf.toString();
     }
-
-
-    /**
-     * @return deep copy of this attribute
-     */
-    @Override
-    public Attribute copy( final ConstantPool _constant_pool ) {
-        final LocalVariableTable c = (LocalVariableTable) clone();
-        c.localVariableTable = new LocalVariable[localVariableTable.length];
-        for (int i = 0; i < localVariableTable.length; i++) {
-            c.localVariableTable[i] = localVariableTable[i].copy();
-        }
-        c.setConstantPool(_constant_pool);
-        return c;
-    }
-
-
-    public final int getTableLength() {
-        return localVariableTable == null ? 0 : localVariableTable.length;
-    }
 }
diff --git a/src/main/java/org/apache/bcel/classfile/LocalVariableTypeTable.java b/src/main/java/org/apache/bcel/classfile/LocalVariableTypeTable.java
index afd1325e..a6edf3e4 100644
--- a/src/main/java/org/apache/bcel/classfile/LocalVariableTypeTable.java
+++ b/src/main/java/org/apache/bcel/classfile/LocalVariableTypeTable.java
@@ -58,15 +58,6 @@ public class LocalVariableTypeTable extends Attribute {
 
     private LocalVariable[] localVariableTypeTable;        // variables
 
-    public LocalVariableTypeTable(final LocalVariableTypeTable c) {
-        this(c.getNameIndex(), c.getLength(), c.getLocalVariableTypeTable(), c.getConstantPool());
-    }
-
-    public LocalVariableTypeTable(final int name_index, final int length, final LocalVariable[] local_variable_table, final ConstantPool constant_pool) {
-        super(Const.ATTR_LOCAL_VARIABLE_TYPE_TABLE, name_index, length, constant_pool);
-        this.localVariableTypeTable = local_variable_table;
-    }
-
     LocalVariableTypeTable(final int nameIdx, final int len, final DataInput input, final ConstantPool cpool) throws IOException {
         this(nameIdx, len, (LocalVariable[]) null, cpool);
 
@@ -78,11 +69,36 @@ public class LocalVariableTypeTable extends Attribute {
         }
     }
 
+    public LocalVariableTypeTable(final int name_index, final int length, final LocalVariable[] local_variable_table, final ConstantPool constant_pool) {
+        super(Const.ATTR_LOCAL_VARIABLE_TYPE_TABLE, name_index, length, constant_pool);
+        this.localVariableTypeTable = local_variable_table;
+    }
+
+    public LocalVariableTypeTable(final LocalVariableTypeTable c) {
+        this(c.getNameIndex(), c.getLength(), c.getLocalVariableTypeTable(), c.getConstantPool());
+    }
+
     @Override
     public void accept(final Visitor v) {
         v.visitLocalVariableTypeTable(this);
     }
 
+    /**
+     * @return deep copy of this attribute
+     */
+    @Override
+    public Attribute copy(final ConstantPool constant_pool) {
+        final LocalVariableTypeTable c = (LocalVariableTypeTable) clone();
+
+        c.localVariableTypeTable = new LocalVariable[localVariableTypeTable.length];
+        for (int i = 0; i < localVariableTypeTable.length; i++) {
+            c.localVariableTypeTable[i] = localVariableTypeTable[i].copy();
+        }
+
+        c.setConstantPool(constant_pool);
+        return c;
+    }
+
     @Override
     public final void dump(final DataOutputStream file) throws IOException {
         super.dump(file);
@@ -92,10 +108,6 @@ public class LocalVariableTypeTable extends Attribute {
         }
     }
 
-    public final LocalVariable[] getLocalVariableTypeTable() {
-        return localVariableTypeTable;
-    }
-
     public final LocalVariable getLocalVariable(final int index) {
         for (final LocalVariable variable : localVariableTypeTable) {
             if (variable.getIndex() == index) {
@@ -106,6 +118,14 @@ public class LocalVariableTypeTable extends Attribute {
         return null;
     }
 
+    public final LocalVariable[] getLocalVariableTypeTable() {
+        return localVariableTypeTable;
+    }
+
+    public final int getTableLength() {
+        return localVariableTypeTable == null ? 0 : localVariableTypeTable.length;
+    }
+
     public final void setLocalVariableTable(final LocalVariable[] local_variable_table) {
         this.localVariableTypeTable = local_variable_table;
     }
@@ -127,24 +147,4 @@ public class LocalVariableTypeTable extends Attribute {
 
         return buf.toString();
     }
-
-    /**
-     * @return deep copy of this attribute
-     */
-    @Override
-    public Attribute copy(final ConstantPool constant_pool) {
-        final LocalVariableTypeTable c = (LocalVariableTypeTable) clone();
-
-        c.localVariableTypeTable = new LocalVariable[localVariableTypeTable.length];
-        for (int i = 0; i < localVariableTypeTable.length; i++) {
-            c.localVariableTypeTable[i] = localVariableTypeTable[i].copy();
-        }
-
-        c.setConstantPool(constant_pool);
-        return c;
-    }
-
-    public final int getTableLength() {
-        return localVariableTypeTable == null ? 0 : localVariableTypeTable.length;
-    }
 }
diff --git a/src/main/java/org/apache/bcel/classfile/Method.java b/src/main/java/org/apache/bcel/classfile/Method.java
index f9779082..1b3010b6 100644
--- a/src/main/java/org/apache/bcel/classfile/Method.java
+++ b/src/main/java/org/apache/bcel/classfile/Method.java
@@ -58,28 +58,35 @@ public final class Method extends FieldOrMethod {
         }
     };
 
-    // annotations defined on the parameters of a method
-    private ParameterAnnotationEntry[] parameterAnnotationEntries;
-
     /**
      * Empty array.
      */
     static final Method[] EMPTY_METHOD_ARRAY = {};
 
     /**
-     * Empty constructor, all attributes have to be defined via `setXXX'
-     * methods. Use at your own risk.
+     * @return Comparison strategy object
      */
-    public Method() {
+    public static BCELComparator getComparator() {
+        return bcelComparator;
     }
 
+    /**
+     * @param comparator Comparison strategy object
+     */
+    public static void setComparator( final BCELComparator comparator ) {
+        bcelComparator = comparator;
+    }
+
+
+    // annotations defined on the parameters of a method
+    private ParameterAnnotationEntry[] parameterAnnotationEntries;
+
 
     /**
-     * Initialize from another object. Note that both objects use the same
-     * references (shallow copy). Use clone() for a physical copy.
+     * Empty constructor, all attributes have to be defined via `setXXX'
+     * methods. Use at your own risk.
      */
-    public Method(final Method c) {
-        super(c);
+    public Method() {
     }
 
 
@@ -108,6 +115,15 @@ public final class Method extends FieldOrMethod {
     }
 
 
+    /**
+     * Initialize from another object. Note that both objects use the same
+     * references (shallow copy). Use clone() for a physical copy.
+     */
+    public Method(final Method c) {
+        super(c);
+    }
+
+
     /**
      * 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,
@@ -121,6 +137,35 @@ public final class Method extends FieldOrMethod {
     }
 
 
+    /**
+     * @return deep copy of this method
+     */
+    public Method copy( final ConstantPool _constant_pool ) {
+        return (Method) copy_(_constant_pool);
+    }
+
+
+    /**
+     * Return value as defined by given BCELComparator strategy.
+     * By default two method objects are said to be equal when
+     * their names and signatures are equal.
+     *
+     * @see java.lang.Object#equals(java.lang.Object)
+     */
+    @Override
+    public boolean equals( final Object obj ) {
+        return bcelComparator.equals(this, obj);
+    }
+
+
+    /**
+     * @return array of method argument types
+     */
+    public Type[] getArgumentTypes() {
+        return Type.getArgumentTypes(getSignature());
+    }
+
+
     /**
      * @return Code attribute of method, if any
      */
@@ -148,30 +193,61 @@ public final class Method extends FieldOrMethod {
     }
 
 
-    /** @return LocalVariableTable of code attribute if any, i.e. the call is forwarded
+    /** @return LineNumberTable of code attribute if any, i.e. the call is forwarded
      * to the Code atribute.
      */
-    public LocalVariableTable getLocalVariableTable() {
+    public LineNumberTable getLineNumberTable() {
         final Code code = getCode();
         if (code == null) {
             return null;
         }
-        return code.getLocalVariableTable();
+        return code.getLineNumberTable();
     }
 
 
-    /** @return LineNumberTable of code attribute if any, i.e. the call is forwarded
+    /** @return LocalVariableTable of code attribute if any, i.e. the call is forwarded
      * to the Code atribute.
      */
-    public LineNumberTable getLineNumberTable() {
+    public LocalVariableTable getLocalVariableTable() {
         final Code code = getCode();
         if (code == null) {
             return null;
         }
-        return code.getLineNumberTable();
+        return code.getLocalVariableTable();
+    }
+
+
+    /**
+     * @return Annotations on the parameters of a method
+     * @since 6.0
+     */
+    public ParameterAnnotationEntry[] getParameterAnnotationEntries() {
+        if (parameterAnnotationEntries == null) {
+            parameterAnnotationEntries = ParameterAnnotationEntry.createParameterAnnotationEntries(getAttributes());
+        }
+        return parameterAnnotationEntries;
+    }
+
+
+    /**
+     * @return return type of method
+     */
+    public Type getReturnType() {
+        return Type.getReturnType(getSignature());
     }
 
 
+    /**
+     * Return value as defined by given BCELComparator strategy.
+     * By default return the hashcode of the method's name XOR signature.
+     *
+     * @see java.lang.Object#hashCode()
+     */
+    @Override
+    public int hashCode() {
+        return bcelComparator.hashCode(this);
+    }
+
     /**
      * Return string representation close to declaration format,
      * `public static void main(String[] args) throws IOException', e.g.
@@ -203,80 +279,4 @@ public final class Method extends FieldOrMethod {
         }
         return buf.toString();
     }
-
-
-    /**
-     * @return deep copy of this method
-     */
-    public Method copy( final ConstantPool _constant_pool ) {
-        return (Method) copy_(_constant_pool);
-    }
-
-
-    /**
-     * @return return type of method
-     */
-    public Type getReturnType() {
-        return Type.getReturnType(getSignature());
-    }
-
-
-    /**
-     * @return array of method argument types
-     */
-    public Type[] getArgumentTypes() {
-        return Type.getArgumentTypes(getSignature());
-    }
-
-
-    /**
-     * @return Comparison strategy object
-     */
-    public static BCELComparator getComparator() {
-        return bcelComparator;
-    }
-
-
-    /**
-     * @param comparator Comparison strategy object
-     */
-    public static void setComparator( final BCELComparator comparator ) {
-        bcelComparator = comparator;
-    }
-
-
-    /**
-     * Return value as defined by given BCELComparator strategy.
-     * By default two method objects are said to be equal when
-     * their names and signatures are equal.
-     *
-     * @see java.lang.Object#equals(java.lang.Object)
-     */
-    @Override
-    public boolean equals( final Object obj ) {
-        return bcelComparator.equals(this, obj);
-    }
-
-
-    /**
-     * Return value as defined by given BCELComparator strategy.
-     * By default return the hashcode of the method's name XOR signature.
-     *
-     * @see java.lang.Object#hashCode()
-     */
-    @Override
-    public int hashCode() {
-        return bcelComparator.hashCode(this);
-    }
-
-    /**
-     * @return Annotations on the parameters of a method
-     * @since 6.0
-     */
-    public ParameterAnnotationEntry[] getParameterAnnotationEntries() {
-        if (parameterAnnotationEntries == null) {
-            parameterAnnotationEntries = ParameterAnnotationEntry.createParameterAnnotationEntries(getAttributes());
-        }
-        return parameterAnnotationEntries;
-    }
 }
diff --git a/src/main/java/org/apache/bcel/classfile/MethodParameter.java b/src/main/java/org/apache/bcel/classfile/MethodParameter.java
index c3f448aa..04882434 100644
--- a/src/main/java/org/apache/bcel/classfile/MethodParameter.java
+++ b/src/main/java/org/apache/bcel/classfile/MethodParameter.java
@@ -53,12 +53,39 @@ public class MethodParameter implements Cloneable {
         accessFlags = input.readUnsignedShort();
     }
 
-    public int getNameIndex() {
-        return nameIndex;
+    public void accept(final Visitor v) {
+        v.visitMethodParameter(this);
     }
 
-    public void setNameIndex(final int name_index) {
-        this.nameIndex = name_index;
+    /**
+     * @return deep copy of this object
+     */
+    public MethodParameter copy() {
+        try {
+            return (MethodParameter) clone();
+        } catch (final CloneNotSupportedException e) {
+            // TODO should this throw?
+        }
+        return null;
+    }
+
+    /**
+     * Dump object to file stream on binary format.
+     *
+     * @param file Output file stream
+     * @throws IOException
+     */
+    public final void dump(final DataOutputStream file) throws IOException {
+        file.writeShort(nameIndex);
+        file.writeShort(accessFlags);
+    }
+
+    public int getAccessFlags() {
+        return accessFlags;
+    }
+
+    public int getNameIndex() {
+        return nameIndex;
     }
 
     /**
@@ -71,50 +98,23 @@ public class MethodParameter implements Cloneable {
         return ((ConstantUtf8) constant_pool.getConstant(nameIndex, Const.CONSTANT_Utf8)).getBytes();
        }
 
-    public int getAccessFlags() {
-        return accessFlags;
-    }
-
-    public void setAccessFlags(final int access_flags) {
-        this.accessFlags = access_flags;
-    }
-
     public boolean isFinal() {
         return (accessFlags & Const.ACC_FINAL) != 0;
     }
 
-    public boolean isSynthetic() {
-        return (accessFlags & Const.ACC_SYNTHETIC) != 0;
-    }
-
     public boolean isMandated() {
         return (accessFlags & Const.ACC_MANDATED) != 0;
     }
 
-    public void accept(final Visitor v) {
-        v.visitMethodParameter(this);
+    public boolean isSynthetic() {
+        return (accessFlags & Const.ACC_SYNTHETIC) != 0;
     }
 
-    /**
-     * Dump object to file stream on binary format.
-     *
-     * @param file Output file stream
-     * @throws IOException
-     */
-    public final void dump(final DataOutputStream file) throws IOException {
-        file.writeShort(nameIndex);
-        file.writeShort(accessFlags);
+    public void setAccessFlags(final int access_flags) {
+        this.accessFlags = access_flags;
     }
 
-    /**
-     * @return deep copy of this object
-     */
-    public MethodParameter copy() {
-        try {
-            return (MethodParameter) clone();
-        } catch (final CloneNotSupportedException e) {
-            // TODO should this throw?
-        }
-        return null;
+    public void setNameIndex(final int name_index) {
+        this.nameIndex = name_index;
     }
 }
diff --git a/src/main/java/org/apache/bcel/classfile/MethodParameters.java b/src/main/java/org/apache/bcel/classfile/MethodParameters.java
index 684af814..5655fab9 100644
--- a/src/main/java/org/apache/bcel/classfile/MethodParameters.java
+++ b/src/main/java/org/apache/bcel/classfile/MethodParameters.java
@@ -49,14 +49,6 @@ public class MethodParameters extends Attribute {
         }
     }
 
-    public MethodParameter[] getParameters() {
-        return parameters;
-    }
-
-    public void setParameters(final MethodParameter[] parameters) {
-        this.parameters = parameters;
-    }
-
     @Override
     public void accept(final Visitor v) {
         v.visitMethodParameters(this);
@@ -88,4 +80,12 @@ public class MethodParameters extends Attribute {
             parameter.dump(file);
         }
     }
+
+    public MethodParameter[] getParameters() {
+        return parameters;
+    }
+
+    public void setParameters(final MethodParameter[] parameters) {
+        this.parameters = parameters;
+    }
 }
diff --git a/src/main/java/org/apache/bcel/classfile/Module.java b/src/main/java/org/apache/bcel/classfile/Module.java
index 0e1330e1..76cbd77f 100644
--- a/src/main/java/org/apache/bcel/classfile/Module.java
+++ b/src/main/java/org/apache/bcel/classfile/Module.java
@@ -105,38 +105,34 @@ public final class Module extends Attribute {
     // TODO add more getters and setters?
 
     /**
-     * @return table of required modules
-     * @see ModuleRequires
+     * @return deep copy of this attribute
      */
-    public ModuleRequires[] getRequiresTable() {
-        return requiresTable;
-    }
-
+    @Override
+    public Attribute copy( final ConstantPool _constant_pool ) {
+        final Module c = (Module) clone();
 
-    /**
-     * @return table of exported interfaces
-     * @see ModuleExports
-     */
-    public ModuleExports[] getExportsTable() {
-        return exportsTable;
-    }
+        c.requiresTable = new ModuleRequires[requiresTable.length];
+        for (int i = 0; i < requiresTable.length; i++) {
+            c.requiresTable[i] = requiresTable[i].copy();
+        }
 
+        c.exportsTable = new ModuleExports[exportsTable.length];
+        for (int i = 0; i < exportsTable.length; i++) {
+            c.exportsTable[i] = exportsTable[i].copy();
+        }
 
-    /**
-     * @return table of provided interfaces
-     * @see ModuleOpens
-     */
-    public ModuleOpens[] getOpensTable() {
-        return opensTable;
-    }
+        c.opensTable = new ModuleOpens[opensTable.length];
+        for (int i = 0; i < opensTable.length; i++) {
+            c.opensTable[i] = opensTable[i].copy();
+        }
 
+        c.providesTable = new ModuleProvides[providesTable.length];
+        for (int i = 0; i < providesTable.length; i++) {
+            c.providesTable[i] = providesTable[i].copy();
+        }
 
-    /**
-     * @return table of provided interfaces
-     * @see ModuleProvides
-     */
-    public ModuleProvides[] getProvidesTable() {
-        return providesTable;
+        c.setConstantPool(_constant_pool);
+        return c;
     }
 
 
@@ -181,6 +177,42 @@ public final class Module extends Attribute {
     }
 
 
+    /**
+     * @return table of exported interfaces
+     * @see ModuleExports
+     */
+    public ModuleExports[] getExportsTable() {
+        return exportsTable;
+    }
+
+
+    /**
+     * @return table of provided interfaces
+     * @see ModuleOpens
+     */
+    public ModuleOpens[] getOpensTable() {
+        return opensTable;
+    }
+
+
+    /**
+     * @return table of provided interfaces
+     * @see ModuleProvides
+     */
+    public ModuleProvides[] getProvidesTable() {
+        return providesTable;
+    }
+
+
+    /**
+     * @return table of required modules
+     * @see ModuleRequires
+     */
+    public ModuleRequires[] getRequiresTable() {
+        return requiresTable;
+    }
+
+
     /**
      * @return String representation, i.e., a list of packages.
      */
@@ -222,36 +254,4 @@ public final class Module extends Attribute {
 
         return buf.substring(0, buf.length()-1); // remove the last newline
     }
-
-
-    /**
-     * @return deep copy of this attribute
-     */
-    @Override
-    public Attribute copy( final ConstantPool _constant_pool ) {
-        final Module c = (Module) clone();
-
-        c.requiresTable = new ModuleRequires[requiresTable.length];
-        for (int i = 0; i < requiresTable.length; i++) {
-            c.requiresTable[i] = requiresTable[i].copy();
-        }
-
-        c.exportsTable = new ModuleExports[exportsTable.length];
-        for (int i = 0; i < exportsTable.length; i++) {
-            c.exportsTable[i] = exportsTable[i].copy();
-        }
-
-        c.opensTable = new ModuleOpens[opensTable.length];
-        for (int i = 0; i < opensTable.length; i++) {
-            c.opensTable[i] = opensTable[i].copy();
-        }
-
-        c.providesTable = new ModuleProvides[providesTable.length];
-        for (int i = 0; i < providesTable.length; i++) {
-            c.providesTable[i] = providesTable[i].copy();
-        }
-
-        c.setConstantPool(_constant_pool);
-        return c;
-    }
 }
diff --git a/src/main/java/org/apache/bcel/classfile/ModuleExports.java b/src/main/java/org/apache/bcel/classfile/ModuleExports.java
index 487671c1..9822b6fe 100644
--- a/src/main/java/org/apache/bcel/classfile/ModuleExports.java
+++ b/src/main/java/org/apache/bcel/classfile/ModuleExports.java
@@ -69,6 +69,19 @@ public final class ModuleExports implements Cloneable, Node {
 
     // TODO add more getters and setters?
 
+    /**
+     * @return deep copy of this object
+     */
+    public ModuleExports copy() {
+        try {
+            return (ModuleExports) clone();
+        } catch (final CloneNotSupportedException e) {
+            // TODO should this throw?
+        }
+        return null;
+    }
+
+
     /**
      * Dump table entry to file stream in binary format.
      *
@@ -109,17 +122,4 @@ public final class ModuleExports implements Cloneable, Node {
         }
         return buf.substring(0, buf.length()-1); // remove the last newline
     }
-
-
-    /**
-     * @return deep copy of this object
-     */
-    public ModuleExports copy() {
-        try {
-            return (ModuleExports) clone();
-        } catch (final CloneNotSupportedException e) {
-            // TODO should this throw?
-        }
-        return null;
-    }
 }
diff --git a/src/main/java/org/apache/bcel/classfile/ModuleMainClass.java b/src/main/java/org/apache/bcel/classfile/ModuleMainClass.java
index 6b69888c..c9dd9496 100644
--- a/src/main/java/org/apache/bcel/classfile/ModuleMainClass.java
+++ b/src/main/java/org/apache/bcel/classfile/ModuleMainClass.java
@@ -35,11 +35,16 @@ public final class ModuleMainClass extends Attribute {
 
 
     /**
-     * Initialize from another object. Note that both objects use the same
-     * references (shallow copy). Use copy() for a physical copy.
+     * Construct object from input stream.
+     * @param nameIndex Index in constant pool
+     * @param length Content length in bytes
+     * @param input Input stream
+     * @param constantPool Array of constants
+     * @throws IOException
      */
-    public ModuleMainClass(final ModuleMainClass c) {
-        this(c.getNameIndex(), c.getLength(), c.getHostClassIndex(), c.getConstantPool());
+    ModuleMainClass(final int nameIndex, final int length, final DataInput input, final ConstantPool constantPool) throws IOException {
+        this(nameIndex, length, 0, constantPool);
+        mainClassIndex = input.readUnsignedShort();
     }
 
 
@@ -57,16 +62,11 @@ public final class ModuleMainClass extends Attribute {
 
 
     /**
-     * Construct object from input stream.
-     * @param nameIndex Index in constant pool
-     * @param length Content length in bytes
-     * @param input Input stream
-     * @param constantPool Array of constants
-     * @throws IOException
+     * Initialize from another object. Note that both objects use the same
+     * references (shallow copy). Use copy() for a physical copy.
      */
-    ModuleMainClass(final int nameIndex, final int length, final DataInput input, final ConstantPool constantPool) throws IOException {
-        this(nameIndex, length, 0, constantPool);
-        mainClassIndex = input.readUnsignedShort();
+    public ModuleMainClass(final ModuleMainClass c) {
+        this(c.getNameIndex(), c.getLength(), c.getHostClassIndex(), c.getConstantPool());
     }
 
 
@@ -83,6 +83,17 @@ public final class ModuleMainClass extends Attribute {
     }
 
 
+    /**
+     * @return deep copy of this attribute
+     */
+    @Override
+    public Attribute copy( final ConstantPool _constant_pool ) {
+        final ModuleMainClass c = (ModuleMainClass) clone();
+        c.setConstantPool(_constant_pool);
+        return c;
+    }
+
+
     /**
      * Dump ModuleMainClass attribute to file stream in binary format.
      *
@@ -123,15 +134,4 @@ public final class ModuleMainClass extends Attribute {
         buf.append(Utility.compactClassName(class_name, false));
         return buf.toString();
     }
-
-
-    /**
-     * @return deep copy of this attribute
-     */
-    @Override
-    public Attribute copy( final ConstantPool _constant_pool ) {
-        final ModuleMainClass c = (ModuleMainClass) clone();
-        c.setConstantPool(_constant_pool);
-        return c;
-    }
 }
diff --git a/src/main/java/org/apache/bcel/classfile/ModuleOpens.java b/src/main/java/org/apache/bcel/classfile/ModuleOpens.java
index a06a6cf8..7801c410 100644
--- a/src/main/java/org/apache/bcel/classfile/ModuleOpens.java
+++ b/src/main/java/org/apache/bcel/classfile/ModuleOpens.java
@@ -69,6 +69,19 @@ public final class ModuleOpens implements Cloneable, Node {
 
     // TODO add more getters and setters?
 
+    /**
+     * @return deep copy of this object
+     */
+    public ModuleOpens copy() {
+        try {
+            return (ModuleOpens) clone();
+        } catch (final CloneNotSupportedException e) {
+            // TODO should this throw?
+        }
+        return null;
+    }
+
+
     /**
      * Dump table entry to file stream in binary format.
      *
@@ -109,17 +122,4 @@ public final class ModuleOpens implements Cloneable, Node {
         }
         return buf.substring(0, buf.length()-1); // remove the last newline
     }
-
-
-    /**
-     * @return deep copy of this object
-     */
-    public ModuleOpens copy() {
-        try {
-            return (ModuleOpens) clone();
-        } catch (final CloneNotSupportedException e) {
-            // TODO should this throw?
-        }
-        return null;
-    }
 }
diff --git a/src/main/java/org/apache/bcel/classfile/ModulePackages.java b/src/main/java/org/apache/bcel/classfile/ModulePackages.java
index 70fa1935..b7b0aff3 100644
--- a/src/main/java/org/apache/bcel/classfile/ModulePackages.java
+++ b/src/main/java/org/apache/bcel/classfile/ModulePackages.java
@@ -36,11 +36,20 @@ public final class ModulePackages extends Attribute {
 
 
     /**
-     * Initialize from another object. Note that both objects use the same
-     * references (shallow copy). Use copy() for a physical copy.
+     * Construct object from input stream.
+     * @param name_index Index in constant pool
+     * @param length Content length in bytes
+     * @param input Input stream
+     * @param constant_pool Array of constants
+     * @throws IOException
      */
-    public ModulePackages(final ModulePackages c) {
-        this(c.getNameIndex(), c.getLength(), c.getPackageIndexTable(), c.getConstantPool());
+    ModulePackages(final int name_index, final int length, final DataInput input, final ConstantPool constant_pool) throws IOException {
+        this(name_index, length, (int[]) null, constant_pool);
+        final int number_of_packages = input.readUnsignedShort();
+        packageIndexTable = new int[number_of_packages];
+        for (int i = 0; i < number_of_packages; i++) {
+            packageIndexTable[i] = input.readUnsignedShort();
+        }
     }
 
 
@@ -58,20 +67,11 @@ public final class ModulePackages extends Attribute {
 
 
     /**
-     * Construct object from input stream.
-     * @param name_index Index in constant pool
-     * @param length Content length in bytes
-     * @param input Input stream
-     * @param constant_pool Array of constants
-     * @throws IOException
+     * Initialize from another object. Note that both objects use the same
+     * references (shallow copy). Use copy() for a physical copy.
      */
-    ModulePackages(final int name_index, final int length, final DataInput input, final ConstantPool constant_pool) throws IOException {
-        this(name_index, length, (int[]) null, constant_pool);
-        final int number_of_packages = input.readUnsignedShort();
-        packageIndexTable = new int[number_of_packages];
-        for (int i = 0; i < number_of_packages; i++) {
-            packageIndexTable[i] = input.readUnsignedShort();
-        }
+    public ModulePackages(final ModulePackages c) {
+        this(c.getNameIndex(), c.getLength(), c.getPackageIndexTable(), c.getConstantPool());
     }
 
 
@@ -88,6 +88,22 @@ public final class ModulePackages extends Attribute {
     }
 
 
+    /**
+     * @return deep copy of this attribute
+     */
+    @Override
+    public Attribute copy( final ConstantPool _constant_pool ) {
+        final ModulePackages c = (ModulePackages) clone();
+        if (packageIndexTable != null) {
+            c.packageIndexTable = new int[packageIndexTable.length];
+            System.arraycopy(packageIndexTable, 0, c.packageIndexTable, 0,
+                    packageIndexTable.length);
+        }
+        c.setConstantPool(_constant_pool);
+        return c;
+    }
+
+
     /**
      * Dump ModulePackages attribute to file stream in binary format.
      *
@@ -105,18 +121,18 @@ public final class ModulePackages extends Attribute {
 
 
     /**
-     * @return array of indices into constant pool of package names.
+     * @return Length of package table.
      */
-    public int[] getPackageIndexTable() {
-        return packageIndexTable;
+    public int getNumberOfPackages() {
+        return packageIndexTable == null ? 0 : packageIndexTable.length;
     }
 
 
     /**
-     * @return Length of package table.
+     * @return array of indices into constant pool of package names.
      */
-    public int getNumberOfPackages() {
-        return packageIndexTable == null ? 0 : packageIndexTable.length;
+    public int[] getPackageIndexTable() {
+        return packageIndexTable;
     }
 
 
@@ -157,20 +173,4 @@ public final class ModulePackages extends Attribute {
         }
         return buf.substring(0, buf.length()-1); // remove the last newline
     }
-
-
-    /**
-     * @return deep copy of this attribute
-     */
-    @Override
-    public Attribute copy( final ConstantPool _constant_pool ) {
-        final ModulePackages c = (ModulePackages) clone();
-        if (packageIndexTable != null) {
-            c.packageIndexTable = new int[packageIndexTable.length];
-            System.arraycopy(packageIndexTable, 0, c.packageIndexTable, 0,
-                    packageIndexTable.length);
-        }
-        c.setConstantPool(_constant_pool);
-        return c;
-    }
 }
diff --git a/src/main/java/org/apache/bcel/classfile/ModuleProvides.java b/src/main/java/org/apache/bcel/classfile/ModuleProvides.java
index 990059d7..6a29162e 100644
--- a/src/main/java/org/apache/bcel/classfile/ModuleProvides.java
+++ b/src/main/java/org/apache/bcel/classfile/ModuleProvides.java
@@ -67,6 +67,19 @@ public final class ModuleProvides implements Cloneable, Node {
 
     // TODO add more getters and setters?
 
+    /**
+     * @return deep copy of this object
+     */
+    public ModuleProvides copy() {
+        try {
+            return (ModuleProvides) clone();
+        } catch (final CloneNotSupportedException e) {
+            // TODO should this throw?
+        }
+        return null;
+    }
+
+
     /**
      * Dump table entry to file stream in binary format.
      *
@@ -105,17 +118,4 @@ public final class ModuleProvides implements Cloneable, Node {
         }
         return buf.substring(0, buf.length()-1); // remove the last newline
     }
-
-
-    /**
-     * @return deep copy of this object
-     */
-    public ModuleProvides copy() {
-        try {
-            return (ModuleProvides) clone();
-        } catch (final CloneNotSupportedException e) {
-            // TODO should this throw?
-        }
-        return null;
-    }
 }
diff --git a/src/main/java/org/apache/bcel/classfile/ModuleRequires.java b/src/main/java/org/apache/bcel/classfile/ModuleRequires.java
index 20e2b36c..4b404198 100644
--- a/src/main/java/org/apache/bcel/classfile/ModuleRequires.java
+++ b/src/main/java/org/apache/bcel/classfile/ModuleRequires.java
@@ -64,6 +64,19 @@ public final class ModuleRequires implements Cloneable, Node {
 
     // TODO add more getters and setters?
 
+    /**
+     * @return deep copy of this object
+     */
+    public ModuleRequires copy() {
+        try {
+            return (ModuleRequires) clone();
+        } catch (final CloneNotSupportedException e) {
+            // TODO should this throw?
+        }
+        return null;
+    }
+
+
     /**
      * Dump table entry to file stream in binary format.
      *
@@ -98,17 +111,4 @@ public final class ModuleRequires implements Cloneable, Node {
         buf.append(", ").append(version);
         return buf.toString();
     }
-
-
-    /**
-     * @return deep copy of this object
-     */
-    public ModuleRequires copy() {
-        try {
-            return (ModuleRequires) clone();
-        } catch (final CloneNotSupportedException e) {
-            // TODO should this throw?
-        }
-        return null;
-    }
 }
diff --git a/src/main/java/org/apache/bcel/classfile/NestHost.java b/src/main/java/org/apache/bcel/classfile/NestHost.java
index 7dc561f1..0f844c68 100644
--- a/src/main/java/org/apache/bcel/classfile/NestHost.java
+++ b/src/main/java/org/apache/bcel/classfile/NestHost.java
@@ -36,11 +36,16 @@ public final class NestHost extends Attribute {
 
 
     /**
-     * Initializes from another object. Note that both objects use the same
-     * references (shallow copy). Use copy() for a physical copy.
+     * Constructs object from input stream.
+     * @param name_index Index in constant pool
+     * @param length Content length in bytes
+     * @param input Input stream
+     * @param constant_pool Array of constants
+     * @throws IOException
      */
-    public NestHost(final NestHost c) {
-        this(c.getNameIndex(), c.getLength(), c.getHostClassIndex(), c.getConstantPool());
+    NestHost(final int name_index, final int length, final DataInput input, final ConstantPool constant_pool) throws IOException {
+        this(name_index, length, 0, constant_pool);
+        hostClassIndex = input.readUnsignedShort();
     }
 
 
@@ -58,16 +63,11 @@ public final class NestHost extends Attribute {
 
 
     /**
-     * Constructs object from input stream.
-     * @param name_index Index in constant pool
-     * @param length Content length in bytes
-     * @param input Input stream
-     * @param constant_pool Array of constants
-     * @throws IOException
+     * Initializes from another object. Note that both objects use the same
+     * references (shallow copy). Use copy() for a physical copy.
      */
-    NestHost(final int name_index, final int length, final DataInput input, final ConstantPool constant_pool) throws IOException {
-        this(name_index, length, 0, constant_pool);
-        hostClassIndex = input.readUnsignedShort();
+    public NestHost(final NestHost c) {
+        this(c.getNameIndex(), c.getLength(), c.getHostClassIndex(), c.getConstantPool());
     }
 
 
@@ -84,6 +84,17 @@ public final class NestHost extends Attribute {
     }
 
 
+    /**
+     * @return deep copy of this attribute
+     */
+    @Override
+    public Attribute copy( final ConstantPool _constant_pool ) {
+        final NestHost c = (NestHost) clone();
+        c.setConstantPool(_constant_pool);
+        return c;
+    }
+
+
     /**
      * Dumps NestHost attribute to file stream in binary format.
      *
@@ -124,15 +135,4 @@ public final class NestHost extends Attribute {
         buf.append(Utility.compactClassName(class_name, false));
         return buf.toString();
     }
-
-
-    /**
-     * @return deep copy of this attribute
-     */
-    @Override
-    public Attribute copy( final ConstantPool _constant_pool ) {
-        final NestHost c = (NestHost) clone();
-        c.setConstantPool(_constant_pool);
-        return c;
-    }
 }
diff --git a/src/main/java/org/apache/bcel/classfile/NestMembers.java b/src/main/java/org/apache/bcel/classfile/NestMembers.java
index a8a5ae2e..9f78b84e 100644
--- a/src/main/java/org/apache/bcel/classfile/NestMembers.java
+++ b/src/main/java/org/apache/bcel/classfile/NestMembers.java
@@ -37,11 +37,20 @@ public final class NestMembers extends Attribute {
 
 
     /**
-     * Initialize from another object. Note that both objects use the same
-     * references (shallow copy). Use copy() for a physical copy.
+     * Construct object from input stream.
+     * @param name_index Index in constant pool
+     * @param length Content length in bytes
+     * @param input Input stream
+     * @param constant_pool Array of constants
+     * @throws IOException
      */
-    public NestMembers(final NestMembers c) {
-        this(c.getNameIndex(), c.getLength(), c.getClasses(), c.getConstantPool());
+    NestMembers(final int name_index, final int length, final DataInput input, final ConstantPool constant_pool) throws IOException {
+        this(name_index, length, (int[]) null, constant_pool);
+        final int number_of_classes = input.readUnsignedShort();
+        classes = new int[number_of_classes];
+        for (int i = 0; i < number_of_classes; i++) {
+            classes[i] = input.readUnsignedShort();
+        }
     }
 
 
@@ -59,20 +68,11 @@ public final class NestMembers extends Attribute {
 
 
     /**
-     * Construct object from input stream.
-     * @param name_index Index in constant pool
-     * @param length Content length in bytes
-     * @param input Input stream
-     * @param constant_pool Array of constants
-     * @throws IOException
+     * Initialize from another object. Note that both objects use the same
+     * references (shallow copy). Use copy() for a physical copy.
      */
-    NestMembers(final int name_index, final int length, final DataInput input, final ConstantPool constant_pool) throws IOException {
-        this(name_index, length, (int[]) null, constant_pool);
-        final int number_of_classes = input.readUnsignedShort();
-        classes = new int[number_of_classes];
-        for (int i = 0; i < number_of_classes; i++) {
-            classes[i] = input.readUnsignedShort();
-        }
+    public NestMembers(final NestMembers c) {
+        this(c.getNameIndex(), c.getLength(), c.getClasses(), c.getConstantPool());
     }
 
 
@@ -89,6 +89,22 @@ public final class NestMembers extends Attribute {
     }
 
 
+    /**
+     * @return deep copy of this attribute
+     */
+    @Override
+    public Attribute copy( final ConstantPool _constant_pool ) {
+        final NestMembers c = (NestMembers) clone();
+        if (classes != null) {
+            c.classes = new int[classes.length];
+            System.arraycopy(classes, 0, c.classes, 0,
+                    classes.length);
+        }
+        c.setConstantPool(_constant_pool);
+        return c;
+    }
+
+
     /**
      * Dump NestMembers attribute to file stream in binary format.
      *
@@ -113,14 +129,6 @@ public final class NestMembers extends Attribute {
     }
 
 
-    /**
-     * @return Length of classes table.
-     */
-    public int getNumberClasses() {
-        return classes == null ? 0 : classes.length;
-    }
-
-
     /**
      * @return string array of class names
      */
@@ -134,6 +142,14 @@ public final class NestMembers extends Attribute {
     }
 
 
+    /**
+     * @return Length of classes table.
+     */
+    public int getNumberClasses() {
+        return classes == null ? 0 : classes.length;
+    }
+
+
     /**
      * @param classes the list of class indexes
      * Also redefines number_of_classes according to table length.
@@ -158,20 +174,4 @@ public final class NestMembers extends Attribute {
         }
         return buf.substring(0, buf.length()-1); // remove the last newline
     }
-
-
-    /**
-     * @return deep copy of this attribute
-     */
-    @Override
-    public Attribute copy( final ConstantPool _constant_pool ) {
-        final NestMembers c = (NestMembers) clone();
-        if (classes != null) {
-            c.classes = new int[classes.length];
-            System.arraycopy(classes, 0, c.classes, 0,
-                    classes.length);
-        }
-        c.setConstantPool(_constant_pool);
-        return c;
-    }
 }
diff --git a/src/main/java/org/apache/bcel/classfile/PMGClass.java b/src/main/java/org/apache/bcel/classfile/PMGClass.java
index b03efd27..6831c8fb 100644
--- a/src/main/java/org/apache/bcel/classfile/PMGClass.java
+++ b/src/main/java/org/apache/bcel/classfile/PMGClass.java
@@ -35,16 +35,6 @@ public final class PMGClass extends Attribute {
     private int pmgIndex;
 
 
-    /**
-     * Initialize from another object. Note that both objects use the same
-     * references (shallow copy). Use copy() for a physical copy.
-     */
-    public PMGClass(final PMGClass pgmClass) {
-        this(pgmClass.getNameIndex(), pgmClass.getLength(), pgmClass.getPMGIndex(), pgmClass.getPMGClassIndex(),
-            pgmClass.getConstantPool());
-    }
-
-
     /**
      * Construct object from input stream.
      * @param name_index Index in constant pool to CONSTANT_Utf8
@@ -74,6 +64,16 @@ public final class PMGClass extends Attribute {
     }
 
 
+    /**
+     * Initialize from another object. Note that both objects use the same
+     * references (shallow copy). Use copy() for a physical copy.
+     */
+    public PMGClass(final PMGClass pgmClass) {
+        this(pgmClass.getNameIndex(), pgmClass.getLength(), pgmClass.getPMGIndex(), pgmClass.getPMGClassIndex(),
+            pgmClass.getConstantPool());
+    }
+
+
     /**
      * 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,
@@ -87,6 +87,15 @@ public final class PMGClass extends Attribute {
     }
 
 
+    /**
+     * @return deep copy of this attribute
+     */
+    @Override
+    public Attribute copy( final ConstantPool _constant_pool ) {
+        return (Attribute) clone();
+    }
+
+
     /**
      * Dump source file attribute to file stream in binary format.
      *
@@ -110,10 +119,12 @@ public final class PMGClass extends Attribute {
 
 
     /**
-     * @param pmgClassIndex
+     * @return PMG class name.
      */
-    public void setPMGClassIndex( final int pmgClassIndex ) {
-        this.pmgClassIndex = pmgClassIndex;
+    public String getPMGClassName() {
+        final ConstantUtf8 c = (ConstantUtf8) super.getConstantPool().getConstant(pmgClassIndex,
+                Const.CONSTANT_Utf8);
+        return c.getBytes();
     }
 
 
@@ -125,14 +136,6 @@ public final class PMGClass extends Attribute {
     }
 
 
-    /**
-     * @param pmgIndex
-     */
-    public void setPMGIndex( final int pmgIndex ) {
-        this.pmgIndex = pmgIndex;
-    }
-
-
     /**
      * @return PMG name.
      */
@@ -144,29 +147,26 @@ public final class PMGClass extends Attribute {
 
 
     /**
-     * @return PMG class name.
+     * @param pmgClassIndex
      */
-    public String getPMGClassName() {
-        final ConstantUtf8 c = (ConstantUtf8) super.getConstantPool().getConstant(pmgClassIndex,
-                Const.CONSTANT_Utf8);
-        return c.getBytes();
+    public void setPMGClassIndex( final int pmgClassIndex ) {
+        this.pmgClassIndex = pmgClassIndex;
     }
 
 
     /**
-     * @return String representation
+     * @param pmgIndex
      */
-    @Override
-    public String toString() {
-        return "PMGClass(" + getPMGName() + ", " + getPMGClassName() + ")";
+    public void setPMGIndex( final int pmgIndex ) {
+        this.pmgIndex = pmgIndex;
     }
 
 
     /**
-     * @return deep copy of this attribute
+     * @return String representation
      */
     @Override
-    public Attribute copy( final ConstantPool _constant_pool ) {
-        return (Attribute) clone();
+    public String toString() {
+        return "PMGClass(" + getPMGName() + ", " + getPMGClassName() + ")";
     }
 }
diff --git a/src/main/java/org/apache/bcel/classfile/ParameterAnnotationEntry.java b/src/main/java/org/apache/bcel/classfile/ParameterAnnotationEntry.java
index 3ccaac33..63a051f5 100644
--- a/src/main/java/org/apache/bcel/classfile/ParameterAnnotationEntry.java
+++ b/src/main/java/org/apache/bcel/classfile/ParameterAnnotationEntry.java
@@ -33,6 +33,19 @@ public class ParameterAnnotationEntry implements Node {
 
     static final ParameterAnnotationEntry[] EMPTY_ARRAY = {};
 
+    public static ParameterAnnotationEntry[] createParameterAnnotationEntries(final Attribute[] attrs) {
+          // Find attributes that contain parameter annotation data
+          final List<ParameterAnnotationEntry> accumulatedAnnotations = new ArrayList<>(attrs.length);
+          for (final Attribute attribute : attrs) {
+              if (attribute instanceof ParameterAnnotations) {
+                  final ParameterAnnotations runtimeAnnotations = (ParameterAnnotations)attribute;
+                  Collections.addAll(accumulatedAnnotations, runtimeAnnotations.getParameterAnnotationEntries());
+              }
+          }
+          return accumulatedAnnotations.toArray(ParameterAnnotationEntry.EMPTY_ARRAY);
+      }
+
+
     private final AnnotationEntry[] annotationTable;
 
 
@@ -51,7 +64,6 @@ public class ParameterAnnotationEntry implements Node {
         }
     }
 
-
     /**
      * 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,
@@ -64,13 +76,6 @@ public class ParameterAnnotationEntry implements Node {
         v.visitParameterAnnotationEntry(this);
     }
 
-    /**
-     * returns the array of annotation entries in this annotation
-     */
-    public AnnotationEntry[] getAnnotationEntries() {
-        return annotationTable;
-    }
-
     public void dump(final DataOutputStream dos) throws IOException {
         dos.writeShort(annotationTable.length);
         for (final AnnotationEntry entry : annotationTable) {
@@ -78,16 +83,11 @@ public class ParameterAnnotationEntry implements Node {
         }
     }
 
-  public static ParameterAnnotationEntry[] createParameterAnnotationEntries(final Attribute[] attrs) {
-      // Find attributes that contain parameter annotation data
-      final List<ParameterAnnotationEntry> accumulatedAnnotations = new ArrayList<>(attrs.length);
-      for (final Attribute attribute : attrs) {
-          if (attribute instanceof ParameterAnnotations) {
-              final ParameterAnnotations runtimeAnnotations = (ParameterAnnotations)attribute;
-              Collections.addAll(accumulatedAnnotations, runtimeAnnotations.getParameterAnnotationEntries());
-          }
-      }
-      return accumulatedAnnotations.toArray(ParameterAnnotationEntry.EMPTY_ARRAY);
-  }
+  /**
+ * returns the array of annotation entries in this annotation
+ */
+public AnnotationEntry[] getAnnotationEntries() {
+    return annotationTable;
+}
 }
 
diff --git a/src/main/java/org/apache/bcel/classfile/ParameterAnnotations.java b/src/main/java/org/apache/bcel/classfile/ParameterAnnotations.java
index d538f64b..971c2551 100644
--- a/src/main/java/org/apache/bcel/classfile/ParameterAnnotations.java
+++ b/src/main/java/org/apache/bcel/classfile/ParameterAnnotations.java
@@ -78,28 +78,14 @@ public abstract class ParameterAnnotations extends Attribute {
 
 
     /**
-     * @param parameterAnnotationTable the entries to set in this parameter annotation
-     */
-    public final void setParameterAnnotationTable(final ParameterAnnotationEntry[] parameterAnnotationTable ) {
-        this.parameterAnnotationTable = parameterAnnotationTable;
-    }
-
-
-    /**
-     * @return the parameter annotation entry table
+     * @return deep copy of this attribute
      */
-    public final ParameterAnnotationEntry[] getParameterAnnotationTable() {
-        return parameterAnnotationTable;
+    @Override
+    public Attribute copy( final ConstantPool constant_pool ) {
+        return (Attribute) clone();
     }
 
 
-    /**
-     * returns the array of parameter annotation entries in this parameter annotation
-     */
-    public ParameterAnnotationEntry[] getParameterAnnotationEntries() {
-        return parameterAnnotationTable;
-    }
-
     @Override
     public void dump(final DataOutputStream dos) throws IOException
     {
@@ -112,11 +98,25 @@ public abstract class ParameterAnnotations extends Attribute {
 
     }
 
+
     /**
-     * @return deep copy of this attribute
+     * returns the array of parameter annotation entries in this parameter annotation
      */
-    @Override
-    public Attribute copy( final ConstantPool constant_pool ) {
-        return (Attribute) clone();
+    public ParameterAnnotationEntry[] getParameterAnnotationEntries() {
+        return parameterAnnotationTable;
+    }
+
+    /**
+     * @return the parameter annotation entry table
+     */
+    public final ParameterAnnotationEntry[] getParameterAnnotationTable() {
+        return parameterAnnotationTable;
+    }
+
+    /**
+     * @param parameterAnnotationTable the entries to set in this parameter annotation
+     */
+    public final void setParameterAnnotationTable(final ParameterAnnotationEntry[] parameterAnnotationTable ) {
+        this.parameterAnnotationTable = parameterAnnotationTable;
     }
 }
diff --git a/src/main/java/org/apache/bcel/classfile/Signature.java b/src/main/java/org/apache/bcel/classfile/Signature.java
index 53d02461..a9157061 100644
--- a/src/main/java/org/apache/bcel/classfile/Signature.java
+++ b/src/main/java/org/apache/bcel/classfile/Signature.java
@@ -32,96 +32,6 @@ import org.apache.bcel.Const;
  */
 public final class Signature extends Attribute {
 
-    private int signatureIndex;
-
-
-    /**
-     * Initialize from another object. Note that both objects use the same
-     * references (shallow copy). Use clone() for a physical copy.
-     */
-    public Signature(final Signature c) {
-        this(c.getNameIndex(), c.getLength(), c.getSignatureIndex(), c.getConstantPool());
-    }
-
-
-    /**
-     * Construct object from file stream.
-     * @param name_index Index in constant pool to CONSTANT_Utf8
-     * @param length Content length in bytes
-     * @param input Input stream
-     * @param constant_pool Array of constants
-     * @throws IOException
-     */
-    Signature(final int name_index, final int length, final DataInput input, final ConstantPool constant_pool)
-            throws IOException {
-        this(name_index, length, input.readUnsignedShort(), constant_pool);
-    }
-
-
-    /**
-     * @param name_index Index in constant pool to CONSTANT_Utf8
-     * @param length Content length in bytes
-     * @param signatureIndex Index in constant pool to CONSTANT_Utf8
-     * @param constant_pool Array of constants
-     */
-    public Signature(final int name_index, final int length, final int signatureIndex, final ConstantPool constant_pool) {
-        super(Const.ATTR_SIGNATURE, name_index, length, constant_pool);
-        this.signatureIndex = signatureIndex;
-    }
-
-
-    /**
-     * 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
-     */
-    @Override
-    public void accept( final Visitor v ) {
-        //System.err.println("Visiting non-standard Signature object");
-        v.visitSignature(this);
-    }
-
-
-    /**
-     * Dump source file attribute to file stream in binary format.
-     *
-     * @param file Output file stream
-     * @throws IOException
-     */
-    @Override
-    public void dump( final DataOutputStream file ) throws IOException {
-        super.dump(file);
-        file.writeShort(signatureIndex);
-    }
-
-
-    /**
-     * @return Index in constant pool of source file name.
-     */
-    public int getSignatureIndex() {
-        return signatureIndex;
-    }
-
-
-    /**
-     * @param signatureIndex the index info the constant pool of this signature
-     */
-    public void setSignatureIndex( final int signatureIndex ) {
-        this.signatureIndex = signatureIndex;
-    }
-
-
-    /**
-     * @return GJ signature.
-     */
-    public String getSignature() {
-        final ConstantUtf8 c = (ConstantUtf8) super.getConstantPool().getConstant(signatureIndex,
-                Const.CONSTANT_Utf8);
-        return c.getBytes();
-    }
-
     /**
      * Extends ByteArrayInputStream to make 'unreading' chars possible.
      */
@@ -150,6 +60,53 @@ public final class Signature extends Attribute {
     }
 
 
+    // @since 6.0 is no longer final
+    public static boolean isActualParameterList( final String s ) {
+        return s.startsWith("L") && s.endsWith(">;");
+    }
+
+
+    // @since 6.0 is no longer final
+    public static boolean isFormalParameterList( final String s ) {
+        return s.startsWith("<") && s.indexOf(':') > 0;
+    }
+
+
+    private static void matchGJIdent( final MyByteArrayInputStream in, final StringBuilder buf ) {
+        int ch;
+        matchIdent(in, buf);
+        ch = in.read();
+        if (ch == '<' || ch == '(') { // Parameterized or method
+            //System.out.println("Enter <");
+            buf.append((char) ch);
+            matchGJIdent(in, buf);
+            while ((ch = in.read()) != '>' && ch != ')') { // List of parameters
+                if (ch == -1) {
+                    throw new IllegalArgumentException("Illegal signature: " + in.getData()
+                            + " reaching EOF");
+                }
+                //System.out.println("Still no >");
+                buf.append(", ");
+                in.unread();
+                matchGJIdent(in, buf); // Recursive call
+            }
+            //System.out.println("Exit >");
+            buf.append((char) ch);
+        } else {
+            in.unread();
+        }
+        ch = in.read();
+        if (identStart(ch)) {
+            in.unread();
+            matchGJIdent(in, buf);
+        } else if (ch == ')') {
+            in.unread();
+        } else if (ch != ';') {
+            throw new IllegalArgumentException("Illegal signature: " + in.getData() + " read " + (char) ch);
+        }
+    }
+
+
     private static void matchIdent( final MyByteArrayInputStream in, final StringBuilder buf ) {
         int ch;
         if ((ch = in.read()) == -1) {
@@ -193,41 +150,6 @@ public final class Signature extends Attribute {
     }
 
 
-    private static void matchGJIdent( final MyByteArrayInputStream in, final StringBuilder buf ) {
-        int ch;
-        matchIdent(in, buf);
-        ch = in.read();
-        if (ch == '<' || ch == '(') { // Parameterized or method
-            //System.out.println("Enter <");
-            buf.append((char) ch);
-            matchGJIdent(in, buf);
-            while ((ch = in.read()) != '>' && ch != ')') { // List of parameters
-                if (ch == -1) {
-                    throw new IllegalArgumentException("Illegal signature: " + in.getData()
-                            + " reaching EOF");
-                }
-                //System.out.println("Still no >");
-                buf.append(", ");
-                in.unread();
-                matchGJIdent(in, buf); // Recursive call
-            }
-            //System.out.println("Exit >");
-            buf.append((char) ch);
-        } else {
-            in.unread();
-        }
-        ch = in.read();
-        if (identStart(ch)) {
-            in.unread();
-            matchGJIdent(in, buf);
-        } else if (ch == ')') {
-            in.unread();
-        } else if (ch != ';') {
-            throw new IllegalArgumentException("Illegal signature: " + in.getData() + " read " + (char) ch);
-        }
-    }
-
-
     public static String translate( final String s ) {
         //System.out.println("Sig:" + s);
         final StringBuilder buf = new StringBuilder();
@@ -236,25 +158,54 @@ public final class Signature extends Attribute {
     }
 
 
-    // @since 6.0 is no longer final
-    public static boolean isFormalParameterList( final String s ) {
-        return s.startsWith("<") && s.indexOf(':') > 0;
+    private int signatureIndex;
+
+
+    /**
+     * Construct object from file stream.
+     * @param name_index Index in constant pool to CONSTANT_Utf8
+     * @param length Content length in bytes
+     * @param input Input stream
+     * @param constant_pool Array of constants
+     * @throws IOException
+     */
+    Signature(final int name_index, final int length, final DataInput input, final ConstantPool constant_pool)
+            throws IOException {
+        this(name_index, length, input.readUnsignedShort(), constant_pool);
     }
 
+    /**
+     * @param name_index Index in constant pool to CONSTANT_Utf8
+     * @param length Content length in bytes
+     * @param signatureIndex Index in constant pool to CONSTANT_Utf8
+     * @param constant_pool Array of constants
+     */
+    public Signature(final int name_index, final int length, final int signatureIndex, final ConstantPool constant_pool) {
+        super(Const.ATTR_SIGNATURE, name_index, length, constant_pool);
+        this.signatureIndex = signatureIndex;
+    }
 
-    // @since 6.0 is no longer final
-    public static boolean isActualParameterList( final String s ) {
-        return s.startsWith("L") && s.endsWith(">;");
+
+    /**
+     * Initialize from another object. Note that both objects use the same
+     * references (shallow copy). Use clone() for a physical copy.
+     */
+    public Signature(final Signature c) {
+        this(c.getNameIndex(), c.getLength(), c.getSignatureIndex(), c.getConstantPool());
     }
 
 
     /**
-     * @return String representation
+     * 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
      */
     @Override
-    public String toString() {
-        final String s = getSignature();
-        return "Signature: " + s;
+    public void accept( final Visitor v ) {
+        //System.err.println("Visiting non-standard Signature object");
+        v.visitSignature(this);
     }
 
 
@@ -265,4 +216,53 @@ public final class Signature extends Attribute {
     public Attribute copy( final ConstantPool _constant_pool ) {
         return (Attribute) clone();
     }
+
+
+    /**
+     * Dump source file attribute to file stream in binary format.
+     *
+     * @param file Output file stream
+     * @throws IOException
+     */
+    @Override
+    public void dump( final DataOutputStream file ) throws IOException {
+        super.dump(file);
+        file.writeShort(signatureIndex);
+    }
+
+
+    /**
+     * @return GJ signature.
+     */
+    public String getSignature() {
+        final ConstantUtf8 c = (ConstantUtf8) super.getConstantPool().getConstant(signatureIndex,
+                Const.CONSTANT_Utf8);
+        return c.getBytes();
+    }
+
+
+    /**
+     * @return Index in constant pool of source file name.
+     */
+    public int getSignatureIndex() {
+        return signatureIndex;
+    }
+
+
+    /**
+     * @param signatureIndex the index info the constant pool of this signature
+     */
+    public void setSignatureIndex( final int signatureIndex ) {
+        this.signatureIndex = signatureIndex;
+    }
+
+
+    /**
+     * @return String representation
+     */
+    @Override
+    public String toString() {
+        final String s = getSignature();
+        return "Signature: " + s;
+    }
 }
diff --git a/src/main/java/org/apache/bcel/classfile/SimpleElementValue.java b/src/main/java/org/apache/bcel/classfile/SimpleElementValue.java
index 9da22b6e..66c694e2 100644
--- a/src/main/java/org/apache/bcel/classfile/SimpleElementValue.java
+++ b/src/main/java/org/apache/bcel/classfile/SimpleElementValue.java
@@ -35,6 +35,29 @@ public class SimpleElementValue extends ElementValue
         this.index = index;
     }
 
+    @Override
+    public void dump(final DataOutputStream dos) throws IOException
+    {
+        final int _type = super.getType();
+        dos.writeByte(_type); // u1 kind of value
+        switch (_type)
+        {
+        case PRIMITIVE_INT:
+        case PRIMITIVE_BYTE:
+        case PRIMITIVE_CHAR:
+        case PRIMITIVE_FLOAT:
+        case PRIMITIVE_LONG:
+        case PRIMITIVE_BOOLEAN:
+        case PRIMITIVE_SHORT:
+        case PRIMITIVE_DOUBLE:
+        case STRING:
+            dos.writeShort(getIndex());
+            break;
+        default:
+            throw new IllegalStateException("SimpleElementValue doesnt know how to write out type " + _type);
+        }
+    }
+
     /**
      * @return Value entry index in the cpool
      */
@@ -43,31 +66,14 @@ public class SimpleElementValue extends ElementValue
         return index;
     }
 
-    public void setIndex(final int index)
-    {
-        this.index = index;
-    }
-
-    public String getValueString()
-    {
-        if (super.getType() != STRING) {
-            throw new IllegalStateException(
-                    "Dont call getValueString() on a non STRING ElementValue");
-        }
-        final ConstantUtf8 c = (ConstantUtf8) super.getConstantPool().getConstant(getIndex(),
-                Const.CONSTANT_Utf8);
-        return c.getBytes();
-    }
-
-    public int getValueInt()
+    public boolean getValueBoolean()
     {
-        if (super.getType() != PRIMITIVE_INT) {
+        if (super.getType() != PRIMITIVE_BOOLEAN) {
             throw new IllegalStateException(
-                    "Dont call getValueString() on a non STRING ElementValue");
+                    "Dont call getValueBoolean() on a non BOOLEAN ElementValue");
         }
-        final ConstantInteger c = (ConstantInteger) super.getConstantPool().getConstant(getIndex(),
-                Const.CONSTANT_Integer);
-        return c.getBytes();
+        final ConstantInteger bo = (ConstantInteger) super.getConstantPool().getConstant(getIndex());
+        return bo.getBytes() != 0;
     }
 
     public byte getValueByte()
@@ -92,14 +98,14 @@ public class SimpleElementValue extends ElementValue
         return (char) c.getBytes();
     }
 
-    public long getValueLong()
+    public double getValueDouble()
     {
-        if (super.getType() != PRIMITIVE_LONG) {
+        if (super.getType() != PRIMITIVE_DOUBLE) {
             throw new IllegalStateException(
-                    "Dont call getValueLong() on a non LONG ElementValue");
+                    "Dont call getValueDouble() on a non DOUBLE ElementValue");
         }
-        final ConstantLong j = (ConstantLong) super.getConstantPool().getConstant(getIndex());
-        return j.getBytes();
+        final ConstantDouble d = (ConstantDouble) super.getConstantPool().getConstant(getIndex());
+        return d.getBytes();
     }
 
     public float getValueFloat()
@@ -112,24 +118,25 @@ public class SimpleElementValue extends ElementValue
         return f.getBytes();
     }
 
-    public double getValueDouble()
+    public int getValueInt()
     {
-        if (super.getType() != PRIMITIVE_DOUBLE) {
+        if (super.getType() != PRIMITIVE_INT) {
             throw new IllegalStateException(
-                    "Dont call getValueDouble() on a non DOUBLE ElementValue");
+                    "Dont call getValueString() on a non STRING ElementValue");
         }
-        final ConstantDouble d = (ConstantDouble) super.getConstantPool().getConstant(getIndex());
-        return d.getBytes();
+        final ConstantInteger c = (ConstantInteger) super.getConstantPool().getConstant(getIndex(),
+                Const.CONSTANT_Integer);
+        return c.getBytes();
     }
 
-    public boolean getValueBoolean()
+    public long getValueLong()
     {
-        if (super.getType() != PRIMITIVE_BOOLEAN) {
+        if (super.getType() != PRIMITIVE_LONG) {
             throw new IllegalStateException(
-                    "Dont call getValueBoolean() on a non BOOLEAN ElementValue");
+                    "Dont call getValueLong() on a non LONG ElementValue");
         }
-        final ConstantInteger bo = (ConstantInteger) super.getConstantPool().getConstant(getIndex());
-        return bo.getBytes() != 0;
+        final ConstantLong j = (ConstantLong) super.getConstantPool().getConstant(getIndex());
+        return j.getBytes();
     }
 
     public short getValueShort()
@@ -142,10 +149,20 @@ public class SimpleElementValue extends ElementValue
         return (short) s.getBytes();
     }
 
-    @Override
-    public String toString()
+    public String getValueString()
     {
-        return stringifyValue();
+        if (super.getType() != STRING) {
+            throw new IllegalStateException(
+                    "Dont call getValueString() on a non STRING ElementValue");
+        }
+        final ConstantUtf8 c = (ConstantUtf8) super.getConstantPool().getConstant(getIndex(),
+                Const.CONSTANT_Utf8);
+        return c.getBytes();
+    }
+
+    public void setIndex(final int index)
+    {
+        this.index = index;
     }
 
     // Whatever kind of value it is, return it as a string
@@ -201,25 +218,8 @@ public class SimpleElementValue extends ElementValue
     }
 
     @Override
-    public void dump(final DataOutputStream dos) throws IOException
+    public String toString()
     {
-        final int _type = super.getType();
-        dos.writeByte(_type); // u1 kind of value
-        switch (_type)
-        {
-        case PRIMITIVE_INT:
-        case PRIMITIVE_BYTE:
-        case PRIMITIVE_CHAR:
-        case PRIMITIVE_FLOAT:
-        case PRIMITIVE_LONG:
-        case PRIMITIVE_BOOLEAN:
-        case PRIMITIVE_SHORT:
-        case PRIMITIVE_DOUBLE:
-        case STRING:
-            dos.writeShort(getIndex());
-            break;
-        default:
-            throw new IllegalStateException("SimpleElementValue doesnt know how to write out type " + _type);
-        }
+        return stringifyValue();
     }
 }
diff --git a/src/main/java/org/apache/bcel/classfile/SourceFile.java b/src/main/java/org/apache/bcel/classfile/SourceFile.java
index e0889475..7dd11134 100644
--- a/src/main/java/org/apache/bcel/classfile/SourceFile.java
+++ b/src/main/java/org/apache/bcel/classfile/SourceFile.java
@@ -36,15 +36,6 @@ public final class SourceFile extends Attribute {
     private int sourceFileIndex;
 
 
-    /**
-     * Initialize from another object. Note that both objects use the same
-     * references (shallow copy). Use clone() for a physical copy.
-     */
-    public SourceFile(final SourceFile c) {
-        this(c.getNameIndex(), c.getLength(), c.getSourceFileIndex(), c.getConstantPool());
-    }
-
-
     /**
      * Construct object from input stream.
      * @param name_index Index in constant pool to CONSTANT_Utf8
@@ -78,6 +69,15 @@ public final class SourceFile extends Attribute {
     }
 
 
+    /**
+     * Initialize from another object. Note that both objects use the same
+     * references (shallow copy). Use clone() for a physical copy.
+     */
+    public SourceFile(final SourceFile c) {
+        this(c.getNameIndex(), c.getLength(), c.getSourceFileIndex(), c.getConstantPool());
+    }
+
+
     /**
      * 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,
@@ -91,6 +91,15 @@ public final class SourceFile extends Attribute {
     }
 
 
+    /**
+     * @return deep copy of this attribute
+     */
+    @Override
+    public Attribute copy( final ConstantPool _constant_pool ) {
+        return (Attribute) clone();
+    }
+
+
     /**
      * Dump source file attribute to file stream in binary format.
      *
@@ -112,14 +121,6 @@ public final class SourceFile extends Attribute {
     }
 
 
-    /**
-     * @param sourceFileIndex
-     */
-    public void setSourceFileIndex( final int sourceFileIndex ) {
-        this.sourceFileIndex = sourceFileIndex;
-    }
-
-
     /**
      * @return Source file name.
      */
@@ -131,19 +132,18 @@ public final class SourceFile extends Attribute {
 
 
     /**
-     * @return String representation
+     * @param sourceFileIndex
      */
-    @Override
-    public String toString() {
-        return "SourceFile: " + getSourceFileName();
+    public void setSourceFileIndex( final int sourceFileIndex ) {
+        this.sourceFileIndex = sourceFileIndex;
     }
 
 
     /**
-     * @return deep copy of this attribute
+     * @return String representation
      */
     @Override
-    public Attribute copy( final ConstantPool _constant_pool ) {
-        return (Attribute) clone();
+    public String toString() {
+        return "SourceFile: " + getSourceFileName();
     }
 }
diff --git a/src/main/java/org/apache/bcel/classfile/StackMap.java b/src/main/java/org/apache/bcel/classfile/StackMap.java
index ad61b706..1f06c256 100644
--- a/src/main/java/org/apache/bcel/classfile/StackMap.java
+++ b/src/main/java/org/apache/bcel/classfile/StackMap.java
@@ -41,18 +41,6 @@ public final class StackMap extends Attribute {
     private StackMapEntry[] map; // Table of stack map entries
 
 
-    /*
-     * @param name_index Index of name
-     * @param length Content length in bytes
-     * @param map Table of stack map entries
-     * @param constant_pool Array of constants
-     */
-    public StackMap(final int name_index, final int length, final StackMapEntry[] map, final ConstantPool constant_pool) {
-        super(Const.ATTR_STACK_MAP, name_index, length, constant_pool);
-        this.map = map;
-    }
-
-
     /**
      * Construct object from input stream.
      *
@@ -72,6 +60,46 @@ public final class StackMap extends Attribute {
     }
 
 
+    /*
+     * @param name_index Index of name
+     * @param length Content length in bytes
+     * @param map Table of stack map entries
+     * @param constant_pool Array of constants
+     */
+    public StackMap(final int name_index, final int length, final StackMapEntry[] map, final ConstantPool constant_pool) {
+        super(Const.ATTR_STACK_MAP, name_index, length, constant_pool);
+        this.map = map;
+    }
+
+
+    /**
+     * 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
+     */
+    @Override
+    public void accept( final Visitor v ) {
+        v.visitStackMap(this);
+    }
+
+
+    /**
+     * @return deep copy of this attribute
+     */
+    @Override
+    public Attribute copy( final ConstantPool _constant_pool ) {
+        final StackMap c = (StackMap) clone();
+        c.map = new StackMapEntry[map.length];
+        for (int i = 0; i < map.length; i++) {
+            c.map[i] = map[i].copy();
+        }
+        c.setConstantPool(_constant_pool);
+        return c;
+    }
+
+
     /**
      * Dump stack map table attribute to file stream in binary format.
      *
@@ -88,6 +116,11 @@ public final class StackMap extends Attribute {
     }
 
 
+    public int getMapLength() {
+        return map == null ? 0 : map.length;
+    }
+
+
     /**
      * @return Array of stack map entries
      */
@@ -126,37 +159,4 @@ public final class StackMap extends Attribute {
         buf.append(')');
         return buf.toString();
     }
-
-
-    /**
-     * @return deep copy of this attribute
-     */
-    @Override
-    public Attribute copy( final ConstantPool _constant_pool ) {
-        final StackMap c = (StackMap) clone();
-        c.map = new StackMapEntry[map.length];
-        for (int i = 0; i < map.length; i++) {
-            c.map[i] = map[i].copy();
-        }
-        c.setConstantPool(_constant_pool);
-        return c;
-    }
-
-
-    /**
-     * 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
-     */
-    @Override
-    public void accept( final Visitor v ) {
-        v.visitStackMap(this);
-    }
-
-
-    public int getMapLength() {
-        return map == null ? 0 : map.length;
-    }
 }
diff --git a/src/main/java/org/apache/bcel/classfile/StackMapEntry.java b/src/main/java/org/apache/bcel/classfile/StackMapEntry.java
index f953cedb..560b3e5a 100644
--- a/src/main/java/org/apache/bcel/classfile/StackMapEntry.java
+++ b/src/main/java/org/apache/bcel/classfile/StackMapEntry.java
@@ -136,6 +136,42 @@ public final class StackMapEntry implements Node, Cloneable
     }
 
 
+    /**
+     * 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
+     */
+    @Override
+    public void accept( final Visitor v ) {
+        v.visitStackMapEntry(this);
+    }
+
+
+    /**
+     * @return deep copy of this object
+     */
+    public StackMapEntry copy() {
+        StackMapEntry e;
+        try {
+            e = (StackMapEntry) clone();
+        } catch (final CloneNotSupportedException ex) {
+            throw new Error("Clone Not Supported");
+        }
+
+        e.typesOfLocals = new StackMapType[typesOfLocals.length];
+        for (int i = 0; i < typesOfLocals.length; i++) {
+            e.typesOfLocals[i] = typesOfLocals[i].copy();
+        }
+        e.typesOfStackItems = new StackMapType[typesOfStackItems.length];
+        for (int i = 0; i < typesOfStackItems.length; i++) {
+            e.typesOfStackItems[i] = typesOfStackItems[i].copy();
+        }
+        return e;
+    }
+
+
     /**
      * Dump stack map entry
      *
@@ -178,54 +214,21 @@ public final class StackMapEntry implements Node, Cloneable
     }
 
 
+    public int getByteCodeOffset() {
+        return byteCodeOffset;
+    }
+
+
     /**
-     * @return String representation.
+     * @return Constant pool used by this object.
      */
-    @Override
-    public String toString() {
-        final StringBuilder buf = new StringBuilder(64);
-        buf.append("(");
-        if (frameType >= Const.SAME_FRAME && frameType <= Const.SAME_FRAME_MAX) {
-            buf.append("SAME");
-        } else if (frameType >= Const.SAME_LOCALS_1_STACK_ITEM_FRAME &&
-                  frameType <= Const.SAME_LOCALS_1_STACK_ITEM_FRAME_MAX) {
-            buf.append("SAME_LOCALS_1_STACK");
-        } else if (frameType == Const.SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED) {
-            buf.append("SAME_LOCALS_1_STACK_EXTENDED");
-        } else if (frameType >= Const.CHOP_FRAME && frameType <= Const.CHOP_FRAME_MAX) {
-            buf.append("CHOP ").append(String.valueOf(251-frameType));
-        } else if (frameType == Const.SAME_FRAME_EXTENDED) {
-            buf.append("SAME_EXTENDED");
-        } else if (frameType >= Const.APPEND_FRAME && frameType <= Const.APPEND_FRAME_MAX) {
-            buf.append("APPEND ").append(String.valueOf(frameType-251));
-        } else if (frameType == Const.FULL_FRAME) {
-            buf.append("FULL");
-        } else {
-            buf.append("UNKNOWN (").append(frameType).append(")");
-        }
-        buf.append(", offset delta=").append(byteCodeOffset);
-        if (typesOfLocals.length > 0) {
-            buf.append(", locals={");
-            for (int i = 0; i < typesOfLocals.length; i++) {
-                buf.append(typesOfLocals[i]);
-                if (i < typesOfLocals.length - 1) {
-                    buf.append(", ");
-                }
-            }
-            buf.append("}");
-        }
-        if (typesOfStackItems.length > 0) {
-            buf.append(", stack items={");
-            for (int i = 0; i < typesOfStackItems.length; i++) {
-                buf.append(typesOfStackItems[i]);
-                if (i < typesOfStackItems.length - 1) {
-                    buf.append(", ");
-                }
-            }
-            buf.append("}");
-        }
-        buf.append(")");
-        return buf.toString();
+    public ConstantPool getConstantPool() {
+        return constantPool;
+    }
+
+
+    public int getFrameType() {
+        return frameType;
     }
 
 
@@ -268,26 +271,23 @@ public final class StackMapEntry implements Node, Cloneable
     }
 
 
-    public void setFrameType( final int f ) {
-        if (f >= Const.SAME_FRAME && f <= Const.SAME_FRAME_MAX) {
-            byteCodeOffset = f - Const.SAME_FRAME;
-        } else if (f >= Const.SAME_LOCALS_1_STACK_ITEM_FRAME &&
-                   f <= Const.SAME_LOCALS_1_STACK_ITEM_FRAME_MAX) {
-            byteCodeOffset = f - Const.SAME_LOCALS_1_STACK_ITEM_FRAME;
-        } else if (f == Const.SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED) { // CHECKSTYLE IGNORE EmptyBlock
-        } else if (f >= Const.CHOP_FRAME && f <= Const.CHOP_FRAME_MAX) { // CHECKSTYLE IGNORE EmptyBlock
-        } else if (f == Const.SAME_FRAME_EXTENDED) { // CHECKSTYLE IGNORE EmptyBlock
-        } else if (f >= Const.APPEND_FRAME && f <= Const.APPEND_FRAME_MAX) { // CHECKSTYLE IGNORE EmptyBlock
-        } else if (f == Const.FULL_FRAME) { // CHECKSTYLE IGNORE EmptyBlock
-        } else {
-            throw new IllegalArgumentException("Invalid StackMap frameType");
-        }
-        frameType = f;
+    public int getNumberOfLocals() {
+        return typesOfLocals.length;
     }
 
 
-    public int getFrameType() {
-        return frameType;
+    public int getNumberOfStackItems() {
+        return typesOfStackItems.length;
+    }
+
+
+    public StackMapType[] getTypesOfLocals() {
+        return typesOfLocals;
+    }
+
+
+    public StackMapType[] getTypesOfStackItems() {
+        return typesOfStackItems;
     }
 
 
@@ -325,19 +325,28 @@ public final class StackMapEntry implements Node, Cloneable
 
 
     /**
-     * Update the distance (as an offset delta) from this StackMap
-     * entry to the next.  Note that this might cause the the
-     * frame type to change.  Note also that delta may be negative.
-     *
-     * @param delta offset delta
+     * @param constantPool Constant pool to be used for this object.
      */
-    public void updateByteCodeOffset(final int delta) {
-        setByteCodeOffset(byteCodeOffset + delta);
+    public void setConstantPool( final ConstantPool constantPool ) {
+        this.constantPool = constantPool;
     }
 
 
-    public int getByteCodeOffset() {
-        return byteCodeOffset;
+    public void setFrameType( final int f ) {
+        if (f >= Const.SAME_FRAME && f <= Const.SAME_FRAME_MAX) {
+            byteCodeOffset = f - Const.SAME_FRAME;
+        } else if (f >= Const.SAME_LOCALS_1_STACK_ITEM_FRAME &&
+                   f <= Const.SAME_LOCALS_1_STACK_ITEM_FRAME_MAX) {
+            byteCodeOffset = f - Const.SAME_LOCALS_1_STACK_ITEM_FRAME;
+        } else if (f == Const.SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED) { // CHECKSTYLE IGNORE EmptyBlock
+        } else if (f >= Const.CHOP_FRAME && f <= Const.CHOP_FRAME_MAX) { // CHECKSTYLE IGNORE EmptyBlock
+        } else if (f == Const.SAME_FRAME_EXTENDED) { // CHECKSTYLE IGNORE EmptyBlock
+        } else if (f >= Const.APPEND_FRAME && f <= Const.APPEND_FRAME_MAX) { // CHECKSTYLE IGNORE EmptyBlock
+        } else if (f == Const.FULL_FRAME) { // CHECKSTYLE IGNORE EmptyBlock
+        } else {
+            throw new IllegalArgumentException("Invalid StackMap frameType");
+        }
+        frameType = f;
     }
 
 
@@ -350,21 +359,6 @@ public final class StackMapEntry implements Node, Cloneable
     }
 
 
-    public int getNumberOfLocals() {
-        return typesOfLocals.length;
-    }
-
-
-    public void setTypesOfLocals( final StackMapType[] types ) {
-        typesOfLocals = types != null ? types : EMPTY_STACK_MAP_TYPE_ARRAY;
-    }
-
-
-    public StackMapType[] getTypesOfLocals() {
-        return typesOfLocals;
-    }
-
-
     /**
      *
      * @deprecated since 6.0
@@ -374,8 +368,8 @@ public final class StackMapEntry implements Node, Cloneable
     }
 
 
-    public int getNumberOfStackItems() {
-        return typesOfStackItems.length;
+    public void setTypesOfLocals( final StackMapType[] types ) {
+        typesOfLocals = types != null ? types : EMPTY_STACK_MAP_TYPE_ARRAY;
     }
 
 
@@ -384,59 +378,65 @@ public final class StackMapEntry implements Node, Cloneable
     }
 
 
-    public StackMapType[] getTypesOfStackItems() {
-        return typesOfStackItems;
-    }
-
-
     /**
-     * @return deep copy of this object
+     * @return String representation.
      */
-    public StackMapEntry copy() {
-        StackMapEntry e;
-        try {
-            e = (StackMapEntry) clone();
-        } catch (final CloneNotSupportedException ex) {
-            throw new Error("Clone Not Supported");
+    @Override
+    public String toString() {
+        final StringBuilder buf = new StringBuilder(64);
+        buf.append("(");
+        if (frameType >= Const.SAME_FRAME && frameType <= Const.SAME_FRAME_MAX) {
+            buf.append("SAME");
+        } else if (frameType >= Const.SAME_LOCALS_1_STACK_ITEM_FRAME &&
+                  frameType <= Const.SAME_LOCALS_1_STACK_ITEM_FRAME_MAX) {
+            buf.append("SAME_LOCALS_1_STACK");
+        } else if (frameType == Const.SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED) {
+            buf.append("SAME_LOCALS_1_STACK_EXTENDED");
+        } else if (frameType >= Const.CHOP_FRAME && frameType <= Const.CHOP_FRAME_MAX) {
+            buf.append("CHOP ").append(String.valueOf(251-frameType));
+        } else if (frameType == Const.SAME_FRAME_EXTENDED) {
+            buf.append("SAME_EXTENDED");
+        } else if (frameType >= Const.APPEND_FRAME && frameType <= Const.APPEND_FRAME_MAX) {
+            buf.append("APPEND ").append(String.valueOf(frameType-251));
+        } else if (frameType == Const.FULL_FRAME) {
+            buf.append("FULL");
+        } else {
+            buf.append("UNKNOWN (").append(frameType).append(")");
         }
-
-        e.typesOfLocals = new StackMapType[typesOfLocals.length];
-        for (int i = 0; i < typesOfLocals.length; i++) {
-            e.typesOfLocals[i] = typesOfLocals[i].copy();
+        buf.append(", offset delta=").append(byteCodeOffset);
+        if (typesOfLocals.length > 0) {
+            buf.append(", locals={");
+            for (int i = 0; i < typesOfLocals.length; i++) {
+                buf.append(typesOfLocals[i]);
+                if (i < typesOfLocals.length - 1) {
+                    buf.append(", ");
+                }
+            }
+            buf.append("}");
         }
-        e.typesOfStackItems = new StackMapType[typesOfStackItems.length];
-        for (int i = 0; i < typesOfStackItems.length; i++) {
-            e.typesOfStackItems[i] = typesOfStackItems[i].copy();
+        if (typesOfStackItems.length > 0) {
+            buf.append(", stack items={");
+            for (int i = 0; i < typesOfStackItems.length; i++) {
+                buf.append(typesOfStackItems[i]);
+                if (i < typesOfStackItems.length - 1) {
+                    buf.append(", ");
+                }
+            }
+            buf.append("}");
         }
-        return e;
+        buf.append(")");
+        return buf.toString();
     }
 
 
     /**
-     * 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.
+     * Update the distance (as an offset delta) from this StackMap
+     * entry to the next.  Note that this might cause the the
+     * frame type to change.  Note also that delta may be negative.
      *
-     * @param v Visitor object
-     */
-    @Override
-    public void accept( final Visitor v ) {
-        v.visitStackMapEntry(this);
-    }
-
-
-    /**
-     * @return Constant pool used by this object.
-     */
-    public ConstantPool getConstantPool() {
-        return constantPool;
-    }
-
-
-    /**
-     * @param constantPool Constant pool to be used for this object.
+     * @param delta offset delta
      */
-    public void setConstantPool( final ConstantPool constantPool ) {
-        this.constantPool = constantPool;
+    public void updateByteCodeOffset(final int delta) {
+        setByteCodeOffset(byteCodeOffset + delta);
     }
 }
diff --git a/src/main/java/org/apache/bcel/classfile/StackMapType.java b/src/main/java/org/apache/bcel/classfile/StackMapType.java
index 6a004f38..f2a84b3f 100644
--- a/src/main/java/org/apache/bcel/classfile/StackMapType.java
+++ b/src/main/java/org/apache/bcel/classfile/StackMapType.java
@@ -38,6 +38,20 @@ public final class StackMapType implements Cloneable {
     private ConstantPool constantPool;
 
 
+    /**
+     * @param type type tag as defined in the Constants interface
+     * @param index index to constant pool, or byte code offset
+     */
+    public StackMapType(final byte type, final int index, final ConstantPool constant_pool) {
+        if (type < Const.ITEM_Bogus || type > Const.ITEM_NewObject) {
+            throw new IllegalArgumentException("Illegal type for StackMapType: " + type);
+        }
+        this.type = type;
+        this.index = index;
+        this.constantPool = constant_pool;
+    }
+
+
     /**
      * Construct object from file stream.
      * @param file Input stream
@@ -53,34 +67,37 @@ public final class StackMapType implements Cloneable {
 
 
     /**
-     * @param type type tag as defined in the Constants interface
-     * @param index index to constant pool, or byte code offset
+     * @return deep copy of this object
      */
-    public StackMapType(final byte type, final int index, final ConstantPool constant_pool) {
-        if (type < Const.ITEM_Bogus || type > Const.ITEM_NewObject) {
-            throw new IllegalArgumentException("Illegal type for StackMapType: " + type);
+    public StackMapType copy() {
+        try {
+            return (StackMapType) clone();
+        } catch (final CloneNotSupportedException e) {
+            // TODO should this throw?
         }
-        this.type = type;
-        this.index = index;
-        this.constantPool = constant_pool;
+        return null;
     }
 
 
-    public void setType( final byte t ) {
-        if (t < Const.ITEM_Bogus || t > Const.ITEM_NewObject) {
-            throw new IllegalArgumentException("Illegal type for StackMapType: " + t);
+    /**
+     * Dump type entries to file.
+     *
+     * @param file Output file stream
+     * @throws IOException
+     */
+    public void dump( final DataOutputStream file ) throws IOException {
+        file.writeByte(type);
+        if (hasIndex()) {
+            file.writeShort(getIndex());
         }
-        type = t;
     }
 
 
-    public byte getType() {
-        return type;
-    }
-
-
-    public void setIndex( final int t ) {
-        index = t;
+    /**
+     * @return Constant pool used by this object.
+     */
+    public ConstantPool getConstantPool() {
+        return constantPool;
     }
 
 
@@ -92,17 +109,8 @@ public final class StackMapType implements Cloneable {
     }
 
 
-    /**
-     * Dump type entries to file.
-     *
-     * @param file Output file stream
-     * @throws IOException
-     */
-    public void dump( final DataOutputStream file ) throws IOException {
-        file.writeByte(type);
-        if (hasIndex()) {
-            file.writeShort(getIndex());
-        }
+    public byte getType() {
+        return type;
     }
 
 
@@ -128,39 +136,31 @@ public final class StackMapType implements Cloneable {
 
 
     /**
-     * @return String representation
+     * @param constantPool Constant pool to be used for this object.
      */
-    @Override
-    public String toString() {
-        return "(type=" + Const.getItemName(type) + printIndex() + ")";
+    public void setConstantPool( final ConstantPool constantPool ) {
+        this.constantPool = constantPool;
     }
 
 
-    /**
-     * @return deep copy of this object
-     */
-    public StackMapType copy() {
-        try {
-            return (StackMapType) clone();
-        } catch (final CloneNotSupportedException e) {
-            // TODO should this throw?
-        }
-        return null;
+    public void setIndex( final int t ) {
+        index = t;
     }
 
 
-    /**
-     * @return Constant pool used by this object.
-     */
-    public ConstantPool getConstantPool() {
-        return constantPool;
+    public void setType( final byte t ) {
+        if (t < Const.ITEM_Bogus || t > Const.ITEM_NewObject) {
+            throw new IllegalArgumentException("Illegal type for StackMapType: " + t);
+        }
+        type = t;
     }
 
 
     /**
-     * @param constantPool Constant pool to be used for this object.
+     * @return String representation
      */
-    public void setConstantPool( final ConstantPool constantPool ) {
-        this.constantPool = constantPool;
+    @Override
+    public String toString() {
+        return "(type=" + Const.getItemName(type) + printIndex() + ")";
     }
 }
diff --git a/src/main/java/org/apache/bcel/classfile/Synthetic.java b/src/main/java/org/apache/bcel/classfile/Synthetic.java
index af24ecdc..d015f25a 100644
--- a/src/main/java/org/apache/bcel/classfile/Synthetic.java
+++ b/src/main/java/org/apache/bcel/classfile/Synthetic.java
@@ -39,15 +39,6 @@ public final class Synthetic extends Attribute {
     private byte[] bytes;
 
 
-    /**
-     * Initialize from another object. Note that both objects use the same
-     * references (shallow copy). Use copy() for a physical copy.
-     */
-    public Synthetic(final Synthetic c) {
-        this(c.getNameIndex(), c.getLength(), c.getBytes(), c.getConstantPool());
-    }
-
-
     /**
      * @param name_index Index in constant pool to CONSTANT_Utf8, which
      * should represent the string "Synthetic".
@@ -82,6 +73,15 @@ public final class Synthetic extends Attribute {
     }
 
 
+    /**
+     * Initialize from another object. Note that both objects use the same
+     * references (shallow copy). Use copy() for a physical copy.
+     */
+    public Synthetic(final Synthetic c) {
+        this(c.getNameIndex(), c.getLength(), c.getBytes(), c.getConstantPool());
+    }
+
+
     /**
      * 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,
@@ -95,6 +95,21 @@ public final class Synthetic extends Attribute {
     }
 
 
+    /**
+     * @return deep copy of this attribute
+     */
+    @Override
+    public Attribute copy( final ConstantPool _constant_pool ) {
+        final Synthetic c = (Synthetic) clone();
+        if (bytes != null) {
+            c.bytes = new byte[bytes.length];
+            System.arraycopy(bytes, 0, c.bytes, 0, bytes.length);
+        }
+        c.setConstantPool(_constant_pool);
+        return c;
+    }
+
+
     /**
      * Dump source file attribute to file stream in binary format.
      *
@@ -137,19 +152,4 @@ public final class Synthetic extends Attribute {
         }
         return buf.toString();
     }
-
-
-    /**
-     * @return deep copy of this attribute
-     */
-    @Override
-    public Attribute copy( final ConstantPool _constant_pool ) {
-        final Synthetic c = (Synthetic) clone();
-        if (bytes != null) {
-            c.bytes = new byte[bytes.length];
-            System.arraycopy(bytes, 0, c.bytes, 0, bytes.length);
-        }
-        c.setConstantPool(_constant_pool);
-        return c;
-    }
 }
diff --git a/src/main/java/org/apache/bcel/classfile/Unknown.java b/src/main/java/org/apache/bcel/classfile/Unknown.java
index 9aad0778..3e484c66 100644
--- a/src/main/java/org/apache/bcel/classfile/Unknown.java
+++ b/src/main/java/org/apache/bcel/classfile/Unknown.java
@@ -39,11 +39,7 @@ import org.apache.bcel.Const;
  */
 public final class Unknown extends Attribute {
 
-    private byte[] bytes;
-    private final String name;
     private static final Map<String, Unknown> unknownAttributes = new HashMap<>();
-
-
     /** @return array of unknown attributes, but just one for each kind.
      */
     static Unknown[] getUnknownAttributes() {
@@ -52,15 +48,10 @@ public final class Unknown extends Attribute {
         unknownAttributes.clear();
         return unknowns;
     }
+    private byte[] bytes;
 
 
-    /**
-     * Initialize from another object. Note that both objects use the same
-     * references (shallow copy). Use clone() for a physical copy.
-     */
-    public Unknown(final Unknown c) {
-        this(c.getNameIndex(), c.getLength(), c.getBytes(), c.getConstantPool());
-    }
+    private final String name;
 
 
     /**
@@ -99,6 +90,15 @@ public final class Unknown extends Attribute {
     }
 
 
+    /**
+     * Initialize from another object. Note that both objects use the same
+     * references (shallow copy). Use clone() for a physical copy.
+     */
+    public Unknown(final Unknown c) {
+        this(c.getNameIndex(), c.getLength(), c.getBytes(), c.getConstantPool());
+    }
+
+
     /**
      * 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,
@@ -112,6 +112,21 @@ public final class Unknown extends Attribute {
     }
 
 
+    /**
+     * @return deep copy of this attribute
+     */
+    @Override
+    public Attribute copy( final ConstantPool _constant_pool ) {
+        final Unknown c = (Unknown) clone();
+        if (bytes != null) {
+            c.bytes = new byte[bytes.length];
+            System.arraycopy(bytes, 0, c.bytes, 0, bytes.length);
+        }
+        c.setConstantPool(_constant_pool);
+        return c;
+    }
+
+
     /**
      * Dump unknown bytes to file stream.
      *
@@ -170,19 +185,4 @@ public final class Unknown extends Attribute {
         }
         return "(Unknown attribute " + name + ": " + hex + ")";
     }
-
-
-    /**
-     * @return deep copy of this attribute
-     */
-    @Override
-    public Attribute copy( final ConstantPool _constant_pool ) {
-        final Unknown c = (Unknown) clone();
-        if (bytes != null) {
-            c.bytes = new byte[bytes.length];
-            System.arraycopy(bytes, 0, c.bytes, 0, bytes.length);
-        }
-        c.setConstantPool(_constant_pool);
-        return c;
-    }
 }
diff --git a/src/main/java/org/apache/bcel/classfile/Utility.java b/src/main/java/org/apache/bcel/classfile/Utility.java
... 32093 lines suppressed ...


[commons-bcel] 03/08: Update Spotbugs plugin and tool to 4.6.0.0/4.6.0

Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-bcel.git

commit 58664a05ac1bc7eb158eb274e8cb961de3425884
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun May 1 09:11:36 2022 -0400

    Update Spotbugs plugin and tool to 4.6.0.0/4.6.0
---
 pom.xml                 | 4 +++-
 src/changes/changes.xml | 2 ++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 1adb53e0..b07d7230 100644
--- a/pom.xml
+++ b/pom.xml
@@ -73,6 +73,8 @@
     <commons.jacoco.version>0.8.8</commons.jacoco.version>
     <commons.javadoc.version>3.3.2</commons.javadoc.version>
     <commons.felix.version>5.1.3</commons.felix.version>
+    <commons.spotbugs.plugin.version>4.6.0.0</commons.spotbugs.plugin.version>
+    <commons.spotbugs.impl.version>4.6.0</commons.spotbugs.impl.version>    
     <biz.aQute.bndlib.version>6.2.0</biz.aQute.bndlib.version>
   </properties>
 
@@ -444,7 +446,7 @@
       <plugin>
         <groupId>com.github.spotbugs</groupId>
         <artifactId>spotbugs-maven-plugin</artifactId>
-        <version>${commons.spotbugs.version}</version>
+        <version>${commons.spotbugs.plugin.version}</version>
         <configuration>
           <threshold>Normal</threshold>
           <effort>Default</effort>
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 7bb44fd6..c666078c 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -97,6 +97,8 @@ The <action> type attribute can be add,update,fix,remove.
       <action                  type="update" dev="ggregory" due-to="Gary Gregory">Bump commons.javadoc.version from 3.2.0 to 3.3.2.</action>
       <action                  type="update" dev="ggregory" due-to="Gary Gregory">Bump Bump maven-bundle-plugin from 5.1.1 to 5.1.3.</action>
       <action                  type="update" dev="ggregory" due-to="Dependabot">Bump taglist-maven-plugin from 2.4 to 3.0.0 #114.</action>
+      <action                  type="update" dev="ggregory" due-to="Gary Gregory">Bump spotbugs-maven-plugin from 4.5.3.0 to 4.6.0.0.</action>
+      <action                  type="update" dev="ggregory" due-to="Gary Gregory">Bump spotbugs from 4.5.3 to 4.6.0.</action>
     </release>
     <release version="6.5.0" date="2020-06-05" description="Minor feature and bug fix release.">
       <action issue="BCEL-330" type="update" dev="ggregory" due-to="Mark Roberts">Remove unnecessary references to Constants.</action>


[commons-bcel] 06/08: Remove unused exception from signature.

Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-bcel.git

commit 2bf42c4134161319c82227807aab8d4903fd060e
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun May 1 14:19:05 2022 -0400

    Remove unused exception from signature.
---
 src/main/java/org/apache/bcel/util/ModularRuntimeImage.java | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/src/main/java/org/apache/bcel/util/ModularRuntimeImage.java b/src/main/java/org/apache/bcel/util/ModularRuntimeImage.java
index 282c8f5e..f362865b 100644
--- a/src/main/java/org/apache/bcel/util/ModularRuntimeImage.java
+++ b/src/main/java/org/apache/bcel/util/ModularRuntimeImage.java
@@ -50,11 +50,8 @@ public class ModularRuntimeImage implements Closeable {
 
     /**
      * Constructs a default instance.
-     *
-     * @throws IOException
-     *             an I/O error occurs accessing the file system
      */
-    public ModularRuntimeImage() throws IOException {
+    public ModularRuntimeImage() {
         this(null, FileSystems.getFileSystem(URI.create("jrt:/")));
     }