aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Jungmann2014-04-19 17:53:43 (EDT)
committertware2014-05-02 09:04:30 (EDT)
commit1ba20036cd43ca2ab80a74f6c14a78d7a98b7db2 (patch)
treee802d8bb50c6b8a73d4c1638fd6062a0a871c8a0
parentcd88de95cbc4043da30ed441dee88932dbb18ccf (diff)
downloadeclipselink.runtime-1ba20036cd43ca2ab80a74f6c14a78d7a98b7db2.zip
eclipselink.runtime-1ba20036cd43ca2ab80a74f6c14a78d7a98b7db2.tar.gz
eclipselink.runtime-1ba20036cd43ca2ab80a74f6c14a78d7a98b7db2.tar.bz2
Bug#429992: EclipseLink silently ignores Entity classes with lambda expressions (ASM library update to 5.0.1 to support JavaSE 8 language features in entites)
Signed-off-by: Lukas Jungmann <lukas.jungmann@oracle.com>
-rw-r--r--plugins/org.eclipse.persistence.asm/.classpath14
-rw-r--r--plugins/org.eclipse.persistence.asm/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--plugins/org.eclipse.persistence.asm/META-INF/MANIFEST.MF50
-rw-r--r--plugins/org.eclipse.persistence.asm/build.properties6
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/AnnotationVisitor.classbin522 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/AnnotationWriter.classbin4571 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/Attribute.classbin2068 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/ByteVector.classbin2040 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/ClassAdapter.classbin1659 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/ClassReader.classbin18571 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/ClassVisitor.classbin998 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/ClassWriter.classbin13857 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/Edge.classbin412 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/FieldVisitor.classbin341 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/FieldWriter.classbin3372 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/Frame.classbin8334 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/Handler.classbin403 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/Item.classbin1692 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/Label.classbin3548 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/MethodAdapter.classbin3216 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/MethodVisitor.classbin1954 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/MethodWriter.classbin22310 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/Opcodes.classbin6472 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/Type.classbin6045 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/AdviceAdapter.classbin6259 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/AnalyzerAdapter.classbin8518 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/CodeSizeEvaluator.classbin2532 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/EmptyVisitor.classbin3897 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/GeneratorAdapter.classbin14649 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/InstructionAdapter.classbin11535 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/JSRInlinerAdapter$Instantiation.classbin3066 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/JSRInlinerAdapter$Subroutine.classbin833 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/JSRInlinerAdapter.classbin7658 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/LocalVariablesSorter.classbin3714 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/Method.classbin3746 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/Remapper.classbin3233 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/RemappingAnnotationAdapter.classbin1490 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/RemappingClassAdapter.classbin3621 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/RemappingFieldAdapter.classbin1317 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/RemappingMethodAdapter.classbin3424 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/RemappingSignatureAdapter.classbin2397 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/SerialVersionUIDAdder$Item.classbin657 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/SerialVersionUIDAdder.classbin4090 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/SimpleRemapper.classbin1120 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/StaticInitMerger.classbin1774 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/TableSwitchGenerator.classbin243 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/TryCatchBlockSorter$1.classbin1260 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/TryCatchBlockSorter.classbin1057 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/package.html48
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/package.html87
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/signature/SignatureReader.classbin2120 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/signature/SignatureVisitor.classbin850 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/signature/SignatureWriter.classbin2054 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/signature/package.html36
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/AbstractInsnNode.classbin1885 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/AnnotationNode.classbin1961 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/ClassNode.classbin3602 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/FieldInsnNode.classbin896 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/FieldNode.classbin1768 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/FrameNode.classbin1992 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/IincInsnNode.classbin711 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/InnerClassNode.classbin618 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/InsnList$InsnListIterator.classbin2099 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/InsnList.classbin4085 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/InsnNode.classbin639 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/IntInsnNode.classbin743 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/JumpInsnNode.classbin1243 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/LabelNode.classbin1117 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/LdcInsnNode.classbin703 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/LineNumberNode.classbin1214 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/LocalVariableNode.classbin1204 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/LookupSwitchInsnNode.classbin2092 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/MemberNode.classbin898 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/MethodInsnNode.classbin898 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/MethodNode$1.classbin716 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/MethodNode.classbin9158 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/MultiANewArrayInsnNode.classbin770 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/TableSwitchInsnNode.classbin1928 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/TryCatchBlockNode.classbin1184 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/TypeInsnNode.classbin780 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/VarInsnNode.classbin739 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/analysis/Analyzer.classbin9273 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/analysis/AnalyzerException.classbin1155 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/analysis/BasicInterpreter.classbin6275 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/analysis/BasicValue.classbin1735 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/analysis/BasicVerifier.classbin6983 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/analysis/Frame.classbin9369 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/analysis/Interpreter.classbin2187 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/analysis/SimpleVerifier.classbin5038 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/analysis/SmallSet.classbin1165 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/analysis/SourceInterpreter.classbin4509 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/analysis/SourceValue.classbin909 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/analysis/Subroutine.classbin1377 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/analysis/Value.classbin142 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/package.html192
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/ASMifiable.classbin194 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/ASMifierAbstractVisitor.classbin3933 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/ASMifierAnnotationVisitor.classbin2082 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/ASMifierClassVisitor.classbin7095 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/ASMifierFieldVisitor.classbin347 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/ASMifierMethodVisitor.classbin7173 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/AbstractVisitor.classbin3054 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/CheckAnnotationAdapter.classbin2329 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/CheckClassAdapter.classbin9982 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/CheckFieldAdapter.classbin1393 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/CheckMethodAdapter$1.classbin2420 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/CheckMethodAdapter.classbin15078 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/CheckSignatureAdapter.classbin3344 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/TraceAbstractVisitor.classbin2194 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/TraceAnnotationVisitor.classbin4465 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/TraceClassVisitor.classbin7239 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/TraceFieldVisitor.classbin959 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/TraceMethodVisitor.classbin8844 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/TraceSignatureVisitor.classbin3498 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/Traceable.classbin174 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/package.html40
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$AnnotationDefaultRule.classbin1141 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$AnnotationParameterRule.classbin1512 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$AnnotationRule.classbin1600 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$AnnotationValueAnnotationRule.classbin1246 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$AnnotationValueArrayRule.classbin1195 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$AnnotationValueEnumRule.classbin1027 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$AnnotationValueRule.classbin1123 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$ClassRule.classbin1509 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$ExceptionRule.classbin977 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$ExceptionsRule.classbin1480 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$FieldRule.classbin1590 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$FrameRule.classbin2013 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$FrameTypeRule.classbin1282 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$InnerClassRule.classbin1130 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$InterfaceRule.classbin977 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$InterfacesRule.classbin1498 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$LabelRule.classbin1103 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$LineNumberRule.classbin1215 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$LocalVarRule.classbin1417 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$LookupSwitchLabelRule.classbin1135 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$LookupSwitchRule.classbin2094 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$MaxRule.classbin1051 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$MethodRule.classbin1357 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$Opcode.classbin378 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$OpcodeGroup.classbin606 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$OpcodesRule.classbin2777 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$OuterClassRule.classbin1046 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$Rule.classbin4016 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$RuleSet.classbin1498 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$SourceRule.classbin994 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$TableSwitchLabelRule.classbin1089 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$TableSwitchRule.classbin2056 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$TryCatchRule.classbin1322 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler.classbin11629 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/Processor$ASMContentHandlerFactory.classbin750 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/Processor$ContentHandlerFactory.classbin319 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/Processor$EntryElement.classbin387 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/Processor$InputSlicingHandler.classbin1841 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/Processor$OutputSlicingHandler.classbin2706 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/Processor$ProtectedInputStream.classbin681 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/Processor$SAXWriter.classbin3193 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/Processor$SAXWriterFactory.classbin754 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/Processor$SingleDocElement.classbin730 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/Processor$SubdocumentHandlerFactory.classbin644 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/Processor$TransformerHandlerFactory.classbin1435 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/Processor$ZipEntryElement.classbin907 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/Processor.classbin8928 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/SAXAdapter.classbin1392 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/SAXAnnotationAdapter.classbin3526 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/SAXClassAdapter.classbin4762 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/SAXCodeAdapter.classbin6565 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/SAXFieldAdapter.classbin974 -> 0 bytes
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/asm-xml.dtd343
-rw-r--r--plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/package.html96
-rw-r--r--plugins/org.eclipse.persistence.asm/readme.html4
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/AnnotationVisitor.java133
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/AnnotationWriter.java126
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/Attribute.java196
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/ByteVector.java149
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/ClassAdapter.java121
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/ClassReader.java3252
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/ClassVisitor.java337
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/ClassWriter.java892
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/Context.java146
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/Edge.java3
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/FieldVisitor.java109
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/FieldWriter.java146
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/Frame.java1040
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/Handle.java171
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/Handler.java54
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/Item.java180
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/Label.java151
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/MethodAdapter.java195
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/MethodVisitor.java898
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/MethodWriter.java1588
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/Opcodes.java33
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/Type.java376
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/TypePath.java194
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/TypeReference.java453
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/attrs/package.html (renamed from plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/analysis/package.html)43
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/commons/AdviceAdapter.java747
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/commons/AnalyzerAdapter.java1068
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/commons/CodeSizeEvaluator.java92
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/commons/EmptyVisitor.java238
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/commons/GeneratorAdapter.java910
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/commons/InstructionAdapter.java1247
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/commons/JSRInlinerAdapter.java358
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/commons/LocalVariablesSorter.java239
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/commons/Method.java99
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/commons/Remapper.java136
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/commons/RemappingAnnotationAdapter.java49
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/commons/RemappingClassAdapter.java120
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/commons/RemappingFieldAdapter.java36
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/commons/RemappingMethodAdapter.java244
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/commons/RemappingSignatureAdapter.java43
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/commons/SerialVersionUIDAdder.java209
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/commons/SimpleRemapper.java19
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/commons/StaticInitMerger.java40
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/commons/TableSwitchGenerator.java8
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/commons/TryCatchBlockSorter.java72
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/commons/package.html18
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/package.html46
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/signature/SignatureReader.java190
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/signature/SignatureVisitor.java137
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/signature/SignatureWriter.java24
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/signature/package.html2
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/AbstractInsnNode.java137
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/AnnotationNode.java108
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/ClassNode.java281
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/FieldInsnNode.java45
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/FieldNode.java234
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/FrameNode.java140
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/IincInsnNode.java16
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/InnerClassNode.java42
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/InsnList.java224
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/InsnNode.java43
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/IntInsnNode.java23
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/InvokeDynamicInsnNode.java102
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/JumpInsnNode.java36
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/LabelNode.java9
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/LdcInsnNode.java17
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/LineNumberNode.java15
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/LocalVariableAnnotationNode.java157
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/LocalVariableNode.java47
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/LookupSwitchInsnNode.java51
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/MemberNode.java120
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/MethodInsnNode.java75
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/MethodNode.java619
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/MultiANewArrayInsnNode.java16
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/ParameterNode.java (renamed from plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/util/ASMifierFieldVisitor.java)50
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/TableSwitchInsnNode.java50
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/TryCatchBlockNode.java93
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/TypeAnnotationNode.java100
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/TypeInsnNode.java25
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/VarInsnNode.java29
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/analysis/Analyzer.java252
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/analysis/AnalyzerException.java15
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/analysis/BasicInterpreter.java500
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/analysis/BasicValue.java22
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/analysis/BasicVerifier.java636
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/analysis/Frame.java895
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/analysis/Interpreter.java136
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/analysis/SimpleVerifier.java153
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/analysis/SmallSet.java32
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/analysis/SourceInterpreter.java198
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/analysis/SourceValue.java18
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/analysis/Subroutine.java17
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/analysis/Value.java2
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/analysis/package.html8
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/package.html74
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/util/ASMifiable.java23
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/util/ASMifier.java1285
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/util/ASMifierAbstractVisitor.java222
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/util/ASMifierAnnotationVisitor.java127
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/util/ASMifierClassVisitor.java575
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/util/ASMifierMethodVisitor.java443
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/util/AbstractVisitor.java202
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/util/CheckAnnotationAdapter.java48
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/util/CheckClassAdapter.java798
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/util/CheckFieldAdapter.java73
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/util/CheckMethodAdapter.java1320
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/util/CheckSignatureAdapter.java78
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/util/Printer.java589
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/util/Textifiable.java (renamed from plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/util/Traceable.java)24
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/util/Textifier.java1459
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/util/TraceAbstractVisitor.java179
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/util/TraceAnnotationVisitor.java247
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/util/TraceClassVisitor.java527
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/util/TraceFieldVisitor.java65
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/util/TraceMethodVisitor.java639
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/util/TraceSignatureVisitor.java81
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/util/package.html2
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler.java704
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/xml/Processor.java447
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/xml/SAXAdapter.java17
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/xml/SAXAnnotationAdapter.java168
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/xml/SAXClassAdapter.java148
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/xml/SAXCodeAdapter.java402
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/xml/SAXFieldAdapter.java41
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/xml/asm-xml.dtd14
-rw-r--r--plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/xml/package.html20
297 files changed, 20405 insertions, 14724 deletions
diff --git a/plugins/org.eclipse.persistence.asm/.classpath b/plugins/org.eclipse.persistence.asm/.classpath
index 06376c7..121e527 100644
--- a/plugins/org.eclipse.persistence.asm/.classpath
+++ b/plugins/org.eclipse.persistence.asm/.classpath
@@ -1,7 +1,7 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry exported="true" kind="lib" path="" sourcepath="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/org.eclipse.persistence.asm/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.persistence.asm/.settings/org.eclipse.jdt.core.prefs
index 0ed7177..dd358ad 100644
--- a/plugins/org.eclipse.persistence.asm/.settings/org.eclipse.jdt.core.prefs
+++ b/plugins/org.eclipse.persistence.asm/.settings/org.eclipse.jdt.core.prefs
@@ -1,12 +1,16 @@
-#Wed Apr 30 15:17:25 EDT 2008
eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
org.eclipse.jdt.core.compiler.problem.deprecation=warning
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
@@ -54,3 +58,4 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=di
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.6
diff --git a/plugins/org.eclipse.persistence.asm/META-INF/MANIFEST.MF b/plugins/org.eclipse.persistence.asm/META-INF/MANIFEST.MF
index 43d6180..6f75cca 100644
--- a/plugins/org.eclipse.persistence.asm/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.persistence.asm/META-INF/MANIFEST.MF
@@ -1,25 +1,41 @@
Manifest-Version: 1.0
-Export-Package: org.eclipse.persistence.internal.libraries.asm;version="3.3.1",
- org.eclipse.persistence.internal.libraries.asm.commons;version="3.3.1",
- org.eclipse.persistence.internal.libraries.asm.signature;version="3.3.1",
- org.eclipse.persistence.internal.libraries.asm.tree;version="3.3.1",
- org.eclipse.persistence.internal.libraries.asm.tree.analysis;version="3.3.1",
- org.eclipse.persistence.internal.libraries.asm.util;version="3.3.1",
- org.eclipse.persistence.internal.libraries.asm.xml;version="3.3.1"
-Implementation-Version: 3.3.1.v201302191223
+Export-Package: org.eclipse.persistence.internal.libraries.asm.signature;version="5.0.1",
+ org.eclipse.persistence.internal.libraries.asm.commons;version="5.0.1";
+ uses:="org.eclipse.persistence.internal.libraries.asm,
+ org.eclipse.persistence.internal.libraries.asm.tree,
+ org.eclipse.persistence.internal.libraries.asm.signature",
+ org.eclipse.persistence.internal.libraries.asm.util;version="5.0.1";
+ uses:="org.eclipse.persistence.internal.libraries.asm,
+ org.eclipse.persistence.internal.libraries.asm.tree.analysis,
+ org.eclipse.persistence.internal.libraries.asm.tree,
+ org.eclipse.persistence.internal.libraries.asm.signature",
+ org.eclipse.persistence.internal.libraries.asm.tree.analysis;version="5.0.1";
+ uses:="org.eclipse.persistence.internal.libraries.asm,
+ org.eclipse.persistence.internal.libraries.asm.tree",
+ org.eclipse.persistence.internal.libraries.asm;version="5.0.1",
+ org.eclipse.persistence.internal.libraries.asm.xml;version="5.0.1";
+ uses:="org.xml.sax,
+ org.eclipse.persistence.internal.libraries.asm,
+ org.xml.sax.helpers,
+ org.xml.sax.ext,
+ javax.xml.transform.sax,
+ javax.xml.transform,
+ javax.xml.transform.stream,
+ org.eclipse.persistence.internal.libraries.asm.util",
+ org.eclipse.persistence.internal.libraries.asm.tree;version="5.0.1";
+ uses:="org.eclipse.persistence.internal.libraries.asm"
Bundle-Name: EclipseLink ASM
Created-By: 1.6.0_21 (Sun Microsystems Inc.)
HK2-Bundle-Name: org.eclipse.persistence:org.eclipse.persistence.asm
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Implementation-Vendor: Eclipse.org - EclipseLink Project
Bundle-Vendor: Eclipse.org - EclipseLink Project
-Bundle-Version: 3.3.1.v201302191223
+Bundle-Version: 5.0.1.qualifier
Bundle-ManifestVersion: 2
-Import-Package: javax.xml.transform,
- javax.xml.transform.sax,
- javax.xml.transform.stream,
- org.xml.sax,
- org.xml.sax.ext,
- org.xml.sax.helpers
+Import-Package: javax.xml.transform;resolution:=optional,
+ javax.xml.transform.sax;resolution:=optional,
+ javax.xml.transform.stream;resolution:=optional,
+ org.xml.sax;resolution:=optional,
+ org.xml.sax.ext;resolution:=optional,
+ org.xml.sax.helpers;resolution:=optional
Bundle-SymbolicName: org.eclipse.persistence.asm
-
diff --git a/plugins/org.eclipse.persistence.asm/build.properties b/plugins/org.eclipse.persistence.asm/build.properties
index 5abbef8..39d1f82 100644
--- a/plugins/org.eclipse.persistence.asm/build.properties
+++ b/plugins/org.eclipse.persistence.asm/build.properties
@@ -1,4 +1,6 @@
source.. = src/
output.. = bin/
-bin.includes = org/,\
- META-INF/
+bin.includes = .,\
+ META-INF/,\
+ about.html,\
+ readme.html
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/AnnotationVisitor.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/AnnotationVisitor.class
deleted file mode 100644
index 4cad878..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/AnnotationVisitor.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/AnnotationWriter.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/AnnotationWriter.class
deleted file mode 100644
index 7957be9..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/AnnotationWriter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/Attribute.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/Attribute.class
deleted file mode 100644
index 6c62456..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/Attribute.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/ByteVector.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/ByteVector.class
deleted file mode 100644
index 44f39c8..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/ByteVector.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/ClassAdapter.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/ClassAdapter.class
deleted file mode 100644
index 8d6aaab..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/ClassAdapter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/ClassReader.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/ClassReader.class
deleted file mode 100644
index 07f9fd7..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/ClassReader.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/ClassVisitor.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/ClassVisitor.class
deleted file mode 100644
index 526a775..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/ClassVisitor.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/ClassWriter.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/ClassWriter.class
deleted file mode 100644
index 0326cf0..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/ClassWriter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/Edge.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/Edge.class
deleted file mode 100644
index 9e6dcb2..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/Edge.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/FieldVisitor.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/FieldVisitor.class
deleted file mode 100644
index 36c6483..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/FieldVisitor.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/FieldWriter.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/FieldWriter.class
deleted file mode 100644
index 58b09b0..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/FieldWriter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/Frame.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/Frame.class
deleted file mode 100644
index 0c991e0..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/Frame.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/Handler.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/Handler.class
deleted file mode 100644
index f47aace..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/Handler.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/Item.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/Item.class
deleted file mode 100644
index 73dd1a5..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/Item.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/Label.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/Label.class
deleted file mode 100644
index 2b81423..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/Label.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/MethodAdapter.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/MethodAdapter.class
deleted file mode 100644
index e243571..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/MethodAdapter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/MethodVisitor.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/MethodVisitor.class
deleted file mode 100644
index 6640603..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/MethodVisitor.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/MethodWriter.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/MethodWriter.class
deleted file mode 100644
index 9cb6a07..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/MethodWriter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/Opcodes.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/Opcodes.class
deleted file mode 100644
index a82f492..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/Opcodes.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/Type.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/Type.class
deleted file mode 100644
index dffbf5d..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/Type.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/AdviceAdapter.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/AdviceAdapter.class
deleted file mode 100644
index e7637f4..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/AdviceAdapter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/AnalyzerAdapter.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/AnalyzerAdapter.class
deleted file mode 100644
index 25c10f5..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/AnalyzerAdapter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/CodeSizeEvaluator.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/CodeSizeEvaluator.class
deleted file mode 100644
index 5037375..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/CodeSizeEvaluator.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/EmptyVisitor.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/EmptyVisitor.class
deleted file mode 100644
index 44ab8fc..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/EmptyVisitor.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/GeneratorAdapter.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/GeneratorAdapter.class
deleted file mode 100644
index 7fd6258..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/GeneratorAdapter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/InstructionAdapter.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/InstructionAdapter.class
deleted file mode 100644
index b9f8e47..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/InstructionAdapter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/JSRInlinerAdapter$Instantiation.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/JSRInlinerAdapter$Instantiation.class
deleted file mode 100644
index caab787..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/JSRInlinerAdapter$Instantiation.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/JSRInlinerAdapter$Subroutine.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/JSRInlinerAdapter$Subroutine.class
deleted file mode 100644
index a9e4b89..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/JSRInlinerAdapter$Subroutine.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/JSRInlinerAdapter.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/JSRInlinerAdapter.class
deleted file mode 100644
index 12b8709..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/JSRInlinerAdapter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/LocalVariablesSorter.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/LocalVariablesSorter.class
deleted file mode 100644
index a30e3b5..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/LocalVariablesSorter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/Method.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/Method.class
deleted file mode 100644
index 07c2ee2..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/Method.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/Remapper.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/Remapper.class
deleted file mode 100644
index 2210935..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/Remapper.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/RemappingAnnotationAdapter.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/RemappingAnnotationAdapter.class
deleted file mode 100644
index 551b813..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/RemappingAnnotationAdapter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/RemappingClassAdapter.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/RemappingClassAdapter.class
deleted file mode 100644
index df13324..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/RemappingClassAdapter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/RemappingFieldAdapter.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/RemappingFieldAdapter.class
deleted file mode 100644
index 4aa81f2..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/RemappingFieldAdapter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/RemappingMethodAdapter.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/RemappingMethodAdapter.class
deleted file mode 100644
index 179ac60..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/RemappingMethodAdapter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/RemappingSignatureAdapter.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/RemappingSignatureAdapter.class
deleted file mode 100644
index 2f9a379..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/RemappingSignatureAdapter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/SerialVersionUIDAdder$Item.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/SerialVersionUIDAdder$Item.class
deleted file mode 100644
index 90898ca..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/SerialVersionUIDAdder$Item.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/SerialVersionUIDAdder.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/SerialVersionUIDAdder.class
deleted file mode 100644
index 9b98fb5..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/SerialVersionUIDAdder.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/SimpleRemapper.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/SimpleRemapper.class
deleted file mode 100644
index 676b8fd..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/SimpleRemapper.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/StaticInitMerger.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/StaticInitMerger.class
deleted file mode 100644
index 829cf7a..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/StaticInitMerger.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/TableSwitchGenerator.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/TableSwitchGenerator.class
deleted file mode 100644
index 057556b..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/TableSwitchGenerator.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/TryCatchBlockSorter$1.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/TryCatchBlockSorter$1.class
deleted file mode 100644
index 7f42424..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/TryCatchBlockSorter$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/TryCatchBlockSorter.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/TryCatchBlockSorter.class
deleted file mode 100644
index e6e821f..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/TryCatchBlockSorter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/package.html b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/package.html
deleted file mode 100644
index 07e634e..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/commons/package.html
+++ /dev/null
@@ -1,48 +0,0 @@
-<html>
-<!--
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2005 INRIA, France Telecom
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
--->
-<body>
-Provides some useful class and method adapters. <i>The preferred way of using
-these adapters is by chaining them together and to custom adapters (instead of
-inheriting from them)</i>. Indeed this approach provides more combination
-possibilities than inheritance. For instance, suppose you want to implement an
-adapter MyAdapter than needs sorted local variables and intermediate stack map
-frame values taking into account the local variables sort. By using inheritance,
-this would require MyAdapter to extend AnalyzerAdapter, itself extending
-LocalVariablesSorter. But AnalyzerAdapter is not a subclass of
-LocalVariablesSorter, so this is not possible. On the contrary, by using
-delegation, you can make LocalVariablesSorter delegate to AnalyzerAdapter,
-itself delegating to MyAdapter. In this case AnalyzerAdapter computes
-intermediate frames based on the output of LocalVariablesSorter, and MyAdapter
-can add new locals by calling the newLocal method on LocalVariablesSorter, and
-can get the stack map frame state before each instruction by reading the locals
-and stack fields in AnalyzerAdapter (this requires references from MyAdapter
-back to LocalVariablesSorter and AnalyzerAdapter).
-</body> \ No newline at end of file
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/package.html b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/package.html
deleted file mode 100644
index 4362fe5..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/package.html
+++ /dev/null
@@ -1,87 +0,0 @@
-<html>
-<!--
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2005 INRIA, France Telecom
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
--->
-<body>
-Provides a small and fast bytecode manipulation framework.
-
-<p>
-The <a href="http://www.objectweb.org/asm">ASM</a> framework is organized
-around the {@link org.objectweb.asm.ClassVisitor ClassVisitor},
-{@link org.objectweb.asm.FieldVisitor FieldVisitor} and
-{@link org.objectweb.asm.MethodVisitor MethodVisitor} interfaces, which allow
-one to visit the fields and methods of a class, including the bytecode
-instructions of each method.
-
-<p>
-In addition to these main interfaces, ASM provides a {@link
-org.objectweb.asm.ClassReader ClassReader} class, that can parse an
-existing class and make a given visitor visit it. ASM also provides
-a {@link org.objectweb.asm.ClassWriter ClassWriter} class, which is
-a visitor that generates Java class files.
-
-<p>
-In order to generate a class from scratch, only the {@link
-org.objectweb.asm.ClassWriter ClassWriter} class is necessary. Indeed,
-in order to generate a class, one must just call its visit<i>XXX</i>
-methods with the appropriate arguments to generate the desired fields
-and methods. See the "helloworld" example in the ASM distribution for
-more details about class generation.
-
-<p>
-In order to modify existing classes, one must use a {@link
-org.objectweb.asm.ClassReader ClassReader} class to analyze
-the original class, a class modifier, and a {@link org.objectweb.asm.ClassWriter
-ClassWriter} to construct the modified class. The class modifier
-is just a {@link org.objectweb.asm.ClassVisitor ClassVisitor}
-that delegates most of the work to another {@link org.objectweb.asm.ClassVisitor
-ClassVisitor}, but that sometimes changes some parameter values,
-or call additional methods, in order to implement the desired
-modification process. In order to make it easier to implement such
-class modifiers, ASM provides the {@link org.objectweb.asm.ClassAdapter
-ClassAdapter} and {@link org.objectweb.asm.MethodAdapter MethodAdapter}
-classes, which implement the {@link org.objectweb.asm.ClassVisitor ClassVisitor}
-and {@link org.objectweb.asm.MethodVisitor MethodVisitor} interfaces by
-delegating all work to other visitors. See the "adapt" example in the ASM
-distribution for more details about class modification.
-
-<p>
-The size of the core ASM library, <tt>asm.jar</tt>, is only 42KB, which is much
-smaller than the size of the
-<a href="http://jakarta.apache.org/bcel">BCEL</a> library (504KB), and than the
-size of the
-<a href="http://serp.sourceforge.net">SERP</a> library (150KB). ASM is also
-much faster than these tools. Indeed the overhead of a load time class
-transformation process is of the order of 60% with ASM, 700% or more with BCEL,
-and 1100% or more with SERP (see the <tt>test/perf</tt> directory in the ASM
-distribution)!
-
-@since ASM 1.3
-</body>
-</html>
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/signature/SignatureReader.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/signature/SignatureReader.class
deleted file mode 100644
index 24f773b..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/signature/SignatureReader.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/signature/SignatureVisitor.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/signature/SignatureVisitor.class
deleted file mode 100644
index 54c8561..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/signature/SignatureVisitor.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/signature/SignatureWriter.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/signature/SignatureWriter.class
deleted file mode 100644
index 7832d25..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/signature/SignatureWriter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/signature/package.html b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/signature/package.html
deleted file mode 100644
index 21f103a..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/signature/package.html
+++ /dev/null
@@ -1,36 +0,0 @@
-<html>
-<!--
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2005 INRIA, France Telecom
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
--->
-<body>
-Provides support for type signatures.
-
-@since ASM 2.0
-</body>
-</html>
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/AbstractInsnNode.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/AbstractInsnNode.class
deleted file mode 100644
index 3273e2d..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/AbstractInsnNode.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/AnnotationNode.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/AnnotationNode.class
deleted file mode 100644
index 16b4d1e..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/AnnotationNode.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/ClassNode.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/ClassNode.class
deleted file mode 100644
index 2e182ea..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/ClassNode.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/FieldInsnNode.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/FieldInsnNode.class
deleted file mode 100644
index 02b96c1..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/FieldInsnNode.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/FieldNode.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/FieldNode.class
deleted file mode 100644
index fe9ee0c..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/FieldNode.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/FrameNode.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/FrameNode.class
deleted file mode 100644
index f3b2c2a..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/FrameNode.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/IincInsnNode.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/IincInsnNode.class
deleted file mode 100644
index 627f916..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/IincInsnNode.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/InnerClassNode.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/InnerClassNode.class
deleted file mode 100644
index f5dea3c..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/InnerClassNode.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/InsnList$InsnListIterator.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/InsnList$InsnListIterator.class
deleted file mode 100644
index 7da5242..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/InsnList$InsnListIterator.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/InsnList.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/InsnList.class
deleted file mode 100644
index 2e1a224..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/InsnList.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/InsnNode.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/InsnNode.class
deleted file mode 100644
index c2a2ad6..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/InsnNode.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/IntInsnNode.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/IntInsnNode.class
deleted file mode 100644
index 5bad551..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/IntInsnNode.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/JumpInsnNode.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/JumpInsnNode.class
deleted file mode 100644
index 6f0244f..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/JumpInsnNode.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/LabelNode.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/LabelNode.class
deleted file mode 100644
index 482a911..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/LabelNode.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/LdcInsnNode.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/LdcInsnNode.class
deleted file mode 100644
index aad734a..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/LdcInsnNode.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/LineNumberNode.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/LineNumberNode.class
deleted file mode 100644
index 5bacd56..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/LineNumberNode.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/LocalVariableNode.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/LocalVariableNode.class
deleted file mode 100644
index 3da1789..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/LocalVariableNode.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/LookupSwitchInsnNode.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/LookupSwitchInsnNode.class
deleted file mode 100644
index 9bbfda4..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/LookupSwitchInsnNode.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/MemberNode.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/MemberNode.class
deleted file mode 100644
index e1dcf6f..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/MemberNode.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/MethodInsnNode.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/MethodInsnNode.class
deleted file mode 100644
index ae6510e..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/MethodInsnNode.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/MethodNode$1.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/MethodNode$1.class
deleted file mode 100644
index 763baf4..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/MethodNode$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/MethodNode.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/MethodNode.class
deleted file mode 100644
index 5b72cc2..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/MethodNode.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/MultiANewArrayInsnNode.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/MultiANewArrayInsnNode.class
deleted file mode 100644
index 7154fd3..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/MultiANewArrayInsnNode.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/TableSwitchInsnNode.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/TableSwitchInsnNode.class
deleted file mode 100644
index e9d7833..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/TableSwitchInsnNode.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/TryCatchBlockNode.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/TryCatchBlockNode.class
deleted file mode 100644
index 7153556..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/TryCatchBlockNode.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/TypeInsnNode.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/TypeInsnNode.class
deleted file mode 100644
index b29c3ff..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/TypeInsnNode.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/VarInsnNode.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/VarInsnNode.class
deleted file mode 100644
index 57268c5..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/VarInsnNode.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/analysis/Analyzer.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/analysis/Analyzer.class
deleted file mode 100644
index 97fe1ae..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/analysis/Analyzer.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/analysis/AnalyzerException.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/analysis/AnalyzerException.class
deleted file mode 100644
index 472feea..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/analysis/AnalyzerException.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/analysis/BasicInterpreter.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/analysis/BasicInterpreter.class
deleted file mode 100644
index 536e951..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/analysis/BasicInterpreter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/analysis/BasicValue.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/analysis/BasicValue.class
deleted file mode 100644
index e60af0d..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/analysis/BasicValue.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/analysis/BasicVerifier.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/analysis/BasicVerifier.class
deleted file mode 100644
index f9407b7..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/analysis/BasicVerifier.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/analysis/Frame.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/analysis/Frame.class
deleted file mode 100644
index 7999f0a..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/analysis/Frame.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/analysis/Interpreter.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/analysis/Interpreter.class
deleted file mode 100644
index a265b08..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/analysis/Interpreter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/analysis/SimpleVerifier.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/analysis/SimpleVerifier.class
deleted file mode 100644
index e23b19b..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/analysis/SimpleVerifier.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/analysis/SmallSet.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/analysis/SmallSet.class
deleted file mode 100644
index 75de700..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/analysis/SmallSet.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/analysis/SourceInterpreter.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/analysis/SourceInterpreter.class
deleted file mode 100644
index 991b906..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/analysis/SourceInterpreter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/analysis/SourceValue.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/analysis/SourceValue.class
deleted file mode 100644
index 5eec20d..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/analysis/SourceValue.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/analysis/Subroutine.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/analysis/Subroutine.class
deleted file mode 100644
index 7168fe4..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/analysis/Subroutine.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/analysis/Value.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/analysis/Value.class
deleted file mode 100644
index 1dddc9b..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/analysis/Value.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/package.html b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/package.html
deleted file mode 100644
index db68645..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/tree/package.html
+++ /dev/null
@@ -1,192 +0,0 @@
-<html>
-<!--
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2005 INRIA, France Telecom
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
--->
-<body>
-
-<p>
-Provides an ASM visitor that constructs a tree representation of the
-classes it visits. This class adapter can be useful to implement "complex"
-class manipulation operations, i.e., operations that would be very hard to
-implement without using a tree representation (such as optimizing the number
-of local variables used by a method).
-</p>
-
-<p>
-However, this class adapter has a cost: it makes ASM bigger and slower. Indeed
-it requires more than twenty new classes, and multiplies the time needed to
-transform a class by almost two (it is almost two times faster to read, "modify"
-and write a class with a ClassAdapter than with a ClassNode). This is why
-this package is bundled in an optional <tt>asm-tree.jar</tt> library that
-is separated from (but requires) the <tt>asm.jar</tt> library, which contains
-the core ASM framework. This is also why <i><font color="red">it is recommended
-not to use this class adapter when it is possible</font></i>.
-</p>
-
-<p>
-The root class is the ClassNode, that can be created from existing bytecode. For example:
-</p>
-
-<pre>
- ClassReader cr = new ClassReader(source);
- ClassNode cn = new ClassNode();
- cr.accept(cn, true);
-</pre>
-
-<p>
-Now content of ClassNode can be modified and then
-serialized back into bytecode:
-</p>
-
-<pre>
- ClassWriter cw = new ClassWriter(true);
- cn.accept(cw);
-</pre>
-
-<p>
-Using simple ClassAdapter it is possible to create MethodNode instances per-method.
-In this example MethodNode is acting as a buffer that is flushed out at visitEnd() call:
-</p>
-
-<pre>
- ClassReader cr = new ClassReader(source);
- ClassWriter cw = new ClassWriter();
- ClassAdapter ca = new ClassAdapter(cw) {
- public MethodVisitor visitMethod(int access, String name,
- String desc, String signature, String[] exceptions) {
- final MethodVisitor mv = super.visitMethod(access, name, desc, signature, exceptions);
- MethodNode mn = new MethodNode(access, name, desc, signature, exceptions) {
- public void visitEnd() {
- // transform or analyze method code using tree API
- accept(mv);
- }
- };
- }
- };
- cr.accept(ca, true);
-</pre>
-
-<p>
-Several strategies can be used to construct method code from scratch. The first
-option is to create a MethodNode, and then create XXXInsnNode instances and
-add them to the instructions list:
-</p>
-
-<pre>
-MethodNode m = new MethodNode(...);
-m.instructions.add(new VarInsnNode(ALOAD, 0));
-...
-</pre>
-
-<p>
-Alternatively, you can use the fact that MethodNode is a MethodVisitor, and use
-that to create the XXXInsnNode and add them to the instructions list through
-the standard MethodVisitor interface:
-</p>
-
-<pre>
-MethodNode m = new MethodNode(...);
-m.visitVarInsn(ALOAD, 0);
-...
-</pre>
-
-<p>
-If you cannot generate all the instructions in sequential order, i.e. if you
-need to save some pointer in the instruction list and then insert instructions
-at that place after other instructions have been generated, you can use InsnList
-methods insert() and insertBefore() to insert instructions at saved pointer.
-</p>
-
-<pre>
-MethodNode m = new MethodNode(...);
-m.visitVarInsn(ALOAD, 0);
-AbstractInsnNode ptr = m.instructions.getLast();
-m.visitVarInsn(ALOAD, 1);
-// inserts an instruction between ALOAD 0 and ALOAD 1
-m.instructions.insert(ptr, new VarInsnNode(ALOAD, 0));
-...
-</pre>
-
-<p>
-If you need to insert instructions while iterating over an existing instruction
-list, you can also use several strategies. The first one is to use a
-ListIterator over the instruction list:
-</p>
-
-<pre>
-ListIterator it = m.instructions.iterator();
-while (it.hasNext()) {
- AbstractInsnNode n = (AbstractInsnNode) it.next();
- if (...) {
- it.add(new VarInsnNode(ALOAD, 0));
- }
-}
-</pre>
-
-<p>
-It is also possible to convert instruction list into the array and iterate trough
-array elements:
-</p>
-
-<pre>
-AbstractInsnNode[] insns = m.instructions.toArray();
-for(int i = 0; i&lt;insns.length; i++) {
- AbstractInsnNode n = insns[i];
- if (...) {
- m.instructions.insert(n, new VarInsnNode(ALOAD, 0));
- }
-}
-</pre>
-
-<p>
-If you want to insert these instructions through the MethodVisitor interface,
-you can use another instance of MethodNode as a MethodVisitor and then
-insert instructions collected by that instance into the instruction list.
-For example:
-</p>
-
-<pre>
-AbstractInsnNode[] insns = m.instructions.toArray();
-for(int i = 0; i&lt;insns.length; i++) {
- AbstractInsnNode n = insns[i];
- if (...) {
- MethodNode mn = new MethodNode();
- mn.visitVarInsn(ALOAD, 0);
- mn.visitVarInsn(ALOAD, 1);
- m.instructions.insert(n, mn.instructions);
- }
-}
-</pre>
-
-<p>
-@since ASM 1.3.3
-</p>
-
-</body>
-</html>
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/ASMifiable.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/ASMifiable.class
deleted file mode 100644
index c7818b4..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/ASMifiable.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/ASMifierAbstractVisitor.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/ASMifierAbstractVisitor.class
deleted file mode 100644
index f6ef13e..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/ASMifierAbstractVisitor.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/ASMifierAnnotationVisitor.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/ASMifierAnnotationVisitor.class
deleted file mode 100644
index 44999ba..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/ASMifierAnnotationVisitor.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/ASMifierClassVisitor.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/ASMifierClassVisitor.class
deleted file mode 100644
index c758e78..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/ASMifierClassVisitor.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/ASMifierFieldVisitor.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/ASMifierFieldVisitor.class
deleted file mode 100644
index 9876ace..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/ASMifierFieldVisitor.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/ASMifierMethodVisitor.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/ASMifierMethodVisitor.class
deleted file mode 100644
index 5e2b1c6..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/ASMifierMethodVisitor.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/AbstractVisitor.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/AbstractVisitor.class
deleted file mode 100644
index ac56abc..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/AbstractVisitor.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/CheckAnnotationAdapter.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/CheckAnnotationAdapter.class
deleted file mode 100644
index ddda8ab..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/CheckAnnotationAdapter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/CheckClassAdapter.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/CheckClassAdapter.class
deleted file mode 100644
index 49c49ce..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/CheckClassAdapter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/CheckFieldAdapter.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/CheckFieldAdapter.class
deleted file mode 100644
index 910e181..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/CheckFieldAdapter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/CheckMethodAdapter$1.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/CheckMethodAdapter$1.class
deleted file mode 100644
index 09276ad..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/CheckMethodAdapter$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/CheckMethodAdapter.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/CheckMethodAdapter.class
deleted file mode 100644
index 6a350b8..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/CheckMethodAdapter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/CheckSignatureAdapter.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/CheckSignatureAdapter.class
deleted file mode 100644
index 4491d26..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/CheckSignatureAdapter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/TraceAbstractVisitor.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/TraceAbstractVisitor.class
deleted file mode 100644
index 06ee7ac..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/TraceAbstractVisitor.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/TraceAnnotationVisitor.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/TraceAnnotationVisitor.class
deleted file mode 100644
index 4aad2a5..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/TraceAnnotationVisitor.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/TraceClassVisitor.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/TraceClassVisitor.class
deleted file mode 100644
index ffbd700..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/TraceClassVisitor.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/TraceFieldVisitor.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/TraceFieldVisitor.class
deleted file mode 100644
index eef9e7d..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/TraceFieldVisitor.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/TraceMethodVisitor.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/TraceMethodVisitor.class
deleted file mode 100644
index 3798526..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/TraceMethodVisitor.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/TraceSignatureVisitor.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/TraceSignatureVisitor.class
deleted file mode 100644
index 3f48898..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/TraceSignatureVisitor.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/Traceable.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/Traceable.class
deleted file mode 100644
index 74a2c5f..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/Traceable.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/package.html b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/package.html
deleted file mode 100644
index e967b8b..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/util/package.html
+++ /dev/null
@@ -1,40 +0,0 @@
-<html>
-<!--
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2005 INRIA, France Telecom
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
--->
-<body>
-Provides ASM visitors that can be useful for programming and
-debugging purposes. These class visitors are normally not used by applications
-at runtime. This is why they are bundled in an optional <tt>asm-util.jar</tt>
-library that is separated from (but requires) the <tt>asm.jar</tt> library,
-which contains the core ASM framework.
-
-@since ASM 1.3.2
-</body>
-</html>
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$AnnotationDefaultRule.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$AnnotationDefaultRule.class
deleted file mode 100644
index 6b946c3..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$AnnotationDefaultRule.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$AnnotationParameterRule.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$AnnotationParameterRule.class
deleted file mode 100644
index 1acf14b..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$AnnotationParameterRule.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$AnnotationRule.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$AnnotationRule.class
deleted file mode 100644
index 91b5a12..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$AnnotationRule.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$AnnotationValueAnnotationRule.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$AnnotationValueAnnotationRule.class
deleted file mode 100644
index c0e027a..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$AnnotationValueAnnotationRule.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$AnnotationValueArrayRule.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$AnnotationValueArrayRule.class
deleted file mode 100644
index 248ea15..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$AnnotationValueArrayRule.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$AnnotationValueEnumRule.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$AnnotationValueEnumRule.class
deleted file mode 100644
index f953b81..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$AnnotationValueEnumRule.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$AnnotationValueRule.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$AnnotationValueRule.class
deleted file mode 100644
index 5d52363..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$AnnotationValueRule.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$ClassRule.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$ClassRule.class
deleted file mode 100644
index 06e2ff6..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$ClassRule.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$ExceptionRule.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$ExceptionRule.class
deleted file mode 100644
index 6b6489e..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$ExceptionRule.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$ExceptionsRule.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$ExceptionsRule.class
deleted file mode 100644
index e7b9838..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$ExceptionsRule.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$FieldRule.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$FieldRule.class
deleted file mode 100644
index b45bffa..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$FieldRule.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$FrameRule.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$FrameRule.class
deleted file mode 100644
index 7afc90b..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$FrameRule.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$FrameTypeRule.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$FrameTypeRule.class
deleted file mode 100644
index 7e00bee..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$FrameTypeRule.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$InnerClassRule.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$InnerClassRule.class
deleted file mode 100644
index f818e1c..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$InnerClassRule.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$InterfaceRule.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$InterfaceRule.class
deleted file mode 100644
index f1ebb1f..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$InterfaceRule.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$InterfacesRule.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$InterfacesRule.class
deleted file mode 100644
index 8d8ec6e..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$InterfacesRule.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$LabelRule.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$LabelRule.class
deleted file mode 100644
index 7c215e0..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$LabelRule.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$LineNumberRule.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$LineNumberRule.class
deleted file mode 100644
index 89f7e32..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$LineNumberRule.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$LocalVarRule.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$LocalVarRule.class
deleted file mode 100644
index 1399977..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$LocalVarRule.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$LookupSwitchLabelRule.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$LookupSwitchLabelRule.class
deleted file mode 100644
index d4cc004..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$LookupSwitchLabelRule.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$LookupSwitchRule.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$LookupSwitchRule.class
deleted file mode 100644
index f98091a..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$LookupSwitchRule.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$MaxRule.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$MaxRule.class
deleted file mode 100644
index 1a8c563..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$MaxRule.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$MethodRule.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$MethodRule.class
deleted file mode 100644
index 54aba72..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$MethodRule.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$Opcode.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$Opcode.class
deleted file mode 100644
index 1bdf177..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$Opcode.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$OpcodeGroup.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$OpcodeGroup.class
deleted file mode 100644
index 17705f4..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$OpcodeGroup.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$OpcodesRule.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$OpcodesRule.class
deleted file mode 100644
index 5f3d426..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$OpcodesRule.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$OuterClassRule.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$OuterClassRule.class
deleted file mode 100644
index 2f6bf0c..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$OuterClassRule.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$Rule.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$Rule.class
deleted file mode 100644
index 50e4022..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$Rule.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$RuleSet.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$RuleSet.class
deleted file mode 100644
index 1edc0a4..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$RuleSet.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$SourceRule.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$SourceRule.class
deleted file mode 100644
index 6db9f6b..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$SourceRule.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$TableSwitchLabelRule.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$TableSwitchLabelRule.class
deleted file mode 100644
index dbd605c..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$TableSwitchLabelRule.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$TableSwitchRule.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$TableSwitchRule.class
deleted file mode 100644
index ebde2a4..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$TableSwitchRule.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$TryCatchRule.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$TryCatchRule.class
deleted file mode 100644
index 8bde3e6..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler$TryCatchRule.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler.class
deleted file mode 100644
index 77e835a..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/ASMContentHandler.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/Processor$ASMContentHandlerFactory.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/Processor$ASMContentHandlerFactory.class
deleted file mode 100644
index d06678d..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/Processor$ASMContentHandlerFactory.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/Processor$ContentHandlerFactory.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/Processor$ContentHandlerFactory.class
deleted file mode 100644
index f012f98..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/Processor$ContentHandlerFactory.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/Processor$EntryElement.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/Processor$EntryElement.class
deleted file mode 100644
index a16344e..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/Processor$EntryElement.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/Processor$InputSlicingHandler.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/Processor$InputSlicingHandler.class
deleted file mode 100644
index ad95095..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/Processor$InputSlicingHandler.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/Processor$OutputSlicingHandler.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/Processor$OutputSlicingHandler.class
deleted file mode 100644
index d73bb68..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/Processor$OutputSlicingHandler.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/Processor$ProtectedInputStream.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/Processor$ProtectedInputStream.class
deleted file mode 100644
index ab4a2e0..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/Processor$ProtectedInputStream.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/Processor$SAXWriter.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/Processor$SAXWriter.class
deleted file mode 100644
index 6bb1e8d..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/Processor$SAXWriter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/Processor$SAXWriterFactory.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/Processor$SAXWriterFactory.class
deleted file mode 100644
index e547314..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/Processor$SAXWriterFactory.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/Processor$SingleDocElement.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/Processor$SingleDocElement.class
deleted file mode 100644
index 8a30a25..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/Processor$SingleDocElement.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/Processor$SubdocumentHandlerFactory.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/Processor$SubdocumentHandlerFactory.class
deleted file mode 100644
index d58befe..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/Processor$SubdocumentHandlerFactory.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/Processor$TransformerHandlerFactory.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/Processor$TransformerHandlerFactory.class
deleted file mode 100644
index 7251245..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/Processor$TransformerHandlerFactory.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/Processor$ZipEntryElement.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/Processor$ZipEntryElement.class
deleted file mode 100644
index b039941..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/Processor$ZipEntryElement.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/Processor.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/Processor.class
deleted file mode 100644
index eada47b..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/Processor.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/SAXAdapter.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/SAXAdapter.class
deleted file mode 100644
index ab50730..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/SAXAdapter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/SAXAnnotationAdapter.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/SAXAnnotationAdapter.class
deleted file mode 100644
index 17bb2b6..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/SAXAnnotationAdapter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/SAXClassAdapter.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/SAXClassAdapter.class
deleted file mode 100644
index bea79af..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/SAXClassAdapter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/SAXCodeAdapter.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/SAXCodeAdapter.class
deleted file mode 100644
index 289d038..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/SAXCodeAdapter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/SAXFieldAdapter.class b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/SAXFieldAdapter.class
deleted file mode 100644
index 6206350..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/SAXFieldAdapter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/asm-xml.dtd b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/asm-xml.dtd
deleted file mode 100644
index 168839a..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/asm-xml.dtd
+++ /dev/null
@@ -1,343 +0,0 @@
-<!--
- ASM XML Adapter
- Copyright (c) 2004, Eugene Kuleshov
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. Neither the name of the copyright holders nor the names of its
- contributors may be used to endorse or promote products derived from
- this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- THE POSSIBILITY OF SUCH DAMAGE.
--->
-
-<!--
- This DTD must be used to create XML documents to be processed by
- org.objectweb.asm.xml.ASMContentHandler
--->
-
-<!--
- Root element used to aggregate multiple classes into single document.
--->
-<!ELEMENT classes ( class+ )>
-
-<!--
- Root element for a single class.
--->
-<!ELEMENT class ( interfaces, ( field | innerclass | method )*)>
-<!ATTLIST class access CDATA #REQUIRED>
-<!ATTLIST class name CDATA #REQUIRED>
-<!ATTLIST class parent CDATA #REQUIRED>
-<!ATTLIST class major CDATA #REQUIRED>
-<!ATTLIST class minor CDATA #REQUIRED>
-<!ATTLIST class source CDATA #IMPLIED>
-
-<!ELEMENT interfaces ( interface* )>
-<!ELEMENT interface EMPTY>
-<!ATTLIST interface name CDATA #REQUIRED>
-
-<!ELEMENT field EMPTY>
-<!ATTLIST field access CDATA #REQUIRED>
-<!ATTLIST field desc CDATA #REQUIRED>
-<!ATTLIST field name CDATA #REQUIRED>
-<!--
- All characters out of interval 0x20 to 0x7f (inclusive) must
- be encoded (\uXXXX) and character '\' must be replaced by "\\"
--->
-<!ATTLIST field value CDATA #IMPLIED>
-
-<!ELEMENT innerclass EMPTY>
-<!ATTLIST innerclass access CDATA #REQUIRED>
-<!ATTLIST innerclass innerName CDATA #IMPLIED>
-<!ATTLIST innerclass name CDATA #REQUIRED>
-<!ATTLIST innerclass outerName CDATA #IMPLIED>
-
-<!--
- Root element for method definition.
--->
-<!ELEMENT method ( exceptions, code? )>
-<!ATTLIST method access CDATA #REQUIRED>
-<!ATTLIST method desc CDATA #REQUIRED>
-<!ATTLIST method name CDATA #REQUIRED>
-
-<!ELEMENT exceptions ( exception* )>
-<!ELEMENT exception EMPTY>
-<!ATTLIST exception name CDATA #REQUIRED>
-
-<!--
- code element contains bytecode instructions and definitions for labels, line numbers, try/catch and max
--->
-<!ELEMENT code (( AALOAD | AASTORE | ACONST_NULL | ALOAD | ANEWARRAY | ARETURN | ARRAYLENGTH | ASTORE | ATHROW | BALOAD | BASTORE | BIPUSH | CALOAD | CASTORE | CHECKCAST | D2F | D2I | D2L | DADD | DALOAD | DASTORE | DCMPG | DCMPL | DCONST_0 | DCONST_1 | DDIV | DLOAD | DMUL | DNEG | DREM | DRETURN | DSTORE | DSUB | DUP | DUP2 | DUP2_X1 | DUP2_X2 | DUP_X1 | DUP_X2 | F2D | F2I | F2L | FADD | FALOAD | FASTORE | FCMPG | FCMPL | FCONST_0 | FCONST_1 | FCONST_2 | FDIV | FLOAD | FMUL | FNEG | FRETURN | FSTORE | FSUB | GETFIELD | GETSTATIC | GOTO | I2B | I2C | I2D | I2F | I2L | I2S | IADD | IALOAD | IAND | IASTORE | ICONST_0 | ICONST_1 | ICONST_2 | ICONST_3 | ICONST_4 | ICONST_5 | ICONST_M1 | IDIV | IFEQ | IFGE | IFGT | IFLE | IFLT | IFNE | IFNONNULL | IFNULL | IF_ACMPEQ | IF_ACMPNE | IF_ICMPEQ | IF_ICMPGE | IF_ICMPGT | IF_ICMPLE | IF_ICMPLT | IF_ICMPNE | IINC | ILOAD | IMUL | INEG | INSTANCEOF | INVOKEINTERFACE | INVOKESPECIAL | INVOKESTATIC | INVOKEVIRTUAL | IOR | IREM | IRETURN | ISHL | ISHR | ISTORE | ISUB | IUSHR | IXOR | JSR | L2D | L2F | L2I | LADD | LALOAD | LAND | LASTORE | LCMP | LCONST_0 | LCONST_1 | LDC | LDIV | LLOAD | LMUL | LNEG | LOOKUPSWITCH | LOR | LREM | LRETURN | LSHL | LSHR | LSTORE | LSUB | LUSHR | LXOR | MONITORENTER | MONITOREXIT | MULTIANEWARRAY | NEW | NEWARRAY | NOP | POP | POP2 | PUTFIELD | PUTSTATIC | RET | RETURN | SALOAD | SASTORE | SIPUSH | TABLESWITCH | Label | LineNumber | TryCatch )*, Max)>
-
-<!ELEMENT Label EMPTY>
-<!ATTLIST Label name CDATA #REQUIRED>
-
-<!ELEMENT TryCatch EMPTY>
-<!ATTLIST TryCatch end CDATA #REQUIRED>
-<!ATTLIST TryCatch handler CDATA #REQUIRED>
-<!ATTLIST TryCatch start CDATA #REQUIRED>
-<!ATTLIST TryCatch type CDATA #IMPLIED>
-
-<!ELEMENT LineNumber EMPTY>
-<!ATTLIST LineNumber line CDATA #REQUIRED>
-<!ATTLIST LineNumber start CDATA #REQUIRED>
-
-<!ELEMENT Max EMPTY>
-<!ATTLIST Max maxLocals CDATA #REQUIRED>
-<!ATTLIST Max maxStack CDATA #REQUIRED>
-
-<!ELEMENT AALOAD EMPTY>
-<!ELEMENT AASTORE EMPTY>
-<!ELEMENT ACONST_NULL EMPTY>
-<!ELEMENT ALOAD EMPTY>
-<!ATTLIST ALOAD var CDATA #REQUIRED>
-<!ELEMENT ANEWARRAY EMPTY>
-<!ATTLIST ANEWARRAY desc CDATA #REQUIRED>
-<!ELEMENT ARETURN EMPTY>
-<!ELEMENT ARRAYLENGTH EMPTY>
-<!ELEMENT ASTORE EMPTY>
-<!ATTLIST ASTORE var CDATA #REQUIRED>
-<!ELEMENT ATHROW EMPTY>
-<!ELEMENT BALOAD EMPTY>
-<!ELEMENT BASTORE EMPTY>
-<!ELEMENT BIPUSH EMPTY>
-<!ATTLIST BIPUSH value CDATA #REQUIRED>
-<!ELEMENT CALOAD EMPTY>
-<!ELEMENT CASTORE EMPTY>
-<!ELEMENT CHECKCAST EMPTY>
-<!ATTLIST CHECKCAST desc CDATA #REQUIRED>
-<!ELEMENT D2F EMPTY>
-<!ELEMENT D2I EMPTY>
-<!ELEMENT D2L EMPTY>
-<!ELEMENT DADD EMPTY>
-<!ELEMENT DALOAD EMPTY>
-<!ELEMENT DASTORE EMPTY>
-<!ELEMENT DCMPG EMPTY>
-<!ELEMENT DCMPL EMPTY>
-<!ELEMENT DCONST_0 EMPTY>
-<!ELEMENT DCONST_1 EMPTY>
-<!ELEMENT DDIV EMPTY>
-<!ELEMENT DLOAD EMPTY>
-<!ATTLIST DLOAD var CDATA #REQUIRED>
-<!ELEMENT DMUL EMPTY>
-<!ELEMENT DNEG EMPTY>
-<!ELEMENT DREM EMPTY>
-<!ELEMENT DRETURN EMPTY>
-<!ELEMENT DSTORE EMPTY>
-<!ATTLIST DSTORE var CDATA #REQUIRED>
-<!ELEMENT DSUB EMPTY>
-<!ELEMENT DUP EMPTY>
-<!ELEMENT DUP2 EMPTY>
-<!ELEMENT DUP2_X1 EMPTY>
-<!ELEMENT DUP2_X2 EMPTY>
-<!ELEMENT DUP_X1 EMPTY>
-<!ELEMENT DUP_X2 EMPTY>
-<!ELEMENT F2D EMPTY>
-<!ELEMENT F2I EMPTY>
-<!ELEMENT F2L EMPTY>
-<!ELEMENT FADD EMPTY>
-<!ELEMENT FALOAD EMPTY>
-<!ELEMENT FASTORE EMPTY>
-<!ELEMENT FCMPG EMPTY>
-<!ELEMENT FCMPL EMPTY>
-<!ELEMENT FCONST_0 EMPTY>
-<!ELEMENT FCONST_1 EMPTY>
-<!ELEMENT FCONST_2 EMPTY>
-<!ELEMENT FDIV EMPTY>
-<!ELEMENT FLOAD EMPTY>
-<!ATTLIST FLOAD var CDATA #REQUIRED>
-<!ELEMENT FMUL EMPTY>
-<!ELEMENT FNEG EMPTY>
-<!ELEMENT FRETURN EMPTY>
-<!ELEMENT FSTORE EMPTY>
-<!ATTLIST FSTORE var CDATA #REQUIRED>
-<!ELEMENT FSUB EMPTY>
-<!ELEMENT GETFIELD EMPTY>
-<!ATTLIST GETFIELD desc CDATA #REQUIRED>
-<!ATTLIST GETFIELD name CDATA #REQUIRED>
-<!ATTLIST GETFIELD owner CDATA #REQUIRED>
-<!ELEMENT GETSTATIC EMPTY>
-<!ATTLIST GETSTATIC desc CDATA #REQUIRED>
-<!ATTLIST GETSTATIC name CDATA #REQUIRED>
-<!ATTLIST GETSTATIC owner CDATA #REQUIRED>
-<!ELEMENT GOTO EMPTY>
-<!ATTLIST GOTO label CDATA #REQUIRED>
-<!ELEMENT I2B EMPTY>
-<!ELEMENT I2C EMPTY>
-<!ELEMENT I2D EMPTY>
-<!ELEMENT I2F EMPTY>
-<!ELEMENT I2L EMPTY>
-<!ELEMENT I2S EMPTY>
-<!ELEMENT IADD EMPTY>
-<!ELEMENT IALOAD EMPTY>
-<!ELEMENT IAND EMPTY>
-<!ELEMENT IASTORE EMPTY>
-<!ELEMENT ICONST_0 EMPTY>
-<!ELEMENT ICONST_1 EMPTY>
-<!ELEMENT ICONST_2 EMPTY>
-<!ELEMENT ICONST_3 EMPTY>
-<!ELEMENT ICONST_4 EMPTY>
-<!ELEMENT ICONST_5 EMPTY>
-<!ELEMENT ICONST_M1 EMPTY>
-<!ELEMENT IDIV EMPTY>
-<!ELEMENT IFEQ EMPTY>
-<!ATTLIST IFEQ label CDATA #REQUIRED>
-<!ELEMENT IFGE EMPTY>
-<!ATTLIST IFGE label CDATA #REQUIRED>
-<!ELEMENT IFGT EMPTY>
-<!ATTLIST IFGT label CDATA #REQUIRED>
-<!ELEMENT IFLE EMPTY>
-<!ATTLIST IFLE label CDATA #REQUIRED>
-<!ELEMENT IFLT EMPTY>
-<!ATTLIST IFLT label CDATA #REQUIRED>
-<!ELEMENT IFNE EMPTY>
-<!ATTLIST IFNE label CDATA #REQUIRED>
-<!ELEMENT IFNONNULL EMPTY>
-<!ATTLIST IFNONNULL label CDATA #REQUIRED>
-<!ELEMENT IFNULL EMPTY>
-<!ATTLIST IFNULL label CDATA #REQUIRED>
-<!ELEMENT IF_ACMPEQ EMPTY>
-<!ATTLIST IF_ACMPEQ label CDATA #REQUIRED>
-<!ELEMENT IF_ACMPNE EMPTY>
-<!ATTLIST IF_ACMPNE label CDATA #REQUIRED>
-<!ELEMENT IF_ICMPEQ EMPTY>
-<!ATTLIST IF_ICMPEQ label CDATA #REQUIRED>
-<!ELEMENT IF_ICMPGE EMPTY>
-<!ATTLIST IF_ICMPGE label CDATA #REQUIRED>
-<!ELEMENT IF_ICMPGT EMPTY>
-<!ATTLIST IF_ICMPGT label CDATA #REQUIRED>
-<!ELEMENT IF_ICMPLE EMPTY>
-<!ATTLIST IF_ICMPLE label CDATA #REQUIRED>
-<!ELEMENT IF_ICMPLT EMPTY>
-<!ATTLIST IF_ICMPLT label CDATA #REQUIRED>
-<!ELEMENT IF_ICMPNE EMPTY>
-<!ATTLIST IF_ICMPNE label CDATA #REQUIRED>
-<!ELEMENT IINC EMPTY>
-<!ATTLIST IINC inc CDATA #REQUIRED>
-<!ATTLIST IINC var CDATA #REQUIRED>
-<!ELEMENT ILOAD EMPTY>
-<!ATTLIST ILOAD var CDATA #REQUIRED>
-<!ELEMENT IMUL EMPTY>
-<!ELEMENT INEG EMPTY>
-<!ELEMENT INSTANCEOF EMPTY>
-<!ATTLIST INSTANCEOF desc CDATA #REQUIRED>
-<!ELEMENT INVOKEINTERFACE EMPTY>
-<!ATTLIST INVOKEINTERFACE desc CDATA #REQUIRED>
-<!ATTLIST INVOKEINTERFACE name CDATA #REQUIRED>
-<!ATTLIST INVOKEINTERFACE owner CDATA #REQUIRED>
-<!ELEMENT INVOKESPECIAL EMPTY>
-<!ATTLIST INVOKESPECIAL desc CDATA #REQUIRED>
-<!ATTLIST INVOKESPECIAL name CDATA #REQUIRED>
-<!ATTLIST INVOKESPECIAL owner CDATA #REQUIRED>
-<!ELEMENT INVOKESTATIC EMPTY>
-<!ATTLIST INVOKESTATIC desc CDATA #REQUIRED>
-<!ATTLIST INVOKESTATIC name CDATA #REQUIRED>
-<!ATTLIST INVOKESTATIC owner CDATA #REQUIRED>
-<!ELEMENT INVOKEVIRTUAL EMPTY>
-<!ATTLIST INVOKEVIRTUAL desc CDATA #REQUIRED>
-<!ATTLIST INVOKEVIRTUAL name CDATA #REQUIRED>
-<!ATTLIST INVOKEVIRTUAL owner CDATA #REQUIRED>
-<!ELEMENT INVOKEDYNAMIC EMPTY>
-<!ATTLIST INVOKEDYNAMIC desc CDATA #REQUIRED>
-<!ATTLIST INVOKEDYNAMIC name CDATA #REQUIRED>
-<!ELEMENT IOR EMPTY>
-<!ELEMENT IREM EMPTY>
-<!ELEMENT IRETURN EMPTY>
-<!ELEMENT ISHL EMPTY>
-<!ELEMENT ISHR EMPTY>
-<!ELEMENT ISTORE EMPTY>
-<!ATTLIST ISTORE var CDATA #REQUIRED>
-<!ELEMENT ISUB EMPTY>
-<!ELEMENT IUSHR EMPTY>
-<!ELEMENT IXOR EMPTY>
-<!ELEMENT JSR EMPTY>
-<!ATTLIST JSR label CDATA #REQUIRED>
-<!ELEMENT L2D EMPTY>
-<!ELEMENT L2F EMPTY>
-<!ELEMENT L2I EMPTY>
-<!ELEMENT LADD EMPTY>
-<!ELEMENT LALOAD EMPTY>
-<!ELEMENT LAND EMPTY>
-<!ELEMENT LASTORE EMPTY>
-<!ELEMENT LCMP EMPTY>
-<!ELEMENT LCONST_0 EMPTY>
-<!ELEMENT LCONST_1 EMPTY>
-<!ELEMENT LDC EMPTY>
-<!--
- All characters out of interval 0x20 to 0x7f (inclusive) must
- be encoded (\uXXXX) and character '\' must be replaced by "\\"
--->
-<!ATTLIST LDC cst CDATA #REQUIRED>
-<!ATTLIST LDC desc CDATA #REQUIRED>
-<!ELEMENT LDIV EMPTY>
-<!ELEMENT LLOAD EMPTY>
-<!ATTLIST LLOAD var CDATA #REQUIRED>
-<!ELEMENT LMUL EMPTY>
-<!ELEMENT LNEG EMPTY>
-<!ELEMENT LOR EMPTY>
-<!ELEMENT LREM EMPTY>
-<!ELEMENT LRETURN EMPTY>
-<!ELEMENT LSHL EMPTY>
-<!ELEMENT LSHR EMPTY>
-<!ELEMENT LSTORE EMPTY>
-<!ATTLIST LSTORE var CDATA #REQUIRED>
-<!ELEMENT LSUB EMPTY>
-<!ELEMENT LUSHR EMPTY>
-<!ELEMENT LXOR EMPTY>
-<!ELEMENT MONITORENTER EMPTY>
-<!ELEMENT MONITOREXIT EMPTY>
-<!ELEMENT MULTIANEWARRAY EMPTY>
-<!ATTLIST MULTIANEWARRAY desc CDATA #REQUIRED>
-<!ATTLIST MULTIANEWARRAY dims CDATA #REQUIRED>
-<!ELEMENT NEW EMPTY>
-<!ATTLIST NEW desc CDATA #REQUIRED>
-<!ELEMENT NEWARRAY EMPTY>
-<!ATTLIST NEWARRAY value CDATA #REQUIRED>
-<!ELEMENT NOP EMPTY>
-<!ELEMENT POP EMPTY>
-<!ELEMENT POP2 EMPTY>
-<!ELEMENT PUTFIELD EMPTY>
-<!ATTLIST PUTFIELD desc CDATA #REQUIRED>
-<!ATTLIST PUTFIELD name CDATA #REQUIRED>
-<!ATTLIST PUTFIELD owner CDATA #REQUIRED>
-<!ELEMENT PUTSTATIC EMPTY>
-<!ATTLIST PUTSTATIC desc CDATA #REQUIRED>
-<!ATTLIST PUTSTATIC name CDATA #REQUIRED>
-<!ATTLIST PUTSTATIC owner CDATA #REQUIRED>
-<!ELEMENT RET EMPTY>
-<!ATTLIST RET var CDATA #REQUIRED>
-<!ELEMENT RETURN EMPTY>
-<!ELEMENT SALOAD EMPTY>
-<!ELEMENT SASTORE EMPTY>
-<!ELEMENT SIPUSH EMPTY>
-<!ATTLIST SIPUSH value CDATA #REQUIRED>
-
-<!ELEMENT LOOKUPSWITCH ( label+ )>
-<!ATTLIST LOOKUPSWITCH dflt CDATA #REQUIRED>
-
-<!ELEMENT TABLESWITCH ( label+ )>
-<!ATTLIST TABLESWITCH dflt CDATA #REQUIRED>
-<!ATTLIST TABLESWITCH max CDATA #REQUIRED>
-<!ATTLIST TABLESWITCH min CDATA #REQUIRED>
-
-<!ELEMENT label EMPTY>
-<!ATTLIST label key CDATA #IMPLIED>
-<!ATTLIST label name CDATA #REQUIRED>
-
diff --git a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/package.html b/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/package.html
deleted file mode 100644
index 3bbb95f..0000000
--- a/plugins/org.eclipse.persistence.asm/org/eclipse/persistence/internal/libraries/asm/xml/package.html
+++ /dev/null
@@ -1,96 +0,0 @@
-<html>
-<!--
- * ASM XML Adapter
- * Copyright (c) 2004, Eugene Kuleshov
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
--->
-<body>
-Provides <a href="http://sax.sourceforge.net/">SAX 2.0</a> adapters for ASM
-visitors to convert classes to and from XML.
-These adapters can be chained with other SAX compliant content handlers and
-filters, eg. XSLT or XQuery engines. This package is bundled as
-a separate <tt>asm-xml.jar</tt> library and requires <tt>asm.jar</tt>.
-<p>
-<tt>ASMContentHandler</tt> and <tt>SAXClassAdapter/SAXCodeAdapter</tt>
-are using <a href="asm-xml.dtd">asm-xml.dtd</a>.
-Here is the example of bytecode to bytecode XSLT transformation.
-
-<pre>
- SAXTransformerFactory saxtf = ( SAXTransformerFactory) TransformerFactory.newInstance();
- Templates templates = saxtf.newTemplates( xsltSource);
-
- TransformerHandler handler = saxtf.newTransformerHandler( templates);
- handler.setResult( new SAXResult( new ASMContentHandler( outputStream, computeMax)));
-
- ClassReader cr = new ClassReader( bytecode);
- cr.accept( new SAXClassAdapter( handler, cr.getVersion(), false), false);
-</pre>
-
-See JAXP and SAX documentation for more detils.
-
-<p>
-There are few illustrations of the bytecode transformation with XSLT in
-examples directory. The following XSLT procesors has been tested.
-
-<blockquote>
-<table border="1" cellspacing="0" cellpadding="3">
-<tr>
-<th>Engine</td>
-<th>javax.xml.transform.TransformerFactory property</td>
-</tr>
-
-<tr>
-<td>jd.xslt</td>
-<td>jd.xml.xslt.trax.TransformerFactoryImpl</td>
-</tr>
-
-<tr>
-<td>Saxon</td>
-<td>net.sf.saxon.TransformerFactoryImpl</td>
-</tr>
-
-<tr>
-<td>Caucho</td>
-<td>com.caucho.xsl.Xsl</td>
-</tr>
-
-<tr>
-<td>Xalan interpeter</td>
-<td>org.apache.xalan.processor.TransformerFactory</td>
-</tr>
-
-<tr>
-<td>Xalan xsltc</td>
-<td>org.apache.xalan.xsltc.trax.TransformerFactoryImpl</td>
-</tr>
-</table>
-</blockquote>
-
-@since ASM 1.4.3
-
-</body>
-</html>
diff --git a/plugins/org.eclipse.persistence.asm/readme.html b/plugins/org.eclipse.persistence.asm/readme.html
index 7459c4d..022ee20 100644
--- a/plugins/org.eclipse.persistence.asm/readme.html
+++ b/plugins/org.eclipse.persistence.asm/readme.html
@@ -3,11 +3,11 @@
<HTML xmlns="http://www.w3.org/1999/xhtml">
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<TITLE>ASM 3.3.1 Readme</TITLE>
+<TITLE>ASM 5.0.1 Readme</TITLE>
</HEAD>
<BODY>
<DIV class=Section0>
-<P style="TEXT-ALIGN: center" align=center><B>ASM 3.3.1 Read Me</B> </P>
+<P style="TEXT-ALIGN: center" align=center><B>ASM 5.0.1 Read Me</B> </P>
<P>The <A href="http://www.eclipse.org/eclipselink">EclipseLink</A> project
includes ASM for the purpose of byte code weaving. The ASM library is
re-packaged within the source of the
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/AnnotationVisitor.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/AnnotationVisitor.java
index 598208d..eb97e54 100644
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/AnnotationVisitor.java
+++ b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/AnnotationVisitor.java
@@ -1,6 +1,6 @@
/***
* ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2007 INRIA, France Telecom
+ * Copyright (c) 2000-2011 INRIA, France Telecom
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,51 +29,114 @@
*/
package org.eclipse.persistence.internal.libraries.asm;
+
/**
- * A visitor to visit a Java annotation. The methods of this interface must be
- * called in the following order: (<tt>visit<tt> | <tt>visitEnum<tt> |
- * <tt>visitAnnotation<tt> | <tt>visitArray<tt>)* <tt>visitEnd<tt>.
- *
+ * A visitor to visit a Java annotation. The methods of this class must be
+ * called in the following order: ( <tt>visit</tt> | <tt>visitEnum</tt> |
+ * <tt>visitAnnotation</tt> | <tt>visitArray</tt> )* <tt>visitEnd</tt>.
+ *
* @author Eric Bruneton
* @author Eugene Kuleshov
*/
-public interface AnnotationVisitor {
+public abstract class AnnotationVisitor {
+
+ /**
+ * The ASM API version implemented by this visitor. The value of this field
+ * must be one of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}.
+ */
+ protected final int api;
+
+ /**
+ * The annotation visitor to which this visitor must delegate method calls.
+ * May be null.
+ */
+ protected AnnotationVisitor av;
+
+ /**
+ * Constructs a new {@link AnnotationVisitor}.
+ *
+ * @param api
+ * the ASM API version implemented by this visitor. Must be one
+ * of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}.
+ */
+ public AnnotationVisitor(final int api) {
+ this(api, null);
+ }
+
+ /**
+ * Constructs a new {@link AnnotationVisitor}.
+ *
+ * @param api
+ * the ASM API version implemented by this visitor. Must be one
+ * of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}.
+ * @param av
+ * the annotation visitor to which this visitor must delegate
+ * method calls. May be null.
+ */
+ public AnnotationVisitor(final int api, final AnnotationVisitor av) {
+ if (api != Opcodes.ASM4 && api != Opcodes.ASM5) {
+ throw new IllegalArgumentException();
+ }
+ this.api = api;
+ this.av = av;
+ }
/**
* Visits a primitive value of the annotation.
*
- * @param name the value name.
- * @param value the actual value, whose type must be {@link Byte},
- * {@link Boolean}, {@link Character}, {@link Short},
- * {@link Integer}, {@link Long}, {@link Float}, {@link Double},
- * {@link String} or {@link Type}. This value can also be an array
- * of byte, boolean, short, char, int, long, float or double values
- * (this is equivalent to using {@link #visitArray visitArray} and
- * visiting each array element in turn, but is more convenient).
+ * @param name
+ * the value name.
+ * @param value
+ * the actual value, whose type must be {@link Byte},
+ * {@link Boolean}, {@link Character}, {@link Short},
+ * {@link Integer} , {@link Long}, {@link Float}, {@link Double},
+ * {@link String} or {@link Type} or OBJECT or ARRAY sort. This
+ * value can also be an array of byte, boolean, short, char, int,
+ * long, float or double values (this is equivalent to using
+ * {@link #visitArray visitArray} and visiting each array element
+ * in turn, but is more convenient).
*/
- void visit(String name, Object value);
+ public void visit(String name, Object value) {
+ if (av != null) {
+ av.visit(name, value);
+ }
+ }
/**
* Visits an enumeration value of the annotation.
*
- * @param name the value name.
- * @param desc the class descriptor of the enumeration class.
- * @param value the actual enumeration value.
+ * @param name
+ * the value name.
+ * @param desc
+ * the class descriptor of the enumeration class.
+ * @param value
+ * the actual enumeration value.
*/
- void visitEnum(String name, String desc, String value);
+ public void visitEnum(String name, String desc, String value) {
+ if (av != null) {
+ av.visitEnum(name, desc, value);
+ }
+ }
/**
* Visits a nested annotation value of the annotation.
*
- * @param name the value name.
- * @param desc the class descriptor of the nested annotation class.
+ * @param name
+ * the value name.
+ * @param desc
+ * the class descriptor of the nested annotation class.
* @return a visitor to visit the actual nested annotation value, or
- * <tt>null</tt> if this visitor is not interested in visiting
- * this nested annotation. <i>The nested annotation value must be
- * fully visited before calling other methods on this annotation
+ * <tt>null</tt> if this visitor is not interested in visiting this
+ * nested annotation. <i>The nested annotation value must be fully
+ * visited before calling other methods on this annotation
* visitor</i>.
*/
- AnnotationVisitor visitAnnotation(String name, String desc);
+ public AnnotationVisitor visitAnnotation(String name, String desc) {
+ if (av != null) {
+ return av.visitAnnotation(name, desc);
+ }
+ return null;
+ }
/**
* Visits an array value of the annotation. Note that arrays of primitive
@@ -81,17 +144,27 @@ public interface AnnotationVisitor {
* can be passed as value to {@link #visit visit}. This is what
* {@link ClassReader} does.
*
- * @param name the value name.
+ * @param name
+ * the value name.
* @return a visitor to visit the actual array value elements, or
- * <tt>null</tt> if this visitor is not interested in visiting
- * these values. The 'name' parameters passed to the methods of this
+ * <tt>null</tt> if this visitor is not interested in visiting these
+ * values. The 'name' parameters passed to the methods of this
* visitor are ignored. <i>All the array values must be visited
* before calling other methods on this annotation visitor</i>.
*/
- AnnotationVisitor visitArray(String name);
+ public AnnotationVisitor visitArray(String name) {
+ if (av != null) {
+ return av.visitArray(name);
+ }
+ return null;
+ }
/**
* Visits the end of the annotation.
*/
- void visitEnd();
+ public void visitEnd() {
+ if (av != null) {
+ av.visitEnd();
+ }
+ }
}
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/AnnotationWriter.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/AnnotationWriter.java
index 01ac664..bdabe66 100644
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/AnnotationWriter.java
+++ b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/AnnotationWriter.java
@@ -1,6 +1,6 @@
/***
* ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2007 INRIA, France Telecom
+ * Copyright (c) 2000-2011 INRIA, France Telecom
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,13 +29,14 @@
*/
package org.eclipse.persistence.internal.libraries.asm;
+
/**
* An {@link AnnotationVisitor} that generates annotations in bytecode form.
*
* @author Eric Bruneton
* @author Eugene Kuleshov
*/
-final class AnnotationWriter implements AnnotationVisitor {
+final class AnnotationWriter extends AnnotationVisitor {
/**
* The class writer to which this annotation must be added.
@@ -48,7 +49,7 @@ final class AnnotationWriter implements AnnotationVisitor {
private int size;
/**
- * <tt>true<tt> if values are named, <tt>false</tt> otherwise. Annotation
+ * <tt>true<tt> if values are named, <tt>false</tt> otherwise. Annotation
* writers used for annotation default and annotation arrays use unnamed
* values.
*/
@@ -90,20 +91,21 @@ final class AnnotationWriter implements AnnotationVisitor {
/**
* Constructs a new {@link AnnotationWriter}.
*
- * @param cw the class writer to which this annotation must be added.
- * @param named <tt>true<tt> if values are named, <tt>false</tt> otherwise.
- * @param bv where the annotation values must be stored.
- * @param parent where the number of annotation values must be stored.
- * @param offset where in <tt>parent</tt> the number of annotation values must
- * be stored.
+ * @param cw
+ * the class writer to which this annotation must be added.
+ * @param named
+ * <tt>true<tt> if values are named, <tt>false</tt> otherwise.
+ * @param bv
+ * where the annotation values must be stored.
+ * @param parent
+ * where the number of annotation values must be stored.
+ * @param offset
+ * where in <tt>parent</tt> the number of annotation values must
+ * be stored.
*/
- AnnotationWriter(
- final ClassWriter cw,
- final boolean named,
- final ByteVector bv,
- final ByteVector parent,
- final int offset)
- {
+ AnnotationWriter(final ClassWriter cw, final boolean named,
+ final ByteVector bv, final ByteVector parent, final int offset) {
+ super(Opcodes.ASM5);
this.cw = cw;
this.named = named;
this.bv = bv;
@@ -112,9 +114,10 @@ final class AnnotationWriter implements AnnotationVisitor {
}
// ------------------------------------------------------------------------
- // Implementation of the AnnotationVisitor interface
+ // Implementation of the AnnotationVisitor abstract class
// ------------------------------------------------------------------------
+ @Override
public void visit(final String name, final Object value) {
++size;
if (named) {
@@ -187,11 +190,9 @@ final class AnnotationWriter implements AnnotationVisitor {
}
}
- public void visitEnum(
- final String name,
- final String desc,
- final String value)
- {
+ @Override
+ public void visitEnum(final String name, final String desc,
+ final String value) {
++size;
if (named) {
bv.putShort(cw.newUTF8(name));
@@ -199,10 +200,9 @@ final class AnnotationWriter implements AnnotationVisitor {
bv.put12('e', cw.newUTF8(desc)).putShort(cw.newUTF8(value));
}
- public AnnotationVisitor visitAnnotation(
- final String name,
- final String desc)
- {
+ @Override
+ public AnnotationVisitor visitAnnotation(final String name,
+ final String desc) {
++size;
if (named) {
bv.putShort(cw.newUTF8(name));
@@ -212,6 +212,7 @@ final class AnnotationWriter implements AnnotationVisitor {
return new AnnotationWriter(cw, true, bv, bv, bv.length - 2);
}
+ @Override
public AnnotationVisitor visitArray(final String name) {
++size;
if (named) {
@@ -222,6 +223,7 @@ final class AnnotationWriter implements AnnotationVisitor {
return new AnnotationWriter(cw, false, bv, bv, bv.length - 2);
}
+ @Override
public void visitEnd() {
if (parent != null) {
byte[] data = parent.data;
@@ -253,7 +255,8 @@ final class AnnotationWriter implements AnnotationVisitor {
* Puts the annotations of this annotation writer list into the given byte
* vector.
*
- * @param out where the annotations must be put.
+ * @param out
+ * where the annotations must be put.
*/
void put(final ByteVector out) {
int n = 0;
@@ -280,15 +283,15 @@ final class AnnotationWriter implements AnnotationVisitor {
/**
* Puts the given annotation lists into the given byte vector.
*
- * @param panns an array of annotation writer lists.
- * @param off index of the first annotation to be written.
- * @param out where the annotations must be put.
+ * @param panns
+ * an array of annotation writer lists.
+ * @param off
+ * index of the first annotation to be written.
+ * @param out
+ * where the annotations must be put.
*/
- static void put(
- final AnnotationWriter[] panns,
- final int off,
- final ByteVector out)
- {
+ static void put(final AnnotationWriter[] panns, final int off,
+ final ByteVector out) {
int size = 1 + 2 * (panns.length - off);
for (int i = off; i < panns.length; ++i) {
size += panns[i] == null ? 0 : panns[i].getSize();
@@ -313,4 +316,57 @@ final class AnnotationWriter implements AnnotationVisitor {
}
}
}
+
+ /**
+ * Puts the given type reference and type path into the given bytevector.
+ * LOCAL_VARIABLE and RESOURCE_VARIABLE target types are not supported.
+ *
+ * @param typeRef
+ * a reference to the annotated type. See {@link TypeReference}.
+ * @param typePath
+ * the path to the annotated type argument, wildcard bound, array
+ * element type, or static inner type within 'typeRef'. May be
+ * <tt>null</tt> if the annotation targets 'typeRef' as a whole.
+ * @param out
+ * where the type reference and type path must be put.
+ */
+ static void putTarget(int typeRef, TypePath typePath, ByteVector out) {
+ switch (typeRef >>> 24) {
+ case 0x00: // CLASS_TYPE_PARAMETER
+ case 0x01: // METHOD_TYPE_PARAMETER
+ case 0x16: // METHOD_FORMAL_PARAMETER
+ out.putShort(typeRef >>> 16);
+ break;
+ case 0x13: // FIELD
+ case 0x14: // METHOD_RETURN
+ case 0x15: // METHOD_RECEIVER
+ out.putByte(typeRef >>> 24);
+ break;
+ case 0x47: // CAST
+ case 0x48: // CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT
+ case 0x49: // METHOD_INVOCATION_TYPE_ARGUMENT
+ case 0x4A: // CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT
+ case 0x4B: // METHOD_REFERENCE_TYPE_ARGUMENT
+ out.putInt(typeRef);
+ break;
+ // case 0x10: // CLASS_EXTENDS
+ // case 0x11: // CLASS_TYPE_PARAMETER_BOUND
+ // case 0x12: // METHOD_TYPE_PARAMETER_BOUND
+ // case 0x17: // THROWS
+ // case 0x42: // EXCEPTION_PARAMETER
+ // case 0x43: // INSTANCEOF
+ // case 0x44: // NEW
+ // case 0x45: // CONSTRUCTOR_REFERENCE
+ // case 0x46: // METHOD_REFERENCE
+ default:
+ out.put12(typeRef >>> 24, (typeRef & 0xFFFF00) >> 8);
+ break;
+ }
+ if (typePath == null) {
+ out.putByte(0);
+ } else {
+ int length = typePath.b[typePath.offset] * 2 + 1;
+ out.putByteArray(typePath.b, typePath.offset, length);
+ }
+ }
}
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/Attribute.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/Attribute.java
index c61d8ef..b6056f3 100644
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/Attribute.java
+++ b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/Attribute.java
@@ -1,6 +1,6 @@
/***
* ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2007 INRIA, France Telecom
+ * Copyright (c) 2000-2011 INRIA, France Telecom
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,6 +29,7 @@
*/
package org.eclipse.persistence.internal.libraries.asm;
+
/**
* A non standard class, field, method or code attribute.
*
@@ -55,7 +56,8 @@ public class Attribute {
/**
* Constructs a new empty attribute.
*
- * @param type the type of the attribute.
+ * @param type
+ * the type of the attribute.
*/
protected Attribute(final String type) {
this.type = type;
@@ -91,39 +93,39 @@ public class Attribute {
}
/**
- * Reads a {@link #type type} attribute. This method must return a <i>new</i>
- * {@link Attribute} object, of type {@link #type type}, corresponding to
- * the <tt>len</tt> bytes starting at the given offset, in the given class
- * reader.
+ * Reads a {@link #type type} attribute. This method must return a
+ * <i>new</i> {@link Attribute} object, of type {@link #type type},
+ * corresponding to the <tt>len</tt> bytes starting at the given offset, in
+ * the given class reader.
*
- * @param cr the class that contains the attribute to be read.
- * @param off index of the first byte of the attribute's content in {@link
- * ClassReader#b cr.b}. The 6 attribute header bytes, containing the
- * type and the length of the attribute, are not taken into account
- * here.
- * @param len the length of the attribute's content.
- * @param buf buffer to be used to call
- * {@link ClassReader#readUTF8 readUTF8},
- * {@link ClassReader#readClass(int,char[]) readClass} or
- * {@link ClassReader#readConst readConst}.
- * @param codeOff index of the first byte of code's attribute content in
- * {@link ClassReader#b cr.b}, or -1 if the attribute to be read is
- * not a code attribute. The 6 attribute header bytes, containing the
- * type and the length of the attribute, are not taken into account
- * here.
- * @param labels the labels of the method's code, or <tt>null</tt> if the
- * attribute to be read is not a code attribute.
+ * @param cr
+ * the class that contains the attribute to be read.
+ * @param off
+ * index of the first byte of the attribute's content in
+ * {@link ClassReader#b cr.b}. The 6 attribute header bytes,
+ * containing the type and the length of the attribute, are not
+ * taken into account here.
+ * @param len
+ * the length of the attribute's content.
+ * @param buf
+ * buffer to be used to call {@link ClassReader#readUTF8
+ * readUTF8}, {@link ClassReader#readClass(int,char[]) readClass}
+ * or {@link ClassReader#readConst readConst}.
+ * @param codeOff
+ * index of the first byte of code's attribute content in
+ * {@link ClassReader#b cr.b}, or -1 if the attribute to be read
+ * is not a code attribute. The 6 attribute header bytes,
+ * containing the type and the length of the attribute, are not
+ * taken into account here.
+ * @param labels
+ * the labels of the method's code, or <tt>null</tt> if the
+ * attribute to be read is not a code attribute.
* @return a <i>new</i> {@link Attribute} object corresponding to the given
* bytes.
*/
- protected Attribute read(
- final ClassReader cr,
- final int off,
- final int len,
- final char[] buf,
- final int codeOff,
- final Label[] labels)
- {
+ protected Attribute read(final ClassReader cr, final int off,
+ final int len, final char[] buf, final int codeOff,
+ final Label[] labels) {
Attribute attr = new Attribute(type);
attr.value = new byte[len];
System.arraycopy(cr.b, off, attr.value, 0, len);
@@ -133,30 +135,30 @@ public class Attribute {
/**
* Returns the byte array form of this attribute.
*
- * @param cw the class to which this attribute must be added. This parameter
- * can be used to add to the constant pool of this class the items
- * that corresponds to this attribute.
- * @param code the bytecode of the method corresponding to this code
- * attribute, or <tt>null</tt> if this attribute is not a code
- * attributes.
- * @param len the length of the bytecode of the method corresponding to this
- * code attribute, or <tt>null</tt> if this attribute is not a code
- * attribute.
- * @param maxStack the maximum stack size of the method corresponding to
- * this code attribute, or -1 if this attribute is not a code
- * attribute.
- * @param maxLocals the maximum number of local variables of the method
- * corresponding to this code attribute, or -1 if this attribute is
- * not a code attribute.
+ * @param cw
+ * the class to which this attribute must be added. This
+ * parameter can be used to add to the constant pool of this
+ * class the items that corresponds to this attribute.
+ * @param code
+ * the bytecode of the method corresponding to this code
+ * attribute, or <tt>null</tt> if this attribute is not a code
+ * attributes.
+ * @param len
+ * the length of the bytecode of the method corresponding to this
+ * code attribute, or <tt>null</tt> if this attribute is not a
+ * code attribute.
+ * @param maxStack
+ * the maximum stack size of the method corresponding to this
+ * code attribute, or -1 if this attribute is not a code
+ * attribute.
+ * @param maxLocals
+ * the maximum number of local variables of the method
+ * corresponding to this code attribute, or -1 if this attribute
+ * is not a code attribute.
* @return the byte array form of this attribute.
*/
- protected ByteVector write(
- final ClassWriter cw,
- final byte[] code,
- final int len,
- final int maxStack,
- final int maxLocals)
- {
+ protected ByteVector write(final ClassWriter cw, final byte[] code,
+ final int len, final int maxStack, final int maxLocals) {
ByteVector v = new ByteVector();
v.data = value;
v.length = value.length;
@@ -181,30 +183,30 @@ public class Attribute {
/**
* Returns the size of all the attributes in this attribute list.
*
- * @param cw the class writer to be used to convert the attributes into byte
- * arrays, with the {@link #write write} method.
- * @param code the bytecode of the method corresponding to these code
- * attributes, or <tt>null</tt> if these attributes are not code
- * attributes.
- * @param len the length of the bytecode of the method corresponding to
- * these code attributes, or <tt>null</tt> if these attributes are
- * not code attributes.
- * @param maxStack the maximum stack size of the method corresponding to
- * these code attributes, or -1 if these attributes are not code
- * attributes.
- * @param maxLocals the maximum number of local variables of the method
- * corresponding to these code attributes, or -1 if these attributes
- * are not code attributes.
+ * @param cw
+ * the class writer to be used to convert the attributes into
+ * byte arrays, with the {@link #write write} method.
+ * @param code
+ * the bytecode of the method corresponding to these code
+ * attributes, or <tt>null</tt> if these attributes are not code
+ * attributes.
+ * @param len
+ * the length of the bytecode of the method corresponding to
+ * these code attributes, or <tt>null</tt> if these attributes
+ * are not code attributes.
+ * @param maxStack
+ * the maximum stack size of the method corresponding to these
+ * code attributes, or -1 if these attributes are not code
+ * attributes.
+ * @param maxLocals
+ * the maximum number of local variables of the method
+ * corresponding to these code attributes, or -1 if these
+ * attributes are not code attributes.
* @return the size of all the attributes in this attribute list. This size
* includes the size of the attribute headers.
*/
- final int getSize(
- final ClassWriter cw,
- final byte[] code,
- final int len,
- final int maxStack,
- final int maxLocals)
- {
+ final int getSize(final ClassWriter cw, final byte[] code, final int len,
+ final int maxStack, final int maxLocals) {
Attribute attr = this;
int size = 0;
while (attr != null) {
@@ -219,30 +221,30 @@ public class Attribute {
* Writes all the attributes of this attribute list in the given byte
* vector.
*
- * @param cw the class writer to be used to convert the attributes into byte
- * arrays, with the {@link #write write} method.
- * @param code the bytecode of the method corresponding to these code
- * attributes, or <tt>null</tt> if these attributes are not code
- * attributes.
- * @param len the length of the bytecode of the method corresponding to
- * these code attributes, or <tt>null</tt> if these attributes are
- * not code attributes.
- * @param maxStack the maximum stack size of the method corresponding to
- * these code attributes, or -1 if these attributes are not code
- * attributes.
- * @param maxLocals the maximum number of local variables of the method
- * corresponding to these code attributes, or -1 if these attributes
- * are not code attributes.
- * @param out where the attributes must be written.
+ * @param cw
+ * the class writer to be used to convert the attributes into
+ * byte arrays, with the {@link #write write} method.
+ * @param code
+ * the bytecode of the method corresponding to these code
+ * attributes, or <tt>null</tt> if these attributes are not code
+ * attributes.
+ * @param len
+ * the length of the bytecode of the method corresponding to
+ * these code attributes, or <tt>null</tt> if these attributes
+ * are not code attributes.
+ * @param maxStack
+ * the maximum stack size of the method corresponding to these
+ * code attributes, or -1 if these attributes are not code
+ * attributes.
+ * @param maxLocals
+ * the maximum number of local variables of the method
+ * corresponding to these code attributes, or -1 if these
+ * attributes are not code attributes.
+ * @param out
+ * where the attributes must be written.
*/
- final void put(
- final ClassWriter cw,
- final byte[] code,
- final int len,
- final int maxStack,
- final int maxLocals,
- final ByteVector out)
- {
+ final void put(final ClassWriter cw, final byte[] code, final int len,
+ final int maxStack, final int maxLocals, final ByteVector out) {
Attribute attr = this;
while (attr != null) {
ByteVector b = attr.write(cw, code, len, maxStack, maxLocals);
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/ByteVector.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/ByteVector.java
index 59f7ec2..2a75523 100644
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/ByteVector.java
+++ b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/ByteVector.java
@@ -1,6 +1,6 @@
/***
* ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2007 INRIA, France Telecom
+ * Copyright (c) 2000-2011 INRIA, France Telecom
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,6 +29,7 @@
*/
package org.eclipse.persistence.internal.libraries.asm;
+
/**
* A dynamically extensible vector of bytes. This class is roughly equivalent to
* a DataOutputStream on top of a ByteArrayOutputStream, but is more efficient.
@@ -59,7 +60,8 @@ public class ByteVector {
* Constructs a new {@link ByteVector ByteVector} with the given initial
* size.
*
- * @param initialSize the initial size of the byte vector to be constructed.
+ * @param initialSize
+ * the initial size of the byte vector to be constructed.
*/
public ByteVector(final int initialSize) {
data = new byte[initialSize];
@@ -69,7 +71,8 @@ public class ByteVector {
* Puts a byte into this byte vector. The byte vector is automatically
* enlarged if necessary.
*
- * @param b a byte.
+ * @param b
+ * a byte.
* @return this byte vector.
*/
public ByteVector putByte(final int b) {
@@ -86,8 +89,10 @@ public class ByteVector {
* Puts two bytes into this byte vector. The byte vector is automatically
* enlarged if necessary.
*
- * @param b1 a byte.
- * @param b2 another byte.
+ * @param b1
+ * a byte.
+ * @param b2
+ * another byte.
* @return this byte vector.
*/
ByteVector put11(final int b1, final int b2) {
@@ -106,7 +111,8 @@ public class ByteVector {
* Puts a short into this byte vector. The byte vector is automatically
* enlarged if necessary.
*
- * @param s a short.
+ * @param s
+ * a short.
* @return this byte vector.
*/
public ByteVector putShort(final int s) {
@@ -125,8 +131,10 @@ public class ByteVector {
* Puts a byte and a short into this byte vector. The byte vector is
* automatically enlarged if necessary.
*
- * @param b a byte.
- * @param s a short.
+ * @param b
+ * a byte.
+ * @param s
+ * a short.
* @return this byte vector.
*/
ByteVector put12(final int b, final int s) {
@@ -146,7 +154,8 @@ public class ByteVector {
* Puts an int into this byte vector. The byte vector is automatically
* enlarged if necessary.
*
- * @param i an int.
+ * @param i
+ * an int.
* @return this byte vector.
*/
public ByteVector putInt(final int i) {
@@ -167,7 +176,8 @@ public class ByteVector {
* Puts a long into this byte vector. The byte vector is automatically
* enlarged if necessary.
*
- * @param l a long.
+ * @param l
+ * a long.
* @return this byte vector.
*/
public ByteVector putLong(final long l) {
@@ -194,11 +204,15 @@ public class ByteVector {
* Puts an UTF8 string into this byte vector. The byte vector is
* automatically enlarged if necessary.
*
- * @param s a String.
+ * @param s
+ * a String whose UTF8 encoded length must be less than 65536.
* @return this byte vector.
*/
public ByteVector putUTF8(final String s) {
int charLength = s.length();
+ if (charLength > 65535) {
+ throw new IllegalArgumentException();
+ }
int len = length;
if (len + 2 + charLength > data.length) {
enlarge(2 + charLength);
@@ -217,38 +231,68 @@ public class ByteVector {
if (c >= '\001' && c <= '\177') {
data[len++] = (byte) c;
} else {
- int byteLength = i;
- for (int j = i; j < charLength; ++j) {
- c = s.charAt(j);
- if (c >= '\001' && c <= '\177') {
- byteLength++;
- } else if (c > '\u07FF') {
- byteLength += 3;
- } else {
- byteLength += 2;
- }
- }
- data[length] = (byte) (byteLength >>> 8);
- data[length + 1] = (byte) byteLength;
- if (length + 2 + byteLength > data.length) {
- length = len;
- enlarge(2 + byteLength);
- data = this.data;
- }
- for (int j = i; j < charLength; ++j) {
- c = s.charAt(j);
- if (c >= '\001' && c <= '\177') {
- data[len++] = (byte) c;
- } else if (c > '\u07FF') {
- data[len++] = (byte) (0xE0 | c >> 12 & 0xF);
- data[len++] = (byte) (0x80 | c >> 6 & 0x3F);
- data[len++] = (byte) (0x80 | c & 0x3F);
- } else {
- data[len++] = (byte) (0xC0 | c >> 6 & 0x1F);
- data[len++] = (byte) (0x80 | c & 0x3F);
- }
- }
- break;
+ length = len;
+ return encodeUTF8(s, i, 65535);
+ }
+ }
+ length = len;
+ return this;
+ }
+
+ /**
+ * Puts an UTF8 string into this byte vector. The byte vector is
+ * automatically enlarged if necessary. The string length is encoded in two
+ * bytes before the encoded characters, if there is space for that (i.e. if
+ * this.length - i - 2 >= 0).
+ *
+ * @param s
+ * the String to encode.
+ * @param i
+ * the index of the first character to encode. The previous
+ * characters are supposed to have already been encoded, using
+ * only one byte per character.
+ * @param maxByteLength
+ * the maximum byte length of the encoded string, including the
+ * already encoded characters.
+ * @return this byte vector.
+ */
+ ByteVector encodeUTF8(final String s, int i, int maxByteLength) {
+ int charLength = s.length();
+ int byteLength = i;
+ char c;
+ for (int j = i; j < charLength; ++j) {
+ c = s.charAt(j);
+ if (c >= '\001' && c <= '\177') {
+ byteLength++;
+ } else if (c > '\u07FF') {
+ byteLength += 3;
+ } else {
+ byteLength += 2;
+ }
+ }
+ if (byteLength > maxByteLength) {
+ throw new IllegalArgumentException();
+ }
+ int start = length - i - 2;
+ if (start >= 0) {
+ data[start] = (byte) (byteLength >>> 8);
+ data[start + 1] = (byte) byteLength;
+ }
+ if (length + byteLength - i > data.length) {
+ enlarge(byteLength - i);
+ }
+ int len = length;
+ for (int j = i; j < charLength; ++j) {
+ c = s.charAt(j);
+ if (c >= '\001' && c <= '\177') {
+ data[len++] = (byte) c;
+ } else if (c > '\u07FF') {
+ data[len++] = (byte) (0xE0 | c >> 12 & 0xF);
+ data[len++] = (byte) (0x80 | c >> 6 & 0x3F);
+ data[len++] = (byte) (0x80 | c & 0x3F);
+ } else {
+ data[len++] = (byte) (0xC0 | c >> 6 & 0x1F);
+ data[len++] = (byte) (0x80 | c & 0x3F);
}
}
length = len;
@@ -259,14 +303,16 @@ public class ByteVector {
* Puts an array of bytes into this byte vector. The byte vector is
* automatically enlarged if necessary.
*
- * @param b an array of bytes. May be <tt>null</tt> to put <tt>len</tt>
- * null bytes into this byte vector.
- * @param off index of the fist byte of b that must be copied.
- * @param len number of bytes of b that must be copied.
+ * @param b
+ * an array of bytes. May be <tt>null</tt> to put <tt>len</tt>
+ * null bytes into this byte vector.
+ * @param off
+ * index of the fist byte of b that must be copied.
+ * @param len
+ * number of bytes of b that must be copied.
* @return this byte vector.
*/
- public ByteVector putByteArray(final byte[] b, final int off, final int len)
- {
+ public ByteVector putByteArray(final byte[] b, final int off, final int len) {
if (length + len > data.length) {
enlarge(len);
}
@@ -280,8 +326,9 @@ public class ByteVector {
/**
* Enlarge this byte vector so that it can receive n more bytes.
*
- * @param size number of additional bytes that this byte vector should be
- * able to receive.
+ * @param size
+ * number of additional bytes that this byte vector should be
+ * able to receive.
*/
private void enlarge(final int size) {
int length1 = 2 * data.length;
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/ClassAdapter.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/ClassAdapter.java
deleted file mode 100644
index bbfeaa9..0000000
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/ClassAdapter.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2007 INRIA, France Telecom
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-package org.eclipse.persistence.internal.libraries.asm;
-
-/**
- * An empty {@link ClassVisitor} that delegates to another {@link ClassVisitor}.
- * This class can be used as a super class to quickly implement usefull class
- * adapter classes, just by overriding the necessary methods.
- *
- * @author Eric Bruneton
- */
-public class ClassAdapter implements ClassVisitor {
-
- /**
- * The {@link ClassVisitor} to which this adapter delegates calls.
- */
- protected ClassVisitor cv;
-
- /**
- * Constructs a new {@link ClassAdapter} object.
- *
- * @param cv the class visitor to which this adapter must delegate calls.
- */
- public ClassAdapter(final ClassVisitor cv) {
- this.cv = cv;
- }
-
- public void visit(
- final int version,
- final int access,
- final String name,
- final String signature,
- final String superName,
- final String[] interfaces)
- {
- cv.visit(version, access, name, signature, superName, interfaces);
- }
-
- public void visitSource(final String source, final String debug) {
- cv.visitSource(source, debug);
- }
-
- public void visitOuterClass(
- final String owner,
- final String name,
- final String desc)
- {
- cv.visitOuterClass(owner, name, desc);
- }
-
- public AnnotationVisitor visitAnnotation(
- final String desc,
- final boolean visible)
- {
- return cv.visitAnnotation(desc, visible);
- }
-
- public void visitAttribute(final Attribute attr) {
- cv.visitAttribute(attr);
- }
-
- public void visitInnerClass(
- final String name,
- final String outerName,
- final String innerName,
- final int access)
- {
- cv.visitInnerClass(name, outerName, innerName, access);
- }
-
- public FieldVisitor visitField(
- final int access,
- final String name,
- final String desc,
- final String signature,
- final Object value)
- {
- return cv.visitField(access, name, desc, signature, value);
- }
-
- public MethodVisitor visitMethod(
- final int access,
- final String name,
- final String desc,
- final String signature,
- final String[] exceptions)
- {
- return cv.visitMethod(access, name, desc, signature, exceptions);
- }
-
- public void visitEnd() {
- cv.visitEnd();
- }
-}
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/ClassReader.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/ClassReader.java
index 2ec290f..9f8774b 100644
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/ClassReader.java
+++ b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/ClassReader.java
@@ -1,6 +1,6 @@
/***
* ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2007 INRIA, France Telecom
+ * Copyright (c) 2000-2011 INRIA, France Telecom
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,8 +29,8 @@
*/
package org.eclipse.persistence.internal.libraries.asm;
-import java.io.InputStream;
import java.io.IOException;
+import java.io.InputStream;
/**
* A Java class parser to make a {@link ClassVisitor} visit an existing class.
@@ -47,27 +47,27 @@ public class ClassReader {
* True to enable signatures support.
*/
static final boolean SIGNATURES = true;
-
+
/**
* True to enable annotations support.
*/
static final boolean ANNOTATIONS = true;
-
+
/**
* True to enable stack map frames support.
*/
static final boolean FRAMES = true;
-
+
/**
* True to enable bytecode writing support.
*/
static final boolean WRITER = true;
-
+
/**
* True to enable JSR_W and GOTO_W support.
*/
static final boolean RESIZE = true;
-
+
/**
* Flag to skip method code. If this class is set <code>CODE</code>
* attribute won't be visited. This can be used, for example, to retrieve
@@ -112,9 +112,8 @@ public class ClassReader {
public final byte[] b;
/**
- * The start index of each constant pool item in {@link #b b}, plus one.
- * The one byte offset skips the constant pool item tag that indicates its
- * type.
+ * The start index of each constant pool item in {@link #b b}, plus one. The
+ * one byte offset skips the constant pool item tag that indicates its type.
*/
private final int[] items;
@@ -147,7 +146,8 @@ public class ClassReader {
/**
* Constructs a new {@link ClassReader} object.
*
- * @param b the bytecode of the class to be read.
+ * @param b
+ * the bytecode of the class to be read.
*/
public ClassReader(final byte[] b) {
this(b, 0, b.length);
@@ -156,12 +156,19 @@ public class ClassReader {
/**
* Constructs a new {@link ClassReader} object.
*
- * @param b the bytecode of the class to be read.
- * @param off the start offset of the class data.
- * @param len the length of the class data.
+ * @param b
+ * the bytecode of the class to be read.
+ * @param off
+ * the start offset of the class data.
+ * @param len
+ * the length of the class data.
*/
public ClassReader(final byte[] b, final int off, final int len) {
this.b = b;
+ // checks the class version
+ if (readShort(off + 6) > Opcodes.V1_8) {
+ throw new IllegalArgumentException();
+ }
// parses the constant pool
items = new int[readUnsignedShort(off + 8)];
int n = items.length;
@@ -172,30 +179,35 @@ public class ClassReader {
items[i] = index + 1;
int size;
switch (b[index]) {
- case ClassWriter.FIELD:
- case ClassWriter.METH:
- case ClassWriter.IMETH:
- case ClassWriter.INT:
- case ClassWriter.FLOAT:
- case ClassWriter.NAME_TYPE:
- size = 5;
- break;
- case ClassWriter.LONG:
- case ClassWriter.DOUBLE:
- size = 9;
- ++i;
- break;
- case ClassWriter.UTF8:
- size = 3 + readUnsignedShort(index + 1);
- if (size > max) {
- max = size;
- }
- break;
- // case ClassWriter.CLASS:
- // case ClassWriter.STR:
- default:
- size = 3;
- break;
+ case ClassWriter.FIELD:
+ case ClassWriter.METH:
+ case ClassWriter.IMETH:
+ case ClassWriter.INT:
+ case ClassWriter.FLOAT:
+ case ClassWriter.NAME_TYPE:
+ case ClassWriter.INDY:
+ size = 5;
+ break;
+ case ClassWriter.LONG:
+ case ClassWriter.DOUBLE:
+ size = 9;
+ ++i;
+ break;
+ case ClassWriter.UTF8:
+ size = 3 + readUnsignedShort(index + 1);
+ if (size > max) {
+ max = size;
+ }
+ break;
+ case ClassWriter.HANDLE:
+ size = 4;
+ break;
+ // case ClassWriter.CLASS:
+ // case ClassWriter.STR:
+ // case ClassWriter.MTYPE
+ default:
+ size = 3;
+ break;
}
index += size;
}
@@ -240,8 +252,7 @@ public class ClassReader {
* @see ClassVisitor#visit(int, int, String, String, String, String[])
*/
public String getSuperName() {
- int n = items[readUnsignedShort(header + 4)];
- return n == 0 ? null : readUTF8(n, new char[maxStringLength]);
+ return readClass(header + 4, new char[maxStringLength]);
}
/**
@@ -271,7 +282,8 @@ public class ClassReader {
* Copies the constant pool data into the given {@link ClassWriter}. Should
* be called before the {@link #accept(ClassVisitor,int)} method.
*
- * @param classWriter the {@link ClassWriter} to copy constant pool into.
+ * @param classWriter
+ * the {@link ClassWriter} to copy constant pool into.
*/
void copyPool(final ClassWriter classWriter) {
char[] buf = new char[maxStringLength];
@@ -283,58 +295,63 @@ public class ClassReader {
Item item = new Item(i);
int nameType;
switch (tag) {
- case ClassWriter.FIELD:
- case ClassWriter.METH:
- case ClassWriter.IMETH:
- nameType = items[readUnsignedShort(index + 2)];
- item.set(tag,
- readClass(index, buf),
- readUTF8(nameType, buf),
- readUTF8(nameType + 2, buf));
- break;
-
- case ClassWriter.INT:
- item.set(readInt(index));
- break;
-
- case ClassWriter.FLOAT:
- item.set(Float.intBitsToFloat(readInt(index)));
- break;
-
- case ClassWriter.NAME_TYPE:
- item.set(tag,
- readUTF8(index, buf),
- readUTF8(index + 2, buf),
- null);
- break;
-
- case ClassWriter.LONG:
- item.set(readLong(index));
- ++i;
- break;
-
- case ClassWriter.DOUBLE:
- item.set(Double.longBitsToDouble(readLong(index)));
- ++i;
- break;
-
- case ClassWriter.UTF8: {
- String s = strings[i];
- if (s == null) {
- index = items[i];
- s = strings[i] = readUTF(index + 2,
- readUnsignedShort(index),
- buf);
- }
- item.set(tag, s, null, null);
+ case ClassWriter.FIELD:
+ case ClassWriter.METH:
+ case ClassWriter.IMETH:
+ nameType = items[readUnsignedShort(index + 2)];
+ item.set(tag, readClass(index, buf), readUTF8(nameType, buf),
+ readUTF8(nameType + 2, buf));
+ break;
+ case ClassWriter.INT:
+ item.set(readInt(index));
+ break;
+ case ClassWriter.FLOAT:
+ item.set(Float.intBitsToFloat(readInt(index)));
+ break;
+ case ClassWriter.NAME_TYPE:
+ item.set(tag, readUTF8(index, buf), readUTF8(index + 2, buf),
+ null);
+ break;
+ case ClassWriter.LONG:
+ item.set(readLong(index));
+ ++i;
+ break;
+ case ClassWriter.DOUBLE:
+ item.set(Double.longBitsToDouble(readLong(index)));
+ ++i;
+ break;
+ case ClassWriter.UTF8: {
+ String s = strings[i];
+ if (s == null) {
+ index = items[i];
+ s = strings[i] = readUTF(index + 2,
+ readUnsignedShort(index), buf);
}
- break;
-
- // case ClassWriter.STR:
- // case ClassWriter.CLASS:
- default:
- item.set(tag, readUTF8(index, buf), null, null);
- break;
+ item.set(tag, s, null, null);
+ break;
+ }
+ case ClassWriter.HANDLE: {
+ int fieldOrMethodRef = items[readUnsignedShort(index + 1)];
+ nameType = items[readUnsignedShort(fieldOrMethodRef + 2)];
+ item.set(ClassWriter.HANDLE_BASE + readByte(index),
+ readClass(fieldOrMethodRef, buf),
+ readUTF8(nameType, buf), readUTF8(nameType + 2, buf));
+ break;
+ }
+ case ClassWriter.INDY:
+ if (classWriter.bootstrapMethods == null) {
+ copyBootstrapMethods(classWriter, items2, buf);
+ }
+ nameType = items[readUnsignedShort(index + 2)];
+ item.set(readUTF8(nameType, buf), readUTF8(nameType + 2, buf),
+ readUnsignedShort(index));
+ break;
+ // case ClassWriter.STR:
+ // case ClassWriter.CLASS:
+ // case ClassWriter.MTYPE
+ default:
+ item.set(tag, readUTF8(index, buf), null, null);
+ break;
}
int index2 = item.hashCode % items2.length;
@@ -350,59 +367,121 @@ public class ClassReader {
}
/**
+ * Copies the bootstrap method data into the given {@link ClassWriter}.
+ * Should be called before the {@link #accept(ClassVisitor,int)} method.
+ *
+ * @param classWriter
+ * the {@link ClassWriter} to copy bootstrap methods into.
+ */
+ private void copyBootstrapMethods(final ClassWriter classWriter,
+ final Item[] items, final char[] c) {
+ // finds the "BootstrapMethods" attribute
+ int u = getAttributes();
+ boolean found = false;
+ for (int i = readUnsignedShort(u); i > 0; --i) {
+ String attrName = readUTF8(u + 2, c);
+ if ("BootstrapMethods".equals(attrName)) {
+ found = true;
+ break;
+ }
+ u += 6 + readInt(u + 4);
+ }
+ if (!found) {
+ return;
+ }
+ // copies the bootstrap methods in the class writer
+ int boostrapMethodCount = readUnsignedShort(u + 8);
+ for (int j = 0, v = u + 10; j < boostrapMethodCount; j++) {
+ int position = v - u - 10;
+ int hashCode = readConst(readUnsignedShort(v), c).hashCode();
+ for (int k = readUnsignedShort(v + 2); k > 0; --k) {
+ hashCode ^= readConst(readUnsignedShort(v + 4), c).hashCode();
+ v += 2;
+ }
+ v += 4;
+ Item item = new Item(j);
+ item.set(position, hashCode & 0x7FFFFFFF);
+ int index = item.hashCode % items.length;
+ item.next = items[index];
+ items[index] = item;
+ }
+ int attrSize = readInt(u + 4);
+ ByteVector bootstrapMethods = new ByteVector(attrSize + 62);
+ bootstrapMethods.putByteArray(b, u + 10, attrSize - 2);
+ classWriter.bootstrapMethodsCount = boostrapMethodCount;
+ classWriter.bootstrapMethods = bootstrapMethods;
+ }
+
+ /**
* Constructs a new {@link ClassReader} object.
*
- * @param is an input stream from which to read the class.
- * @throws IOException if a problem occurs during reading.
+ * @param is
+ * an input stream from which to read the class.
+ * @throws IOException
+ * if a problem occurs during reading.
*/
public ClassReader(final InputStream is) throws IOException {
- this(readClass(is));
+ this(readClass(is, false));
}
/**
* Constructs a new {@link ClassReader} object.
*
- * @param name the fully qualified name of the class to be read.
- * @throws IOException if an exception occurs during reading.
+ * @param name
+ * the binary qualified name of the class to be read.
+ * @throws IOException
+ * if an exception occurs during reading.
*/
public ClassReader(final String name) throws IOException {
- this(ClassLoader.getSystemResourceAsStream(name.replace('.', '/')
- + ".class"));
+ this(readClass(
+ ClassLoader.getSystemResourceAsStream(name.replace('.', '/')
+ + ".class"), true));
}
/**
* Reads the bytecode of a class.
*
- * @param is an input stream from which to read the class.
+ * @param is
+ * an input stream from which to read the class.
+ * @param close
+ * true to close the input stream after reading.
* @return the bytecode read from the given input stream.
- * @throws IOException if a problem occurs during reading.
+ * @throws IOException
+ * if a problem occurs during reading.
*/
- private static byte[] readClass(final InputStream is) throws IOException {
+ private static byte[] readClass(final InputStream is, boolean close)
+ throws IOException {
if (is == null) {
throw new IOException("Class not found");
}
- byte[] b = new byte[is.available()];
- int len = 0;
- while (true) {
- int n = is.read(b, len, b.length - len);
- if (n == -1) {
- if (len < b.length) {
- byte[] c = new byte[len];
+ try {
+ byte[] b = new byte[is.available()];
+ int len = 0;
+ while (true) {
+ int n = is.read(b, len, b.length - len);
+ if (n == -1) {
+ if (len < b.length) {
+ byte[] c = new byte[len];
+ System.arraycopy(b, 0, c, 0, len);
+ b = c;
+ }
+ return b;
+ }
+ len += n;
+ if (len == b.length) {
+ int last = is.read();
+ if (last < 0) {
+ return b;
+ }
+ byte[] c = new byte[b.length + 1000];
System.arraycopy(b, 0, c, 0, len);
+ c[len++] = (byte) last;
b = c;
}
- return b;
}
- len += n;
- if (len == b.length) {
- int last = is.read();
- if (last < 0) {
- return b;
- }
- byte[] c = new byte[b.length + 1000];
- System.arraycopy(b, 0, c, 0, len);
- c[len++] = (byte) last;
- b = c;
+ } finally {
+ if (close) {
+ is.close();
}
}
}
@@ -412,14 +491,16 @@ public class ClassReader {
// ------------------------------------------------------------------------
/**
- * Makes the given visitor visit the Java class of this {@link ClassReader}.
- * This class is the one specified in the constructor (see
+ * Makes the given visitor visit the Java class of this {@link ClassReader}
+ * . This class is the one specified in the constructor (see
* {@link #ClassReader(byte[]) ClassReader}).
*
- * @param classVisitor the visitor that must visit this class.
- * @param flags option flags that can be used to modify the default behavior
- * of this class. See {@link #SKIP_DEBUG}, {@link #EXPAND_FRAMES},
- * {@link #SKIP_FRAMES}, {@link #SKIP_CODE}.
+ * @param classVisitor
+ * the visitor that must visit this class.
+ * @param flags
+ * option flags that can be used to modify the default behavior
+ * of this class. See {@link #SKIP_DEBUG}, {@link #EXPAND_FRAMES}
+ * , {@link #SKIP_FRAMES}, {@link #SKIP_CODE}.
*/
public void accept(final ClassVisitor classVisitor, final int flags) {
accept(classVisitor, new Attribute[0], flags);
@@ -430,1090 +511,1219 @@ public class ClassReader {
* This class is the one specified in the constructor (see
* {@link #ClassReader(byte[]) ClassReader}).
*
- * @param classVisitor the visitor that must visit this class.
- * @param attrs prototypes of the attributes that must be parsed during the
- * visit of the class. Any attribute whose type is not equal to the
- * type of one the prototypes will not be parsed: its byte array
- * value will be passed unchanged to the ClassWriter. <i>This may
- * corrupt it if this value contains references to the constant pool,
- * or has syntactic or semantic links with a class element that has
- * been transformed by a class adapter between the reader and the
- * writer</i>.
- * @param flags option flags that can be used to modify the default behavior
- * of this class. See {@link #SKIP_DEBUG}, {@link #EXPAND_FRAMES},
- * {@link #SKIP_FRAMES}, {@link #SKIP_CODE}.
+ * @param classVisitor
+ * the visitor that must visit this class.
+ * @param attrs
+ * prototypes of the attributes that must be parsed during the
+ * visit of the class. Any attribute whose type is not equal to
+ * the type of one the prototypes will not be parsed: its byte
+ * array value will be passed unchanged to the ClassWriter.
+ * <i>This may corrupt it if this value contains references to
+ * the constant pool, or has syntactic or semantic links with a
+ * class element that has been transformed by a class adapter
+ * between the reader and the writer</i>.
+ * @param flags
+ * option flags that can be used to modify the default behavior
+ * of this class. See {@link #SKIP_DEBUG}, {@link #EXPAND_FRAMES}
+ * , {@link #SKIP_FRAMES}, {@link #SKIP_CODE}.
*/
- public void accept(
- final ClassVisitor classVisitor,
- final Attribute[] attrs,
- final int flags)
- {
- byte[] b = this.b; // the bytecode array
+ public void accept(final ClassVisitor classVisitor,
+ final Attribute[] attrs, final int flags) {
+ int u = header; // current offset in the class file
char[] c = new char[maxStringLength]; // buffer used to read strings
- int i, j, k; // loop variables
- int u, v, w; // indexes in b
- Attribute attr;
-
- int access;
- String name;
- String desc;
- String attrName;
- String signature;
- int anns = 0;
- int ianns = 0;
- Attribute cattrs = null;
-
- // visits the header
- u = header;
- access = readUnsignedShort(u);
- name = readClass(u + 2, c);
- v = items[readUnsignedShort(u + 4)];
- String superClassName = v == 0 ? null : readUTF8(v, c);
- String[] implementedItfs = new String[readUnsignedShort(u + 6)];
- w = 0;
+
+ Context context = new Context();
+ context.attrs = attrs;
+ context.flags = flags;
+ context.buffer = c;
+
+ // reads the class declaration
+ int access = readUnsignedShort(u);
+ String name = readClass(u + 2, c);
+ String superClass = readClass(u + 4, c);
+ String[] interfaces = new String[readUnsignedShort(u + 6)];
u += 8;
- for (i = 0; i < implementedItfs.length; ++i) {
- implementedItfs[i] = readClass(u, c);
+ for (int i = 0; i < interfaces.length; ++i) {
+ interfaces[i] = readClass(u, c);
u += 2;
}
- boolean skipCode = (flags & SKIP_CODE) != 0;
- boolean skipDebug = (flags & SKIP_DEBUG) != 0;
- boolean unzip = (flags & EXPAND_FRAMES) != 0;
-
- // skips fields and methods
- v = u;
- i = readUnsignedShort(v);
- v += 2;
- for (; i > 0; --i) {
- j = readUnsignedShort(v + 6);
- v += 8;
- for (; j > 0; --j) {
- v += 6 + readInt(v + 2);
- }
- }
- i = readUnsignedShort(v);
- v += 2;
- for (; i > 0; --i) {
- j = readUnsignedShort(v + 6);
- v += 8;
- for (; j > 0; --j) {
- v += 6 + readInt(v + 2);
- }
- }
- // reads the class's attributes
- signature = null;
+ // reads the class attributes
+ String signature = null;
String sourceFile = null;
String sourceDebug = null;
String enclosingOwner = null;
String enclosingName = null;
String enclosingDesc = null;
-
- i = readUnsignedShort(v);
- v += 2;
- for (; i > 0; --i) {
- attrName = readUTF8(v, c);
+ int anns = 0;
+ int ianns = 0;
+ int tanns = 0;
+ int itanns = 0;
+ int innerClasses = 0;
+ Attribute attributes = null;
+
+ u = getAttributes();
+ for (int i = readUnsignedShort(u); i > 0; --i) {
+ String attrName = readUTF8(u + 2, c);
// tests are sorted in decreasing frequency order
// (based on frequencies observed on typical classes)
if ("SourceFile".equals(attrName)) {
- sourceFile = readUTF8(v + 6, c);
+ sourceFile = readUTF8(u + 8, c);
} else if ("InnerClasses".equals(attrName)) {
- w = v + 6;
+ innerClasses = u + 8;
} else if ("EnclosingMethod".equals(attrName)) {
- enclosingOwner = readClass(v + 6, c);
- int item = readUnsignedShort(v + 8);
+ enclosingOwner = readClass(u + 8, c);
+ int item = readUnsignedShort(u + 10);
if (item != 0) {
enclosingName = readUTF8(items[item], c);
enclosingDesc = readUTF8(items[item] + 2, c);
}
} else if (SIGNATURES && "Signature".equals(attrName)) {
- signature = readUTF8(v + 6, c);
- } else if (ANNOTATIONS && "RuntimeVisibleAnnotations".equals(attrName)) {
- anns = v + 6;
+ signature = readUTF8(u + 8, c);
+ } else if (ANNOTATIONS
+ && "RuntimeVisibleAnnotations".equals(attrName)) {
+ anns = u + 8;
+ } else if (ANNOTATIONS
+ && "RuntimeVisibleTypeAnnotations".equals(attrName)) {
+ tanns = u + 8;
} else if ("Deprecated".equals(attrName)) {
access |= Opcodes.ACC_DEPRECATED;
} else if ("Synthetic".equals(attrName)) {
- access |= Opcodes.ACC_SYNTHETIC | ClassWriter.ACC_SYNTHETIC_ATTRIBUTE;
+ access |= Opcodes.ACC_SYNTHETIC
+ | ClassWriter.ACC_SYNTHETIC_ATTRIBUTE;
} else if ("SourceDebugExtension".equals(attrName)) {
- int len = readInt(v + 2);
- sourceDebug = readUTF(v + 6, len, new char[len]);
- } else if (ANNOTATIONS && "RuntimeInvisibleAnnotations".equals(attrName)) {
- ianns = v + 6;
+ int len = readInt(u + 4);
+ sourceDebug = readUTF(u + 8, len, new char[len]);
+ } else if (ANNOTATIONS
+ && "RuntimeInvisibleAnnotations".equals(attrName)) {
+ ianns = u + 8;
+ } else if (ANNOTATIONS
+ && "RuntimeInvisibleTypeAnnotations".equals(attrName)) {
+ itanns = u + 8;
+ } else if ("BootstrapMethods".equals(attrName)) {
+ int[] bootstrapMethods = new int[readUnsignedShort(u + 8)];
+ for (int j = 0, v = u + 10; j < bootstrapMethods.length; j++) {
+ bootstrapMethods[j] = v;
+ v += 2 + readUnsignedShort(v + 2) << 1;
+ }
+ context.bootstrapMethods = bootstrapMethods;
} else {
- attr = readAttribute(attrs,
- attrName,
- v + 6,
- readInt(v + 2),
- c,
- -1,
- null);
+ Attribute attr = readAttribute(attrs, attrName, u + 8,
+ readInt(u + 4), c, -1, null);
if (attr != null) {
- attr.next = cattrs;
- cattrs = attr;
+ attr.next = attributes;
+ attributes = attr;
}
}
- v += 6 + readInt(v + 2);
- }
- // calls the visit method
- classVisitor.visit(readInt(4),
- access,
- name,
- signature,
- superClassName,
- implementedItfs);
-
- // calls the visitSource method
- if (!skipDebug && (sourceFile != null || sourceDebug != null)) {
+ u += 6 + readInt(u + 4);
+ }
+
+ // visits the class declaration
+ classVisitor.visit(readInt(items[1] - 7), access, name, signature,
+ superClass, interfaces);
+
+ // visits the source and debug info
+ if ((flags & SKIP_DEBUG) == 0
+ && (sourceFile != null || sourceDebug != null)) {
classVisitor.visitSource(sourceFile, sourceDebug);
}
- // calls the visitOuterClass method
+ // visits the outer class
if (enclosingOwner != null) {
- classVisitor.visitOuterClass(enclosingOwner,
- enclosingName,
+ classVisitor.visitOuterClass(enclosingOwner, enclosingName,
enclosingDesc);
}
- // visits the class annotations
- if (ANNOTATIONS) {
- for (i = 1; i >= 0; --i) {
- v = i == 0 ? ianns : anns;
- if (v != 0) {
- j = readUnsignedShort(v);
- v += 2;
- for (; j > 0; --j) {
- v = readAnnotationValues(v + 2,
- c,
- true,
- classVisitor.visitAnnotation(readUTF8(v, c), i != 0));
- }
- }
+ // visits the class annotations and type annotations
+ if (ANNOTATIONS && anns != 0) {
+ for (int i = readUnsignedShort(anns), v = anns + 2; i > 0; --i) {
+ v = readAnnotationValues(v + 2, c, true,
+ classVisitor.visitAnnotation(readUTF8(v, c), true));
+ }
+ }
+ if (ANNOTATIONS && ianns != 0) {
+ for (int i = readUnsignedShort(ianns), v = ianns + 2; i > 0; --i) {
+ v = readAnnotationValues(v + 2, c, true,
+ classVisitor.visitAnnotation(readUTF8(v, c), false));
+ }
+ }
+ if (ANNOTATIONS && tanns != 0) {
+ for (int i = readUnsignedShort(tanns), v = tanns + 2; i > 0; --i) {
+ v = readAnnotationTarget(context, v);
+ v = readAnnotationValues(v + 2, c, true,
+ classVisitor.visitTypeAnnotation(context.typeRef,
+ context.typePath, readUTF8(v, c), true));
+ }
+ }
+ if (ANNOTATIONS && itanns != 0) {
+ for (int i = readUnsignedShort(itanns), v = itanns + 2; i > 0; --i) {
+ v = readAnnotationTarget(context, v);
+ v = readAnnotationValues(v + 2, c, true,
+ classVisitor.visitTypeAnnotation(context.typeRef,
+ context.typePath, readUTF8(v, c), false));
}
}
- // visits the class attributes
- while (cattrs != null) {
- attr = cattrs.next;
- cattrs.next = null;
- classVisitor.visitAttribute(cattrs);
- cattrs = attr;
+ // visits the attributes
+ while (attributes != null) {
+ Attribute attr = attributes.next;
+ attributes.next = null;
+ classVisitor.visitAttribute(attributes);
+ attributes = attr;
}
- // calls the visitInnerClass method
- if (w != 0) {
- i = readUnsignedShort(w);
- w += 2;
- for (; i > 0; --i) {
- classVisitor.visitInnerClass(readUnsignedShort(w) == 0
- ? null
- : readClass(w, c), readUnsignedShort(w + 2) == 0
- ? null
- : readClass(w + 2, c), readUnsignedShort(w + 4) == 0
- ? null
- : readUTF8(w + 4, c), readUnsignedShort(w + 6));
- w += 8;
+ // visits the inner classes
+ if (innerClasses != 0) {
+ int v = innerClasses + 2;
+ for (int i = readUnsignedShort(innerClasses); i > 0; --i) {
+ classVisitor.visitInnerClass(readClass(v, c),
+ readClass(v + 2, c), readUTF8(v + 4, c),
+ readUnsignedShort(v + 6));
+ v += 8;
}
}
- // visits the fields
- i = readUnsignedShort(u);
+ // visits the fields and methods
+ u = header + 10 + 2 * interfaces.length;
+ for (int i = readUnsignedShort(u - 2); i > 0; --i) {
+ u = readField(classVisitor, context, u);
+ }
u += 2;
- for (; i > 0; --i) {
- access = readUnsignedShort(u);
- name = readUTF8(u + 2, c);
- desc = readUTF8(u + 4, c);
- // visits the field's attributes and looks for a ConstantValue
- // attribute
- int fieldValueItem = 0;
- signature = null;
- anns = 0;
- ianns = 0;
- cattrs = null;
-
- j = readUnsignedShort(u + 6);
- u += 8;
- for (; j > 0; --j) {
- attrName = readUTF8(u, c);
- // tests are sorted in decreasing frequency order
- // (based on frequencies observed on typical classes)
- if ("ConstantValue".equals(attrName)) {
- fieldValueItem = readUnsignedShort(u + 6);
- } else if (SIGNATURES && "Signature".equals(attrName)) {
- signature = readUTF8(u + 6, c);
- } else if ("Deprecated".equals(attrName)) {
- access |= Opcodes.ACC_DEPRECATED;
- } else if ("Synthetic".equals(attrName)) {
- access |= Opcodes.ACC_SYNTHETIC | ClassWriter.ACC_SYNTHETIC_ATTRIBUTE;
- } else if (ANNOTATIONS && "RuntimeVisibleAnnotations".equals(attrName)) {
- anns = u + 6;
- } else if (ANNOTATIONS && "RuntimeInvisibleAnnotations".equals(attrName)) {
- ianns = u + 6;
- } else {
- attr = readAttribute(attrs,
- attrName,
- u + 6,
- readInt(u + 2),
- c,
- -1,
- null);
- if (attr != null) {
- attr.next = cattrs;
- cattrs = attr;
- }
+ for (int i = readUnsignedShort(u - 2); i > 0; --i) {
+ u = readMethod(classVisitor, context, u);
+ }
+
+ // visits the end of the class
+ classVisitor.visitEnd();
+ }
+
+ /**
+ * Reads a field and makes the given visitor visit it.
+ *
+ * @param classVisitor
+ * the visitor that must visit the field.
+ * @param context
+ * information about the class being parsed.
+ * @param u
+ * the start offset of the field in the class file.
+ * @return the offset of the first byte following the field in the class.
+ */
+ private int readField(final ClassVisitor classVisitor,
+ final Context context, int u) {
+ // reads the field declaration
+ char[] c = context.buffer;
+ int access = readUnsignedShort(u);
+ String name = readUTF8(u + 2, c);
+ String desc = readUTF8(u + 4, c);
+ u += 6;
+
+ // reads the field attributes
+ String signature = null;
+ int anns = 0;
+ int ianns = 0;
+ int tanns = 0;
+ int itanns = 0;
+ Object value = null;
+ Attribute attributes = null;
+
+ for (int i = readUnsignedShort(u); i > 0; --i) {
+ String attrName = readUTF8(u + 2, c);
+ // tests are sorted in decreasing frequency order
+ // (based on frequencies observed on typical classes)
+ if ("ConstantValue".equals(attrName)) {
+ int item = readUnsignedShort(u + 8);
+ value = item == 0 ? null : readConst(item, c);
+ } else if (SIGNATURES && "Signature".equals(attrName)) {
+ signature = readUTF8(u + 8, c);
+ } else if ("Deprecated".equals(attrName)) {
+ access |= Opcodes.ACC_DEPRECATED;
+ } else if ("Synthetic".equals(attrName)) {
+ access |= Opcodes.ACC_SYNTHETIC
+ | ClassWriter.ACC_SYNTHETIC_ATTRIBUTE;
+ } else if (ANNOTATIONS
+ && "RuntimeVisibleAnnotations".equals(attrName)) {
+ anns = u + 8;
+ } else if (ANNOTATIONS
+ && "RuntimeVisibleTypeAnnotations".equals(attrName)) {
+ tanns = u + 8;
+ } else if (ANNOTATIONS
+ && "RuntimeInvisibleAnnotations".equals(attrName)) {
+ ianns = u + 8;
+ } else if (ANNOTATIONS
+ && "RuntimeInvisibleTypeAnnotations".equals(attrName)) {
+ itanns = u + 8;
+ } else {
+ Attribute attr = readAttribute(context.attrs, attrName, u + 8,
+ readInt(u + 4), c, -1, null);
+ if (attr != null) {
+ attr.next = attributes;
+ attributes = attr;
}
- u += 6 + readInt(u + 2);
}
- // visits the field
- FieldVisitor fv = classVisitor.visitField(access,
- name,
- desc,
- signature,
- fieldValueItem == 0 ? null : readConst(fieldValueItem, c));
- // visits the field annotations and attributes
- if (fv != null) {
- if (ANNOTATIONS) {
- for (j = 1; j >= 0; --j) {
- v = j == 0 ? ianns : anns;
- if (v != 0) {
- k = readUnsignedShort(v);
- v += 2;
- for (; k > 0; --k) {
- v = readAnnotationValues(v + 2,
- c,
- true,
- fv.visitAnnotation(readUTF8(v, c), j != 0));
- }
- }
- }
- }
- while (cattrs != null) {
- attr = cattrs.next;
- cattrs.next = null;
- fv.visitAttribute(cattrs);
- cattrs = attr;
- }
- fv.visitEnd();
+ u += 6 + readInt(u + 4);
+ }
+ u += 2;
+
+ // visits the field declaration
+ FieldVisitor fv = classVisitor.visitField(access, name, desc,
+ signature, value);
+ if (fv == null) {
+ return u;
+ }
+
+ // visits the field annotations and type annotations
+ if (ANNOTATIONS && anns != 0) {
+ for (int i = readUnsignedShort(anns), v = anns + 2; i > 0; --i) {
+ v = readAnnotationValues(v + 2, c, true,
+ fv.visitAnnotation(readUTF8(v, c), true));
+ }
+ }
+ if (ANNOTATIONS && ianns != 0) {
+ for (int i = readUnsignedShort(ianns), v = ianns + 2; i > 0; --i) {
+ v = readAnnotationValues(v + 2, c, true,
+ fv.visitAnnotation(readUTF8(v, c), false));
+ }
+ }
+ if (ANNOTATIONS && tanns != 0) {
+ for (int i = readUnsignedShort(tanns), v = tanns + 2; i > 0; --i) {
+ v = readAnnotationTarget(context, v);
+ v = readAnnotationValues(v + 2, c, true,
+ fv.visitTypeAnnotation(context.typeRef,
+ context.typePath, readUTF8(v, c), true));
+ }
+ }
+ if (ANNOTATIONS && itanns != 0) {
+ for (int i = readUnsignedShort(itanns), v = itanns + 2; i > 0; --i) {
+ v = readAnnotationTarget(context, v);
+ v = readAnnotationValues(v + 2, c, true,
+ fv.visitTypeAnnotation(context.typeRef,
+ context.typePath, readUTF8(v, c), false));
}
}
- // visits the methods
- i = readUnsignedShort(u);
- u += 2;
- for (; i > 0; --i) {
- int u0 = u + 6;
- access = readUnsignedShort(u);
- name = readUTF8(u + 2, c);
- desc = readUTF8(u + 4, c);
- signature = null;
- anns = 0;
- ianns = 0;
- int dann = 0;
- int mpanns = 0;
- int impanns = 0;
- cattrs = null;
- v = 0;
- w = 0;
-
- // looks for Code and Exceptions attributes
- j = readUnsignedShort(u + 6);
- u += 8;
- for (; j > 0; --j) {
- attrName = readUTF8(u, c);
- int attrSize = readInt(u + 2);
- u += 6;
- // tests are sorted in decreasing frequency order
- // (based on frequencies observed on typical classes)
- if ("Code".equals(attrName)) {
- if (!skipCode) {
- v = u;
- }
- } else if ("Exceptions".equals(attrName)) {
- w = u;
- } else if (SIGNATURES && "Signature".equals(attrName)) {
- signature = readUTF8(u, c);
- } else if ("Deprecated".equals(attrName)) {
- access |= Opcodes.ACC_DEPRECATED;
- } else if (ANNOTATIONS && "RuntimeVisibleAnnotations".equals(attrName)) {
- anns = u;
- } else if (ANNOTATIONS && "AnnotationDefault".equals(attrName)) {
- dann = u;
- } else if ("Synthetic".equals(attrName)) {
- access |= Opcodes.ACC_SYNTHETIC | ClassWriter.ACC_SYNTHETIC_ATTRIBUTE;
- } else if (ANNOTATIONS && "RuntimeInvisibleAnnotations".equals(attrName)) {
- ianns = u;
- } else if (ANNOTATIONS && "RuntimeVisibleParameterAnnotations".equals(attrName))
- {
- mpanns = u;
- } else if (ANNOTATIONS && "RuntimeInvisibleParameterAnnotations".equals(attrName))
- {
- impanns = u;
- } else {
- attr = readAttribute(attrs,
- attrName,
- u,
- attrSize,
- c,
- -1,
- null);
- if (attr != null) {
- attr.next = cattrs;
- cattrs = attr;
- }
+ // visits the field attributes
+ while (attributes != null) {
+ Attribute attr = attributes.next;
+ attributes.next = null;
+ fv.visitAttribute(attributes);
+ attributes = attr;
+ }
+
+ // visits the end of the field
+ fv.visitEnd();
+
+ return u;
+ }
+
+ /**
+ * Reads a method and makes the given visitor visit it.
+ *
+ * @param classVisitor
+ * the visitor that must visit the method.
+ * @param context
+ * information about the class being parsed.
+ * @param u
+ * the start offset of the method in the class file.
+ * @return the offset of the first byte following the method in the class.
+ */
+ private int readMethod(final ClassVisitor classVisitor,
+ final Context context, int u) {
+ // reads the method declaration
+ char[] c = context.buffer;
+ context.access = readUnsignedShort(u);
+ context.name = readUTF8(u + 2, c);
+ context.desc = readUTF8(u + 4, c);
+ u += 6;
+
+ // reads the method attributes
+ int code = 0;
+ int exception = 0;
+ String[] exceptions = null;
+ String signature = null;
+ int methodParameters = 0;
+ int anns = 0;
+ int ianns = 0;
+ int tanns = 0;
+ int itanns = 0;
+ int dann = 0;
+ int mpanns = 0;
+ int impanns = 0;
+ int firstAttribute = u;
+ Attribute attributes = null;
+
+ for (int i = readUnsignedShort(u); i > 0; --i) {
+ String attrName = readUTF8(u + 2, c);
+ // tests are sorted in decreasing frequency order
+ // (based on frequencies observed on typical classes)
+ if ("Code".equals(attrName)) {
+ if ((context.flags & SKIP_CODE) == 0) {
+ code = u + 8;
}
- u += attrSize;
- }
- // reads declared exceptions
- String[] exceptions;
- if (w == 0) {
- exceptions = null;
+ } else if ("Exceptions".equals(attrName)) {
+ exceptions = new String[readUnsignedShort(u + 8)];
+ exception = u + 10;
+ for (int j = 0; j < exceptions.length; ++j) {
+ exceptions[j] = readClass(exception, c);
+ exception += 2;
+ }
+ } else if (SIGNATURES && "Signature".equals(attrName)) {
+ signature = readUTF8(u + 8, c);
+ } else if ("Deprecated".equals(attrName)) {
+ context.access |= Opcodes.ACC_DEPRECATED;
+ } else if (ANNOTATIONS
+ && "RuntimeVisibleAnnotations".equals(attrName)) {
+ anns = u + 8;
+ } else if (ANNOTATIONS
+ && "RuntimeVisibleTypeAnnotations".equals(attrName)) {
+ tanns = u + 8;
+ } else if (ANNOTATIONS && "AnnotationDefault".equals(attrName)) {
+ dann = u + 8;
+ } else if ("Synthetic".equals(attrName)) {
+ context.access |= Opcodes.ACC_SYNTHETIC
+ | ClassWriter.ACC_SYNTHETIC_ATTRIBUTE;
+ } else if (ANNOTATIONS
+ && "RuntimeInvisibleAnnotations".equals(attrName)) {
+ ianns = u + 8;
+ } else if (ANNOTATIONS
+ && "RuntimeInvisibleTypeAnnotations".equals(attrName)) {
+ itanns = u + 8;
+ } else if (ANNOTATIONS
+ && "RuntimeVisibleParameterAnnotations".equals(attrName)) {
+ mpanns = u + 8;
+ } else if (ANNOTATIONS
+ && "RuntimeInvisibleParameterAnnotations".equals(attrName)) {
+ impanns = u + 8;
+ } else if ("MethodParameters".equals(attrName)) {
+ methodParameters = u + 8;
} else {
- exceptions = new String[readUnsignedShort(w)];
- w += 2;
- for (j = 0; j < exceptions.length; ++j) {
- exceptions[j] = readClass(w, c);
- w += 2;
+ Attribute attr = readAttribute(context.attrs, attrName, u + 8,
+ readInt(u + 4), c, -1, null);
+ if (attr != null) {
+ attr.next = attributes;
+ attributes = attr;
}
}
+ u += 6 + readInt(u + 4);
+ }
+ u += 2;
- // visits the method's code, if any
- MethodVisitor mv = classVisitor.visitMethod(access,
- name,
- desc,
- signature,
- exceptions);
+ // visits the method declaration
+ MethodVisitor mv = classVisitor.visitMethod(context.access,
+ context.name, context.desc, signature, exceptions);
+ if (mv == null) {
+ return u;
+ }
- if (mv != null) {
- /*
- * if the returned MethodVisitor is in fact a MethodWriter, it
- * means there is no method adapter between the reader and the
- * writer. If, in addition, the writer's constant pool was
- * copied from this reader (mw.cw.cr == this), and the signature
- * and exceptions of the method have not been changed, then it
- * is possible to skip all visit events and just copy the
- * original code of the method to the writer (the access, name
- * and descriptor can have been changed, this is not important
- * since they are not copied as is from the reader).
- */
- if (WRITER && mv instanceof MethodWriter) {
- MethodWriter mw = (MethodWriter) mv;
- if (mw.cw.cr == this) {
- if (signature == mw.signature) {
- boolean sameExceptions = false;
- if (exceptions == null) {
- sameExceptions = mw.exceptionCount == 0;
- } else {
- if (exceptions.length == mw.exceptionCount) {
- sameExceptions = true;
- for (j = exceptions.length - 1; j >= 0; --j)
- {
- w -= 2;
- if (mw.exceptions[j] != readUnsignedShort(w))
- {
- sameExceptions = false;
- break;
- }
- }
- }
- }
- if (sameExceptions) {
- /*
- * we do not copy directly the code into
- * MethodWriter to save a byte array copy
- * operation. The real copy will be done in
- * ClassWriter.toByteArray().
- */
- mw.classReaderOffset = u0;
- mw.classReaderLength = u - u0;
- continue;
- }
+ /*
+ * if the returned MethodVisitor is in fact a MethodWriter, it means
+ * there is no method adapter between the reader and the writer. If, in
+ * addition, the writer's constant pool was copied from this reader
+ * (mw.cw.cr == this), and the signature and exceptions of the method
+ * have not been changed, then it is possible to skip all visit events
+ * and just copy the original code of the method to the writer (the
+ * access, name and descriptor can have been changed, this is not
+ * important since they are not copied as is from the reader).
+ */
+ if (WRITER && mv instanceof MethodWriter) {
+ MethodWriter mw = (MethodWriter) mv;
+ if (mw.cw.cr == this && signature == mw.signature) {
+ boolean sameExceptions = false;
+ if (exceptions == null) {
+ sameExceptions = mw.exceptionCount == 0;
+ } else if (exceptions.length == mw.exceptionCount) {
+ sameExceptions = true;
+ for (int j = exceptions.length - 1; j >= 0; --j) {
+ exception -= 2;
+ if (mw.exceptions[j] != readUnsignedShort(exception)) {
+ sameExceptions = false;
+ break;
}
}
}
-
- if (ANNOTATIONS && dann != 0) {
- AnnotationVisitor dv = mv.visitAnnotationDefault();
- readAnnotationValue(dann, c, null, dv);
- if (dv != null) {
- dv.visitEnd();
- }
- }
- if (ANNOTATIONS) {
- for (j = 1; j >= 0; --j) {
- w = j == 0 ? ianns : anns;
- if (w != 0) {
- k = readUnsignedShort(w);
- w += 2;
- for (; k > 0; --k) {
- w = readAnnotationValues(w + 2,
- c,
- true,
- mv.visitAnnotation(readUTF8(w, c), j != 0));
- }
- }
- }
+ if (sameExceptions) {
+ /*
+ * we do not copy directly the code into MethodWriter to
+ * save a byte array copy operation. The real copy will be
+ * done in ClassWriter.toByteArray().
+ */
+ mw.classReaderOffset = firstAttribute;
+ mw.classReaderLength = u - firstAttribute;
+ return u;
}
- if (ANNOTATIONS && mpanns != 0) {
- readParameterAnnotations(mpanns, desc, c, true, mv);
+ }
+ }
+
+ // visit the method parameters
+ if (methodParameters != 0) {
+ for (int i = b[methodParameters] & 0xFF, v = methodParameters + 1; i > 0; --i, v = v + 4) {
+ mv.visitParameter(readUTF8(v, c), readUnsignedShort(v + 2));
+ }
+ }
+
+ // visits the method annotations
+ if (ANNOTATIONS && dann != 0) {
+ AnnotationVisitor dv = mv.visitAnnotationDefault();
+ readAnnotationValue(dann, c, null, dv);
+ if (dv != null) {
+ dv.visitEnd();
+ }
+ }
+ if (ANNOTATIONS && anns != 0) {
+ for (int i = readUnsignedShort(anns), v = anns + 2; i > 0; --i) {
+ v = readAnnotationValues(v + 2, c, true,
+ mv.visitAnnotation(readUTF8(v, c), true));
+ }
+ }
+ if (ANNOTATIONS && ianns != 0) {
+ for (int i = readUnsignedShort(ianns), v = ianns + 2; i > 0; --i) {
+ v = readAnnotationValues(v + 2, c, true,
+ mv.visitAnnotation(readUTF8(v, c), false));
+ }
+ }
+ if (ANNOTATIONS && tanns != 0) {
+ for (int i = readUnsignedShort(tanns), v = tanns + 2; i > 0; --i) {
+ v = readAnnotationTarget(context, v);
+ v = readAnnotationValues(v + 2, c, true,
+ mv.visitTypeAnnotation(context.typeRef,
+ context.typePath, readUTF8(v, c), true));
+ }
+ }
+ if (ANNOTATIONS && itanns != 0) {
+ for (int i = readUnsignedShort(itanns), v = itanns + 2; i > 0; --i) {
+ v = readAnnotationTarget(context, v);
+ v = readAnnotationValues(v + 2, c, true,
+ mv.visitTypeAnnotation(context.typeRef,
+ context.typePath, readUTF8(v, c), false));
+ }
+ }
+ if (ANNOTATIONS && mpanns != 0) {
+ readParameterAnnotations(mv, context, mpanns, true);
+ }
+ if (ANNOTATIONS && impanns != 0) {
+ readParameterAnnotations(mv, context, impanns, false);
+ }
+
+ // visits the method attributes
+ while (attributes != null) {
+ Attribute attr = attributes.next;
+ attributes.next = null;
+ mv.visitAttribute(attributes);
+ attributes = attr;
+ }
+
+ // visits the method code
+ if (code != 0) {
+ mv.visitCode();
+ readCode(mv, context, code);
+ }
+
+ // visits the end of the method
+ mv.visitEnd();
+
+ return u;
+ }
+
+ /**
+ * Reads the bytecode of a method and makes the given visitor visit it.
+ *
+ * @param mv
+ * the visitor that must visit the method's code.
+ * @param context
+ * information about the class being parsed.
+ * @param u
+ * the start offset of the code attribute in the class file.
+ */
+ private void readCode(final MethodVisitor mv, final Context context, int u) {
+ // reads the header
+ byte[] b = this.b;
+ char[] c = context.buffer;
+ int maxStack = readUnsignedShort(u);
+ int maxLocals = readUnsignedShort(u + 2);
+ int codeLength = readInt(u + 4);
+ u += 8;
+
+ // reads the bytecode to find the labels
+ int codeStart = u;
+ int codeEnd = u + codeLength;
+ Label[] labels = context.labels = new Label[codeLength + 2];
+ readLabel(codeLength + 1, labels);
+ while (u < codeEnd) {
+ int offset = u - codeStart;
+ int opcode = b[u] & 0xFF;
+ switch (ClassWriter.TYPE[opcode]) {
+ case ClassWriter.NOARG_INSN:
+ case ClassWriter.IMPLVAR_INSN:
+ u += 1;
+ break;
+ case ClassWriter.LABEL_INSN:
+ readLabel(offset + readShort(u + 1), labels);
+ u += 3;
+ break;
+ case ClassWriter.LABELW_INSN:
+ readLabel(offset + readInt(u + 1), labels);
+ u += 5;
+ break;
+ case ClassWriter.WIDE_INSN:
+ opcode = b[u + 1] & 0xFF;
+ if (opcode == Opcodes.IINC) {
+ u += 6;
+ } else {
+ u += 4;
}
- if (ANNOTATIONS && impanns != 0) {
- readParameterAnnotations(impanns, desc, c, false, mv);
+ break;
+ case ClassWriter.TABL_INSN:
+ // skips 0 to 3 padding bytes
+ u = u + 4 - (offset & 3);
+ // reads instruction
+ readLabel(offset + readInt(u), labels);
+ for (int i = readInt(u + 8) - readInt(u + 4) + 1; i > 0; --i) {
+ readLabel(offset + readInt(u + 12), labels);
+ u += 4;
}
- while (cattrs != null) {
- attr = cattrs.next;
- cattrs.next = null;
- mv.visitAttribute(cattrs);
- cattrs = attr;
+ u += 12;
+ break;
+ case ClassWriter.LOOK_INSN:
+ // skips 0 to 3 padding bytes
+ u = u + 4 - (offset & 3);
+ // reads instruction
+ readLabel(offset + readInt(u), labels);
+ for (int i = readInt(u + 4); i > 0; --i) {
+ readLabel(offset + readInt(u + 12), labels);
+ u += 8;
}
+ u += 8;
+ break;
+ case ClassWriter.VAR_INSN:
+ case ClassWriter.SBYTE_INSN:
+ case ClassWriter.LDC_INSN:
+ u += 2;
+ break;
+ case ClassWriter.SHORT_INSN:
+ case ClassWriter.LDCW_INSN:
+ case ClassWriter.FIELDORMETH_INSN:
+ case ClassWriter.TYPE_INSN:
+ case ClassWriter.IINC_INSN:
+ u += 3;
+ break;
+ case ClassWriter.ITFMETH_INSN:
+ case ClassWriter.INDYMETH_INSN:
+ u += 5;
+ break;
+ // case MANA_INSN:
+ default:
+ u += 4;
+ break;
}
+ }
- if (mv != null && v != 0) {
- int maxStack = readUnsignedShort(v);
- int maxLocals = readUnsignedShort(v + 2);
- int codeLength = readInt(v + 4);
- v += 8;
+ // reads the try catch entries to find the labels, and also visits them
+ for (int i = readUnsignedShort(u); i > 0; --i) {
+ Label start = readLabel(readUnsignedShort(u + 2), labels);
+ Label end = readLabel(readUnsignedShort(u + 4), labels);
+ Label handler = readLabel(readUnsignedShort(u + 6), labels);
+ String type = readUTF8(items[readUnsignedShort(u + 8)], c);
+ mv.visitTryCatchBlock(start, end, handler, type);
+ u += 8;
+ }
+ u += 2;
- int codeStart = v;
- int codeEnd = v + codeLength;
-
- mv.visitCode();
-
- // 1st phase: finds the labels
- int label;
- Label[] labels = new Label[codeLength + 2];
- readLabel(codeLength + 1, labels);
- while (v < codeEnd) {
- w = v - codeStart;
- int opcode = b[v] & 0xFF;
- switch (ClassWriter.TYPE[opcode]) {
- case ClassWriter.NOARG_INSN:
- case ClassWriter.IMPLVAR_INSN:
- v += 1;
- break;
- case ClassWriter.LABEL_INSN:
- readLabel(w + readShort(v + 1), labels);
- v += 3;
- break;
- case ClassWriter.LABELW_INSN:
- readLabel(w + readInt(v + 1), labels);
- v += 5;
- break;
- case ClassWriter.WIDE_INSN:
- opcode = b[v + 1] & 0xFF;
- if (opcode == Opcodes.IINC) {
- v += 6;
- } else {
- v += 4;
- }
- break;
- case ClassWriter.TABL_INSN:
- // skips 0 to 3 padding bytes*
- v = v + 4 - (w & 3);
- // reads instruction
- readLabel(w + readInt(v), labels);
- j = readInt(v + 8) - readInt(v + 4) + 1;
- v += 12;
- for (; j > 0; --j) {
- readLabel(w + readInt(v), labels);
- v += 4;
- }
- break;
- case ClassWriter.LOOK_INSN:
- // skips 0 to 3 padding bytes*
- v = v + 4 - (w & 3);
- // reads instruction
- readLabel(w + readInt(v), labels);
- j = readInt(v + 4);
- v += 8;
- for (; j > 0; --j) {
- readLabel(w + readInt(v + 4), labels);
- v += 8;
- }
- break;
- case ClassWriter.VAR_INSN:
- case ClassWriter.SBYTE_INSN:
- case ClassWriter.LDC_INSN:
- v += 2;
- break;
- case ClassWriter.SHORT_INSN:
- case ClassWriter.LDCW_INSN:
- case ClassWriter.FIELDORMETH_INSN:
- case ClassWriter.TYPE_INSN:
- case ClassWriter.IINC_INSN:
- v += 3;
- break;
- case ClassWriter.ITFDYNMETH_INSN:
- v += 5;
- break;
- // case MANA_INSN:
- default:
- v += 4;
- break;
- }
- }
- // parses the try catch entries
- j = readUnsignedShort(v);
- v += 2;
- for (; j > 0; --j) {
- Label start = readLabel(readUnsignedShort(v), labels);
- Label end = readLabel(readUnsignedShort(v + 2), labels);
- Label handler = readLabel(readUnsignedShort(v + 4), labels);
- int type = readUnsignedShort(v + 6);
- if (type == 0) {
- mv.visitTryCatchBlock(start, end, handler, null);
- } else {
- mv.visitTryCatchBlock(start,
- end,
- handler,
- readUTF8(items[type], c));
- }
- v += 8;
- }
- // parses the local variable, line number tables, and code
- // attributes
- int varTable = 0;
- int varTypeTable = 0;
- int stackMap = 0;
- int stackMapSize = 0;
- int frameCount = 0;
- int frameMode = 0;
- int frameOffset = 0;
- int frameLocalCount = 0;
- int frameLocalDiff = 0;
- int frameStackCount = 0;
- Object[] frameLocal = null;
- Object[] frameStack = null;
- boolean zip = true;
- cattrs = null;
- j = readUnsignedShort(v);
- v += 2;
- for (; j > 0; --j) {
- attrName = readUTF8(v, c);
- if ("LocalVariableTable".equals(attrName)) {
- if (!skipDebug) {
- varTable = v + 6;
- k = readUnsignedShort(v + 6);
- w = v + 8;
- for (; k > 0; --k) {
- label = readUnsignedShort(w);
- if (labels[label] == null) {
- readLabel(label, labels).status |= Label.DEBUG;
- }
- label += readUnsignedShort(w + 2);
- if (labels[label] == null) {
- readLabel(label, labels).status |= Label.DEBUG;
- }
- w += 10;
- }
- }
- } else if ("LocalVariableTypeTable".equals(attrName)) {
- varTypeTable = v + 6;
- } else if ("LineNumberTable".equals(attrName)) {
- if (!skipDebug) {
- k = readUnsignedShort(v + 6);
- w = v + 8;
- for (; k > 0; --k) {
- label = readUnsignedShort(w);
- if (labels[label] == null) {
- readLabel(label, labels).status |= Label.DEBUG;
- }
- labels[label].line = readUnsignedShort(w + 2);
- w += 4;
- }
- }
- } else if (FRAMES && "StackMapTable".equals(attrName)) {
- if ((flags & SKIP_FRAMES) == 0) {
- stackMap = v + 8;
- stackMapSize = readInt(v + 2);
- frameCount = readUnsignedShort(v + 6);
+ // reads the code attributes
+ int[] tanns = null; // start index of each visible type annotation
+ int[] itanns = null; // start index of each invisible type annotation
+ int tann = 0; // current index in tanns array
+ int itann = 0; // current index in itanns array
+ int ntoff = -1; // next visible type annotation code offset
+ int nitoff = -1; // next invisible type annotation code offset
+ int varTable = 0;
+ int varTypeTable = 0;
+ boolean zip = true;
+ boolean unzip = (context.flags & EXPAND_FRAMES) != 0;
+ int stackMap = 0;
+ int stackMapSize = 0;
+ int frameCount = 0;
+ Context frame = null;
+ Attribute attributes = null;
+
+ for (int i = readUnsignedShort(u); i > 0; --i) {
+ String attrName = readUTF8(u + 2, c);
+ if ("LocalVariableTable".equals(attrName)) {
+ if ((context.flags & SKIP_DEBUG) == 0) {
+ varTable = u + 8;
+ for (int j = readUnsignedShort(u + 8), v = u; j > 0; --j) {
+ int label = readUnsignedShort(v + 10);
+ if (labels[label] == null) {
+ readLabel(label, labels).status |= Label.DEBUG;
}
- /*
- * here we do not extract the labels corresponding to
- * the attribute content. This would require a full
- * parsing of the attribute, which would need to be
- * repeated in the second phase (see below). Instead the
- * content of the attribute is read one frame at a time
- * (i.e. after a frame has been visited, the next frame
- * is read), and the labels it contains are also
- * extracted one frame at a time. Thanks to the ordering
- * of frames, having only a "one frame lookahead" is not
- * a problem, i.e. it is not possible to see an offset
- * smaller than the offset of the current insn and for
- * which no Label exist.
- */
- /*
- * This is not true for UNINITIALIZED type offsets. We
- * solve this by parsing the stack map table without a
- * full decoding (see below).
- */
- } else if (FRAMES && "StackMap".equals(attrName)) {
- if ((flags & SKIP_FRAMES) == 0) {
- stackMap = v + 8;
- stackMapSize = readInt(v + 2);
- frameCount = readUnsignedShort(v + 6);
- zip = false;
- }
- /*
- * IMPORTANT! here we assume that the frames are
- * ordered, as in the StackMapTable attribute, although
- * this is not guaranteed by the attribute format.
- */
- } else {
- for (k = 0; k < attrs.length; ++k) {
- if (attrs[k].type.equals(attrName)) {
- attr = attrs[k].read(this,
- v + 6,
- readInt(v + 2),
- c,
- codeStart - 8,
- labels);
- if (attr != null) {
- attr.next = cattrs;
- cattrs = attr;
- }
- }
+ label += readUnsignedShort(v + 12);
+ if (labels[label] == null) {
+ readLabel(label, labels).status |= Label.DEBUG;
}
+ v += 10;
}
- v += 6 + readInt(v + 2);
}
-
- // 2nd phase: visits each instruction
- if (FRAMES && stackMap != 0) {
- // creates the very first (implicit) frame from the method
- // descriptor
- frameLocal = new Object[maxLocals];
- frameStack = new Object[maxStack];
- if (unzip) {
- int local = 0;
- if ((access & Opcodes.ACC_STATIC) == 0) {
- if ("<init>".equals(name)) {
- frameLocal[local++] = Opcodes.UNINITIALIZED_THIS;
- } else {
- frameLocal[local++] = readClass(header + 2, c);
- }
- }
- j = 1;
- loop: while (true) {
- k = j;
- switch (desc.charAt(j++)) {
- case 'Z':
- case 'C':
- case 'B':
- case 'S':
- case 'I':
- frameLocal[local++] = Opcodes.INTEGER;
- break;
- case 'F':
- frameLocal[local++] = Opcodes.FLOAT;
- break;
- case 'J':
- frameLocal[local++] = Opcodes.LONG;
- break;
- case 'D':
- frameLocal[local++] = Opcodes.DOUBLE;
- break;
- case '[':
- while (desc.charAt(j) == '[') {
- ++j;
- }
- if (desc.charAt(j) == 'L') {
- ++j;
- while (desc.charAt(j) != ';') {
- ++j;
- }
- }
- frameLocal[local++] = desc.substring(k, ++j);
- break;
- case 'L':
- while (desc.charAt(j) != ';') {
- ++j;
- }
- frameLocal[local++] = desc.substring(k + 1,
- j++);
- break;
- default:
- break loop;
- }
+ } else if ("LocalVariableTypeTable".equals(attrName)) {
+ varTypeTable = u + 8;
+ } else if ("LineNumberTable".equals(attrName)) {
+ if ((context.flags & SKIP_DEBUG) == 0) {
+ for (int j = readUnsignedShort(u + 8), v = u; j > 0; --j) {
+ int label = readUnsignedShort(v + 10);
+ if (labels[label] == null) {
+ readLabel(label, labels).status |= Label.DEBUG;
}
- frameLocalCount = local;
+ labels[label].line = readUnsignedShort(v + 12);
+ v += 4;
}
- /*
- * for the first explicit frame the offset is not
- * offset_delta + 1 but only offset_delta; setting the
- * implicit frame offset to -1 allow the use of the
- * "offset_delta + 1" rule in all cases
- */
- frameOffset = -1;
- /*
- * Finds labels for UNINITIALIZED frame types. Instead of
- * decoding each element of the stack map table, we look
- * for 3 consecutive bytes that "look like" an UNINITIALIZED
- * type (tag 8, offset within code bounds, NEW instruction
- * at this offset). We may find false positives (i.e. not
- * real UNINITIALIZED types), but this should be rare, and
- * the only consequence will be the creation of an unneeded
- * label. This is better than creating a label for each NEW
- * instruction, and faster than fully decoding the whole
- * stack map table.
- */
- for (j = stackMap; j < stackMap + stackMapSize - 2; ++j) {
- if (b[j] == 8) { // UNINITIALIZED FRAME TYPE
- k = readUnsignedShort(j + 1);
- if (k >= 0 && k < codeLength) { // potential offset
- if ((b[codeStart + k] & 0xFF) == Opcodes.NEW) { // NEW at this offset
- readLabel(k, labels);
- }
- }
+ }
+ } else if (ANNOTATIONS
+ && "RuntimeVisibleTypeAnnotations".equals(attrName)) {
+ tanns = readTypeAnnotations(mv, context, u + 8, true);
+ ntoff = tanns.length == 0 || readByte(tanns[0]) < 0x43 ? -1
+ : readUnsignedShort(tanns[0] + 1);
+ } else if (ANNOTATIONS
+ && "RuntimeInvisibleTypeAnnotations".equals(attrName)) {
+ itanns = readTypeAnnotations(mv, context, u + 8, false);
+ nitoff = itanns.length == 0 || readByte(itanns[0]) < 0x43 ? -1
+ : readUnsignedShort(itanns[0] + 1);
+ } else if (FRAMES && "StackMapTable".equals(attrName)) {
+ if ((context.flags & SKIP_FRAMES) == 0) {
+ stackMap = u + 10;
+ stackMapSize = readInt(u + 4);
+ frameCount = readUnsignedShort(u + 8);
+ }
+ /*
+ * here we do not extract the labels corresponding to the
+ * attribute content. This would require a full parsing of the
+ * attribute, which would need to be repeated in the second
+ * phase (see below). Instead the content of the attribute is
+ * read one frame at a time (i.e. after a frame has been
+ * visited, the next frame is read), and the labels it contains
+ * are also extracted one frame at a time. Thanks to the
+ * ordering of frames, having only a "one frame lookahead" is
+ * not a problem, i.e. it is not possible to see an offset
+ * smaller than the offset of the current insn and for which no
+ * Label exist.
+ */
+ /*
+ * This is not true for UNINITIALIZED type offsets. We solve
+ * this by parsing the stack map table without a full decoding
+ * (see below).
+ */
+ } else if (FRAMES && "StackMap".equals(attrName)) {
+ if ((context.flags & SKIP_FRAMES) == 0) {
+ zip = false;
+ stackMap = u + 10;
+ stackMapSize = readInt(u + 4);
+ frameCount = readUnsignedShort(u + 8);
+ }
+ /*
+ * IMPORTANT! here we assume that the frames are ordered, as in
+ * the StackMapTable attribute, although this is not guaranteed
+ * by the attribute format.
+ */
+ } else {
+ for (int j = 0; j < context.attrs.length; ++j) {
+ if (context.attrs[j].type.equals(attrName)) {
+ Attribute attr = context.attrs[j].read(this, u + 8,
+ readInt(u + 4), c, codeStart - 8, labels);
+ if (attr != null) {
+ attr.next = attributes;
+ attributes = attr;
}
}
}
- v = codeStart;
- Label l;
- while (v < codeEnd) {
- w = v - codeStart;
-
- l = labels[w];
- if (l != null) {
- mv.visitLabel(l);
- if (!skipDebug && l.line > 0) {
- mv.visitLineNumber(l.line, l);
+ }
+ u += 6 + readInt(u + 4);
+ }
+ u += 2;
+
+ // generates the first (implicit) stack map frame
+ if (FRAMES && stackMap != 0) {
+ /*
+ * for the first explicit frame the offset is not offset_delta + 1
+ * but only offset_delta; setting the implicit frame offset to -1
+ * allow the use of the "offset_delta + 1" rule in all cases
+ */
+ frame = context;
+ frame.offset = -1;
+ frame.mode = 0;
+ frame.localCount = 0;
+ frame.localDiff = 0;
+ frame.stackCount = 0;
+ frame.local = new Object[maxLocals];
+ frame.stack = new Object[maxStack];
+ if (unzip) {
+ getImplicitFrame(context);
+ }
+ /*
+ * Finds labels for UNINITIALIZED frame types. Instead of decoding
+ * each element of the stack map table, we look for 3 consecutive
+ * bytes that "look like" an UNINITIALIZED type (tag 8, offset
+ * within code bounds, NEW instruction at this offset). We may find
+ * false positives (i.e. not real UNINITIALIZED types), but this
+ * should be rare, and the only consequence will be the creation of
+ * an unneeded label. This is better than creating a label for each
+ * NEW instruction, and faster than fully decoding the whole stack
+ * map table.
+ */
+ for (int i = stackMap; i < stackMap + stackMapSize - 2; ++i) {
+ if (b[i] == 8) { // UNINITIALIZED FRAME TYPE
+ int v = readUnsignedShort(i + 1);
+ if (v >= 0 && v < codeLength) {
+ if ((b[codeStart + v] & 0xFF) == Opcodes.NEW) {
+ readLabel(v, labels);
}
}
+ }
+ }
+ }
- while (FRAMES && frameLocal != null
- && (frameOffset == w || frameOffset == -1))
- {
- // if there is a frame for this offset,
- // makes the visitor visit it,
- // and reads the next frame if there is one.
- if (!zip || unzip) {
- mv.visitFrame(Opcodes.F_NEW,
- frameLocalCount,
- frameLocal,
- frameStackCount,
- frameStack);
- } else if (frameOffset != -1) {
- mv.visitFrame(frameMode,
- frameLocalDiff,
- frameLocal,
- frameStackCount,
- frameStack);
- }
+ // visits the instructions
+ u = codeStart;
+ while (u < codeEnd) {
+ int offset = u - codeStart;
+
+ // visits the label and line number for this offset, if any
+ Label l = labels[offset];
+ if (l != null) {
+ mv.visitLabel(l);
+ if ((context.flags & SKIP_DEBUG) == 0 && l.line > 0) {
+ mv.visitLineNumber(l.line, l);
+ }
+ }
- if (frameCount > 0) {
- int tag, delta, n;
- if (zip) {
- tag = b[stackMap++] & 0xFF;
- } else {
- tag = MethodWriter.FULL_FRAME;
- frameOffset = -1;
- }
- frameLocalDiff = 0;
- if (tag < MethodWriter.SAME_LOCALS_1_STACK_ITEM_FRAME)
- {
- delta = tag;
- frameMode = Opcodes.F_SAME;
- frameStackCount = 0;
- } else if (tag < MethodWriter.RESERVED) {
- delta = tag
- - MethodWriter.SAME_LOCALS_1_STACK_ITEM_FRAME;
- stackMap = readFrameType(frameStack,
- 0,
- stackMap,
- c,
- labels);
- frameMode = Opcodes.F_SAME1;
- frameStackCount = 1;
- } else {
- delta = readUnsignedShort(stackMap);
- stackMap += 2;
- if (tag == MethodWriter.SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED)
- {
- stackMap = readFrameType(frameStack,
- 0,
- stackMap,
- c,
- labels);
- frameMode = Opcodes.F_SAME1;
- frameStackCount = 1;
- } else if (tag >= MethodWriter.CHOP_FRAME
- && tag < MethodWriter.SAME_FRAME_EXTENDED)
- {
- frameMode = Opcodes.F_CHOP;
- frameLocalDiff = MethodWriter.SAME_FRAME_EXTENDED
- - tag;
- frameLocalCount -= frameLocalDiff;
- frameStackCount = 0;
- } else if (tag == MethodWriter.SAME_FRAME_EXTENDED)
- {
- frameMode = Opcodes.F_SAME;
- frameStackCount = 0;
- } else if (tag < MethodWriter.FULL_FRAME) {
- j = unzip ? frameLocalCount : 0;
- for (k = tag
- - MethodWriter.SAME_FRAME_EXTENDED; k > 0; k--)
- {
- stackMap = readFrameType(frameLocal,
- j++,
- stackMap,
- c,
- labels);
- }
- frameMode = Opcodes.F_APPEND;
- frameLocalDiff = tag
- - MethodWriter.SAME_FRAME_EXTENDED;
- frameLocalCount += frameLocalDiff;
- frameStackCount = 0;
- } else { // if (tag == FULL_FRAME) {
- frameMode = Opcodes.F_FULL;
- n = frameLocalDiff = frameLocalCount = readUnsignedShort(stackMap);
- stackMap += 2;
- for (j = 0; n > 0; n--) {
- stackMap = readFrameType(frameLocal,
- j++,
- stackMap,
- c,
- labels);
- }
- n = frameStackCount = readUnsignedShort(stackMap);
- stackMap += 2;
- for (j = 0; n > 0; n--) {
- stackMap = readFrameType(frameStack,
- j++,
- stackMap,
- c,
- labels);
- }
- }
- }
- frameOffset += delta + 1;
- readLabel(frameOffset, labels);
-
- --frameCount;
- } else {
- frameLocal = null;
- }
+ // visits the frame for this offset, if any
+ while (FRAMES && frame != null
+ && (frame.offset == offset || frame.offset == -1)) {
+ // if there is a frame for this offset, makes the visitor visit
+ // it, and reads the next frame if there is one.
+ if (frame.offset != -1) {
+ if (!zip || unzip) {
+ mv.visitFrame(Opcodes.F_NEW, frame.localCount,
+ frame.local, frame.stackCount, frame.stack);
+ } else {
+ mv.visitFrame(frame.mode, frame.localDiff, frame.local,
+ frame.stackCount, frame.stack);
}
+ }
+ if (frameCount > 0) {
+ stackMap = readFrame(stackMap, zip, unzip, frame);
+ --frameCount;
+ } else {
+ frame = null;
+ }
+ }
- int opcode = b[v] & 0xFF;
- switch (ClassWriter.TYPE[opcode]) {
- case ClassWriter.NOARG_INSN:
- mv.visitInsn(opcode);
- v += 1;
- break;
- case ClassWriter.IMPLVAR_INSN:
- if (opcode > Opcodes.ISTORE) {
- opcode -= 59; // ISTORE_0
- mv.visitVarInsn(Opcodes.ISTORE + (opcode >> 2),
- opcode & 0x3);
- } else {
- opcode -= 26; // ILOAD_0
- mv.visitVarInsn(Opcodes.ILOAD + (opcode >> 2),
- opcode & 0x3);
- }
- v += 1;
- break;
- case ClassWriter.LABEL_INSN:
- mv.visitJumpInsn(opcode, labels[w
- + readShort(v + 1)]);
- v += 3;
- break;
- case ClassWriter.LABELW_INSN:
- mv.visitJumpInsn(opcode - 33, labels[w
- + readInt(v + 1)]);
- v += 5;
- break;
- case ClassWriter.WIDE_INSN:
- opcode = b[v + 1] & 0xFF;
- if (opcode == Opcodes.IINC) {
- mv.visitIincInsn(readUnsignedShort(v + 2),
- readShort(v + 4));
- v += 6;
- } else {
- mv.visitVarInsn(opcode,
- readUnsignedShort(v + 2));
- v += 4;
- }
- break;
- case ClassWriter.TABL_INSN:
- // skips 0 to 3 padding bytes
- v = v + 4 - (w & 3);
- // reads instruction
- label = w + readInt(v);
- int min = readInt(v + 4);
- int max = readInt(v + 8);
- v += 12;
- Label[] table = new Label[max - min + 1];
- for (j = 0; j < table.length; ++j) {
- table[j] = labels[w + readInt(v)];
- v += 4;
- }
- mv.visitTableSwitchInsn(min,
- max,
- labels[label],
- table);
- break;
- case ClassWriter.LOOK_INSN:
- // skips 0 to 3 padding bytes
- v = v + 4 - (w & 3);
- // reads instruction
- label = w + readInt(v);
- j = readInt(v + 4);
- v += 8;
- int[] keys = new int[j];
- Label[] values = new Label[j];
- for (j = 0; j < keys.length; ++j) {
- keys[j] = readInt(v);
- values[j] = labels[w + readInt(v + 4)];
- v += 8;
- }
- mv.visitLookupSwitchInsn(labels[label],
- keys,
- values);
- break;
- case ClassWriter.VAR_INSN:
- mv.visitVarInsn(opcode, b[v + 1] & 0xFF);
- v += 2;
- break;
- case ClassWriter.SBYTE_INSN:
- mv.visitIntInsn(opcode, b[v + 1]);
- v += 2;
- break;
- case ClassWriter.SHORT_INSN:
- mv.visitIntInsn(opcode, readShort(v + 1));
- v += 3;
- break;
- case ClassWriter.LDC_INSN:
- mv.visitLdcInsn(readConst(b[v + 1] & 0xFF, c));
- v += 2;
- break;
- case ClassWriter.LDCW_INSN:
- mv.visitLdcInsn(readConst(readUnsignedShort(v + 1),
- c));
- v += 3;
- break;
- case ClassWriter.FIELDORMETH_INSN:
- case ClassWriter.ITFDYNMETH_INSN:
- int cpIndex = items[readUnsignedShort(v + 1)];
- String iowner;
- // INVOKEDYNAMIC is receiverless
- if (opcode == Opcodes.INVOKEDYNAMIC) {
- iowner = Opcodes.INVOKEDYNAMIC_OWNER;
- } else {
- iowner = readClass(cpIndex, c);
- cpIndex = items[readUnsignedShort(cpIndex + 2)];
- }
- String iname = readUTF8(cpIndex, c);
- String idesc = readUTF8(cpIndex + 2, c);
- if (opcode < Opcodes.INVOKEVIRTUAL) {
- mv.visitFieldInsn(opcode, iowner, iname, idesc);
- } else {
- mv.visitMethodInsn(opcode, iowner, iname, idesc);
- }
- if (opcode == Opcodes.INVOKEINTERFACE || opcode == Opcodes.INVOKEDYNAMIC) {
- v += 5;
- } else {
- v += 3;
- }
- break;
- case ClassWriter.TYPE_INSN:
- mv.visitTypeInsn(opcode, readClass(v + 1, c));
- v += 3;
- break;
- case ClassWriter.IINC_INSN:
- mv.visitIincInsn(b[v + 1] & 0xFF, b[v + 2]);
- v += 3;
- break;
- // case MANA_INSN:
- default:
- mv.visitMultiANewArrayInsn(readClass(v + 1, c),
- b[v + 3] & 0xFF);
- v += 4;
- break;
- }
+ // visits the instruction at this offset
+ int opcode = b[u] & 0xFF;
+ switch (ClassWriter.TYPE[opcode]) {
+ case ClassWriter.NOARG_INSN:
+ mv.visitInsn(opcode);
+ u += 1;
+ break;
+ case ClassWriter.IMPLVAR_INSN:
+ if (opcode > Opcodes.ISTORE) {
+ opcode -= 59; // ISTORE_0
+ mv.visitVarInsn(Opcodes.ISTORE + (opcode >> 2),
+ opcode & 0x3);
+ } else {
+ opcode -= 26; // ILOAD_0
+ mv.visitVarInsn(Opcodes.ILOAD + (opcode >> 2), opcode & 0x3);
}
- l = labels[codeEnd - codeStart];
- if (l != null) {
- mv.visitLabel(l);
+ u += 1;
+ break;
+ case ClassWriter.LABEL_INSN:
+ mv.visitJumpInsn(opcode, labels[offset + readShort(u + 1)]);
+ u += 3;
+ break;
+ case ClassWriter.LABELW_INSN:
+ mv.visitJumpInsn(opcode - 33, labels[offset + readInt(u + 1)]);
+ u += 5;
+ break;
+ case ClassWriter.WIDE_INSN:
+ opcode = b[u + 1] & 0xFF;
+ if (opcode == Opcodes.IINC) {
+ mv.visitIincInsn(readUnsignedShort(u + 2), readShort(u + 4));
+ u += 6;
+ } else {
+ mv.visitVarInsn(opcode, readUnsignedShort(u + 2));
+ u += 4;
}
- // visits the local variable tables
- if (!skipDebug && varTable != 0) {
- int[] typeTable = null;
- if (varTypeTable != 0) {
- k = readUnsignedShort(varTypeTable) * 3;
- w = varTypeTable + 2;
- typeTable = new int[k];
- while (k > 0) {
- typeTable[--k] = w + 6; // signature
- typeTable[--k] = readUnsignedShort(w + 8); // index
- typeTable[--k] = readUnsignedShort(w); // start
- w += 10;
- }
- }
- k = readUnsignedShort(varTable);
- w = varTable + 2;
- for (; k > 0; --k) {
- int start = readUnsignedShort(w);
- int length = readUnsignedShort(w + 2);
- int index = readUnsignedShort(w + 8);
- String vsignature = null;
- if (typeTable != null) {
- for (int a = 0; a < typeTable.length; a += 3) {
- if (typeTable[a] == start
- && typeTable[a + 1] == index)
- {
- vsignature = readUTF8(typeTable[a + 2], c);
- break;
- }
- }
+ break;
+ case ClassWriter.TABL_INSN: {
+ // skips 0 to 3 padding bytes
+ u = u + 4 - (offset & 3);
+ // reads instruction
+ int label = offset + readInt(u);
+ int min = readInt(u + 4);
+ int max = readInt(u + 8);
+ Label[] table = new Label[max - min + 1];
+ u += 12;
+ for (int i = 0; i < table.length; ++i) {
+ table[i] = labels[offset + readInt(u)];
+ u += 4;
+ }
+ mv.visitTableSwitchInsn(min, max, labels[label], table);
+ break;
+ }
+ case ClassWriter.LOOK_INSN: {
+ // skips 0 to 3 padding bytes
+ u = u + 4 - (offset & 3);
+ // reads instruction
+ int label = offset + readInt(u);
+ int len = readInt(u + 4);
+ int[] keys = new int[len];
+ Label[] values = new Label[len];
+ u += 8;
+ for (int i = 0; i < len; ++i) {
+ keys[i] = readInt(u);
+ values[i] = labels[offset + readInt(u + 4)];
+ u += 8;
+ }
+ mv.visitLookupSwitchInsn(labels[label], keys, values);
+ break;
+ }
+ case ClassWriter.VAR_INSN:
+ mv.visitVarInsn(opcode, b[u + 1] & 0xFF);
+ u += 2;
+ break;
+ case ClassWriter.SBYTE_INSN:
+ mv.visitIntInsn(opcode, b[u + 1]);
+ u += 2;
+ break;
+ case ClassWriter.SHORT_INSN:
+ mv.visitIntInsn(opcode, readShort(u + 1));
+ u += 3;
+ break;
+ case ClassWriter.LDC_INSN:
+ mv.visitLdcInsn(readConst(b[u + 1] & 0xFF, c));
+ u += 2;
+ break;
+ case ClassWriter.LDCW_INSN:
+ mv.visitLdcInsn(readConst(readUnsignedShort(u + 1), c));
+ u += 3;
+ break;
+ case ClassWriter.FIELDORMETH_INSN:
+ case ClassWriter.ITFMETH_INSN: {
+ int cpIndex = items[readUnsignedShort(u + 1)];
+ boolean itf = b[cpIndex - 1] == ClassWriter.IMETH;
+ String iowner = readClass(cpIndex, c);
+ cpIndex = items[readUnsignedShort(cpIndex + 2)];
+ String iname = readUTF8(cpIndex, c);
+ String idesc = readUTF8(cpIndex + 2, c);
+ if (opcode < Opcodes.INVOKEVIRTUAL) {
+ mv.visitFieldInsn(opcode, iowner, iname, idesc);
+ } else {
+ mv.visitMethodInsn(opcode, iowner, iname, idesc, itf);
+ }
+ if (opcode == Opcodes.INVOKEINTERFACE) {
+ u += 5;
+ } else {
+ u += 3;
+ }
+ break;
+ }
+ case ClassWriter.INDYMETH_INSN: {
+ int cpIndex = items[readUnsignedShort(u + 1)];
+ int bsmIndex = context.bootstrapMethods[readUnsignedShort(cpIndex)];
+ Handle bsm = (Handle) readConst(readUnsignedShort(bsmIndex), c);
+ int bsmArgCount = readUnsignedShort(bsmIndex + 2);
+ Object[] bsmArgs = new Object[bsmArgCount];
+ bsmIndex += 4;
+ for (int i = 0; i < bsmArgCount; i++) {
+ bsmArgs[i] = readConst(readUnsignedShort(bsmIndex), c);
+ bsmIndex += 2;
+ }
+ cpIndex = items[readUnsignedShort(cpIndex + 2)];
+ String iname = readUTF8(cpIndex, c);
+ String idesc = readUTF8(cpIndex + 2, c);
+ mv.visitInvokeDynamicInsn(iname, idesc, bsm, bsmArgs);
+ u += 5;
+ break;
+ }
+ case ClassWriter.TYPE_INSN:
+ mv.visitTypeInsn(opcode, readClass(u + 1, c));
+ u += 3;
+ break;
+ case ClassWriter.IINC_INSN:
+ mv.visitIincInsn(b[u + 1] & 0xFF, b[u + 2]);
+ u += 3;
+ break;
+ // case MANA_INSN:
+ default:
+ mv.visitMultiANewArrayInsn(readClass(u + 1, c), b[u + 3] & 0xFF);
+ u += 4;
+ break;
+ }
+
+ // visit the instruction annotations, if any
+ while (tanns != null && tann < tanns.length && ntoff <= offset) {
+ if (ntoff == offset) {
+ int v = readAnnotationTarget(context, tanns[tann]);
+ readAnnotationValues(v + 2, c, true,
+ mv.visitInsnAnnotation(context.typeRef,
+ context.typePath, readUTF8(v, c), true));
+ }
+ ntoff = ++tann >= tanns.length || readByte(tanns[tann]) < 0x43 ? -1
+ : readUnsignedShort(tanns[tann] + 1);
+ }
+ while (itanns != null && itann < itanns.length && nitoff <= offset) {
+ if (nitoff == offset) {
+ int v = readAnnotationTarget(context, itanns[itann]);
+ readAnnotationValues(v + 2, c, true,
+ mv.visitInsnAnnotation(context.typeRef,
+ context.typePath, readUTF8(v, c), false));
+ }
+ nitoff = ++itann >= itanns.length
+ || readByte(itanns[itann]) < 0x43 ? -1
+ : readUnsignedShort(itanns[itann] + 1);
+ }
+ }
+ if (labels[codeLength] != null) {
+ mv.visitLabel(labels[codeLength]);
+ }
+
+ // visits the local variable tables
+ if ((context.flags & SKIP_DEBUG) == 0 && varTable != 0) {
+ int[] typeTable = null;
+ if (varTypeTable != 0) {
+ u = varTypeTable + 2;
+ typeTable = new int[readUnsignedShort(varTypeTable) * 3];
+ for (int i = typeTable.length; i > 0;) {
+ typeTable[--i] = u + 6; // signature
+ typeTable[--i] = readUnsignedShort(u + 8); // index
+ typeTable[--i] = readUnsignedShort(u); // start
+ u += 10;
+ }
+ }
+ u = varTable + 2;
+ for (int i = readUnsignedShort(varTable); i > 0; --i) {
+ int start = readUnsignedShort(u);
+ int length = readUnsignedShort(u + 2);
+ int index = readUnsignedShort(u + 8);
+ String vsignature = null;
+ if (typeTable != null) {
+ for (int j = 0; j < typeTable.length; j += 3) {
+ if (typeTable[j] == start && typeTable[j + 1] == index) {
+ vsignature = readUTF8(typeTable[j + 2], c);
+ break;
}
- mv.visitLocalVariable(readUTF8(w + 4, c),
- readUTF8(w + 6, c),
- vsignature,
- labels[start],
- labels[start + length],
- index);
- w += 10;
}
}
- // visits the other attributes
- while (cattrs != null) {
- attr = cattrs.next;
- cattrs.next = null;
- mv.visitAttribute(cattrs);
- cattrs = attr;
+ mv.visitLocalVariable(readUTF8(u + 4, c), readUTF8(u + 6, c),
+ vsignature, labels[start], labels[start + length],
+ index);
+ u += 10;
+ }
+ }
+
+ // visits the local variables type annotations
+ if (tanns != null) {
+ for (int i = 0; i < tanns.length; ++i) {
+ if ((readByte(tanns[i]) >> 1) == (0x40 >> 1)) {
+ int v = readAnnotationTarget(context, tanns[i]);
+ v = readAnnotationValues(v + 2, c, true,
+ mv.visitLocalVariableAnnotation(context.typeRef,
+ context.typePath, context.start,
+ context.end, context.index, readUTF8(v, c),
+ true));
+ }
+ }
+ }
+ if (itanns != null) {
+ for (int i = 0; i < itanns.length; ++i) {
+ if ((readByte(itanns[i]) >> 1) == (0x40 >> 1)) {
+ int v = readAnnotationTarget(context, itanns[i]);
+ v = readAnnotationValues(v + 2, c, true,
+ mv.visitLocalVariableAnnotation(context.typeRef,
+ context.typePath, context.start,
+ context.end, context.index, readUTF8(v, c),
+ false));
}
- // visits the max stack and max locals values
- mv.visitMaxs(maxStack, maxLocals);
}
+ }
+
+ // visits the code attributes
+ while (attributes != null) {
+ Attribute attr = attributes.next;
+ attributes.next = null;
+ mv.visitAttribute(attributes);
+ attributes = attr;
+ }
+
+ // visits the max stack and max locals values
+ mv.visitMaxs(maxStack, maxLocals);
+ }
- if (mv != null) {
- mv.visitEnd();
+ /**
+ * Parses a type annotation table to find the labels, and to visit the try
+ * catch block annotations.
+ *
+ * @param u
+ * the start offset of a type annotation table.
+ * @param mv
+ * the method visitor to be used to visit the try catch block
+ * annotations.
+ * @param context
+ * information about the class being parsed.
+ * @param visible
+ * if the type annotation table to parse contains runtime visible
+ * annotations.
+ * @return the start offset of each type annotation in the parsed table.
+ */
+ private int[] readTypeAnnotations(final MethodVisitor mv,
+ final Context context, int u, boolean visible) {
+ char[] c = context.buffer;
+ int[] offsets = new int[readUnsignedShort(u)];
+ u += 2;
+ for (int i = 0; i < offsets.length; ++i) {
+ offsets[i] = u;
+ int target = readInt(u);
+ switch (target >>> 24) {
+ case 0x00: // CLASS_TYPE_PARAMETER
+ case 0x01: // METHOD_TYPE_PARAMETER
+ case 0x16: // METHOD_FORMAL_PARAMETER
+ u += 2;
+ break;
+ case 0x13: // FIELD
+ case 0x14: // METHOD_RETURN
+ case 0x15: // METHOD_RECEIVER
+ u += 1;
+ break;
+ case 0x40: // LOCAL_VARIABLE
+ case 0x41: // RESOURCE_VARIABLE
+ for (int j = readUnsignedShort(u + 1); j > 0; --j) {
+ int start = readUnsignedShort(u + 3);
+ int length = readUnsignedShort(u + 5);
+ readLabel(start, context.labels);
+ readLabel(start + length, context.labels);
+ u += 6;
+ }
+ u += 3;
+ break;
+ case 0x47: // CAST
+ case 0x48: // CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT
+ case 0x49: // METHOD_INVOCATION_TYPE_ARGUMENT
+ case 0x4A: // CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT
+ case 0x4B: // METHOD_REFERENCE_TYPE_ARGUMENT
+ u += 4;
+ break;
+ // case 0x10: // CLASS_EXTENDS
+ // case 0x11: // CLASS_TYPE_PARAMETER_BOUND
+ // case 0x12: // METHOD_TYPE_PARAMETER_BOUND
+ // case 0x17: // THROWS
+ // case 0x42: // EXCEPTION_PARAMETER
+ // case 0x43: // INSTANCEOF
+ // case 0x44: // NEW
+ // case 0x45: // CONSTRUCTOR_REFERENCE
+ // case 0x46: // METHOD_REFERENCE
+ default:
+ u += 3;
+ break;
+ }
+ int pathLength = readByte(u);
+ if ((target >>> 24) == 0x42) {
+ TypePath path = pathLength == 0 ? null : new TypePath(b, u);
+ u += 1 + 2 * pathLength;
+ u = readAnnotationValues(u + 2, c, true,
+ mv.visitTryCatchAnnotation(target, path,
+ readUTF8(u, c), visible));
+ } else {
+ u = readAnnotationValues(u + 3 + 2 * pathLength, c, true, null);
}
}
+ return offsets;
+ }
- // visits the end of the class
- classVisitor.visitEnd();
+ /**
+ * Parses the header of a type annotation to extract its target_type and
+ * target_path (the result is stored in the given context), and returns the
+ * start offset of the rest of the type_annotation structure (i.e. the
+ * offset to the type_index field, which is followed by
+ * num_element_value_pairs and then the name,value pairs).
+ *
+ * @param context
+ * information about the class being parsed. This is where the
+ * extracted target_type and target_path must be stored.
+ * @param u
+ * the start offset of a type_annotation structure.
+ * @return the start offset of the rest of the type_annotation structure.
+ */
+ private int readAnnotationTarget(final Context context, int u) {
+ int target = readInt(u);
+ switch (target >>> 24) {
+ case 0x00: // CLASS_TYPE_PARAMETER
+ case 0x01: // METHOD_TYPE_PARAMETER
+ case 0x16: // METHOD_FORMAL_PARAMETER
+ target &= 0xFFFF0000;
+ u += 2;
+ break;
+ case 0x13: // FIELD
+ case 0x14: // METHOD_RETURN
+ case 0x15: // METHOD_RECEIVER
+ target &= 0xFF000000;
+ u += 1;
+ break;
+ case 0x40: // LOCAL_VARIABLE
+ case 0x41: { // RESOURCE_VARIABLE
+ target &= 0xFF000000;
+ int n = readUnsignedShort(u + 1);
+ context.start = new Label[n];
+ context.end = new Label[n];
+ context.index = new int[n];
+ u += 3;
+ for (int i = 0; i < n; ++i) {
+ int start = readUnsignedShort(u);
+ int length = readUnsignedShort(u + 2);
+ context.start[i] = readLabel(start, context.labels);
+ context.end[i] = readLabel(start + length, context.labels);
+ context.index[i] = readUnsignedShort(u + 4);
+ u += 6;
+ }
+ break;
+ }
+ case 0x47: // CAST
+ case 0x48: // CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT
+ case 0x49: // METHOD_INVOCATION_TYPE_ARGUMENT
+ case 0x4A: // CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT
+ case 0x4B: // METHOD_REFERENCE_TYPE_ARGUMENT
+ target &= 0xFF0000FF;
+ u += 4;
+ break;
+ // case 0x10: // CLASS_EXTENDS
+ // case 0x11: // CLASS_TYPE_PARAMETER_BOUND
+ // case 0x12: // METHOD_TYPE_PARAMETER_BOUND
+ // case 0x17: // THROWS
+ // case 0x42: // EXCEPTION_PARAMETER
+ // case 0x43: // INSTANCEOF
+ // case 0x44: // NEW
+ // case 0x45: // CONSTRUCTOR_REFERENCE
+ // case 0x46: // METHOD_REFERENCE
+ default:
+ target &= (target >>> 24) < 0x43 ? 0xFFFFFF00 : 0xFF000000;
+ u += 3;
+ break;
+ }
+ int pathLength = readByte(u);
+ context.typeRef = target;
+ context.typePath = pathLength == 0 ? null : new TypePath(b, u);
+ return u + 1 + 2 * pathLength;
}
/**
* Reads parameter annotations and makes the given visitor visit them.
*
- * @param v start offset in {@link #b b} of the annotations to be read.
- * @param desc the method descriptor.
- * @param buf buffer to be used to call {@link #readUTF8 readUTF8},
- * {@link #readClass(int,char[]) readClass} or
- * {@link #readConst readConst}.
- * @param visible <tt>true</tt> if the annotations to be read are visible
- * at runtime.
- * @param mv the visitor that must visit the annotations.
+ * @param mv
+ * the visitor that must visit the annotations.
+ * @param context
+ * information about the class being parsed.
+ * @param v
+ * start offset in {@link #b b} of the annotations to be read.
+ * @param visible
+ * <tt>true</tt> if the annotations to be read are visible at
+ * runtime.
*/
- private void readParameterAnnotations(
- int v,
- final String desc,
- final char[] buf,
- final boolean visible,
- final MethodVisitor mv)
- {
+ private void readParameterAnnotations(final MethodVisitor mv,
+ final Context context, int v, final boolean visible) {
int i;
int n = b[v++] & 0xFF;
// workaround for a bug in javac (javac compiler generates a parameter
@@ -1522,21 +1732,22 @@ public class ClassReader {
// equal to the number of parameters in the method descriptor - which
// includes the synthetic parameters added by the compiler). This work-
// around supposes that the synthetic parameters are the first ones.
- int synthetics = Type.getArgumentTypes(desc).length - n;
+ int synthetics = Type.getArgumentTypes(context.desc).length - n;
AnnotationVisitor av;
for (i = 0; i < synthetics; ++i) {
- // virtual annotation to detect synthetic parameters in MethodWriter
+ // virtual annotation to detect synthetic parameters in MethodWriter
av = mv.visitParameterAnnotation(i, "Ljava/lang/Synthetic;", false);
if (av != null) {
av.visitEnd();
}
}
+ char[] c = context.buffer;
for (; i < n + synthetics; ++i) {
int j = readUnsignedShort(v);
v += 2;
for (; j > 0; --j) {
- av = mv.visitParameterAnnotation(i, readUTF8(v, buf), visible);
- v = readAnnotationValues(v + 2, buf, true, av);
+ av = mv.visitParameterAnnotation(i, readUTF8(v, c), visible);
+ v = readAnnotationValues(v + 2, c, true, av);
}
}
}
@@ -1544,21 +1755,22 @@ public class ClassReader {
/**
* Reads the values of an annotation and makes the given visitor visit them.
*
- * @param v the start offset in {@link #b b} of the values to be read
- * (including the unsigned short that gives the number of values).
- * @param buf buffer to be used to call {@link #readUTF8 readUTF8},
- * {@link #readClass(int,char[]) readClass} or
- * {@link #readConst readConst}.
- * @param named if the annotation values are named or not.
- * @param av the visitor that must visit the values.
+ * @param v
+ * the start offset in {@link #b b} of the values to be read
+ * (including the unsigned short that gives the number of
+ * values).
+ * @param buf
+ * buffer to be used to call {@link #readUTF8 readUTF8},
+ * {@link #readClass(int,char[]) readClass} or {@link #readConst
+ * readConst}.
+ * @param named
+ * if the annotation values are named or not.
+ * @param av
+ * the visitor that must visit the values.
* @return the end offset of the annotation values.
*/
- private int readAnnotationValues(
- int v,
- final char[] buf,
- final boolean named,
- final AnnotationVisitor av)
- {
+ private int readAnnotationValues(int v, final char[] buf,
+ final boolean named, final AnnotationVisitor av) {
int i = readUnsignedShort(v);
v += 2;
if (named) {
@@ -1579,210 +1791,368 @@ public class ClassReader {
/**
* Reads a value of an annotation and makes the given visitor visit it.
*
- * @param v the start offset in {@link #b b} of the value to be read (<i>not
- * including the value name constant pool index</i>).
- * @param buf buffer to be used to call {@link #readUTF8 readUTF8},
- * {@link #readClass(int,char[]) readClass} or
- * {@link #readConst readConst}.
- * @param name the name of the value to be read.
- * @param av the visitor that must visit the value.
+ * @param v
+ * the start offset in {@link #b b} of the value to be read
+ * (<i>not including the value name constant pool index</i>).
+ * @param buf
+ * buffer to be used to call {@link #readUTF8 readUTF8},
+ * {@link #readClass(int,char[]) readClass} or {@link #readConst
+ * readConst}.
+ * @param name
+ * the name of the value to be read.
+ * @param av
+ * the visitor that must visit the value.
* @return the end offset of the annotation value.
*/
- private int readAnnotationValue(
- int v,
- final char[] buf,
- final String name,
- final AnnotationVisitor av)
- {
+ private int readAnnotationValue(int v, final char[] buf, final String name,
+ final AnnotationVisitor av) {
int i;
if (av == null) {
switch (b[v] & 0xFF) {
- case 'e': // enum_const_value
- return v + 5;
- case '@': // annotation_value
- return readAnnotationValues(v + 3, buf, true, null);
- case '[': // array_value
- return readAnnotationValues(v + 1, buf, false, null);
- default:
- return v + 3;
+ case 'e': // enum_const_value
+ return v + 5;
+ case '@': // annotation_value
+ return readAnnotationValues(v + 3, buf, true, null);
+ case '[': // array_value
+ return readAnnotationValues(v + 1, buf, false, null);
+ default:
+ return v + 3;
}
}
switch (b[v++] & 0xFF) {
- case 'I': // pointer to CONSTANT_Integer
- case 'J': // pointer to CONSTANT_Long
- case 'F': // pointer to CONSTANT_Float
- case 'D': // pointer to CONSTANT_Double
- av.visit(name, readConst(readUnsignedShort(v), buf));
- v += 2;
- break;
- case 'B': // pointer to CONSTANT_Byte
- av.visit(name,
- new Byte((byte) readInt(items[readUnsignedShort(v)])));
- v += 2;
- break;
- case 'Z': // pointer to CONSTANT_Boolean
- av.visit(name, readInt(items[readUnsignedShort(v)]) == 0
- ? Boolean.FALSE
- : Boolean.TRUE);
- v += 2;
- break;
- case 'S': // pointer to CONSTANT_Short
- av.visit(name,
- new Short((short) readInt(items[readUnsignedShort(v)])));
- v += 2;
+ case 'I': // pointer to CONSTANT_Integer
+ case 'J': // pointer to CONSTANT_Long
+ case 'F': // pointer to CONSTANT_Float
+ case 'D': // pointer to CONSTANT_Double
+ av.visit(name, readConst(readUnsignedShort(v), buf));
+ v += 2;
+ break;
+ case 'B': // pointer to CONSTANT_Byte
+ av.visit(name,
+ new Byte((byte) readInt(items[readUnsignedShort(v)])));
+ v += 2;
+ break;
+ case 'Z': // pointer to CONSTANT_Boolean
+ av.visit(name,
+ readInt(items[readUnsignedShort(v)]) == 0 ? Boolean.FALSE
+ : Boolean.TRUE);
+ v += 2;
+ break;
+ case 'S': // pointer to CONSTANT_Short
+ av.visit(name, new Short(
+ (short) readInt(items[readUnsignedShort(v)])));
+ v += 2;
+ break;
+ case 'C': // pointer to CONSTANT_Char
+ av.visit(name, new Character(
+ (char) readInt(items[readUnsignedShort(v)])));
+ v += 2;
+ break;
+ case 's': // pointer to CONSTANT_Utf8
+ av.visit(name, readUTF8(v, buf));
+ v += 2;
+ break;
+ case 'e': // enum_const_value
+ av.visitEnum(name, readUTF8(v, buf), readUTF8(v + 2, buf));
+ v += 4;
+ break;
+ case 'c': // class_info
+ av.visit(name, Type.getType(readUTF8(v, buf)));
+ v += 2;
+ break;
+ case '@': // annotation_value
+ v = readAnnotationValues(v + 2, buf, true,
+ av.visitAnnotation(name, readUTF8(v, buf)));
+ break;
+ case '[': // array_value
+ int size = readUnsignedShort(v);
+ v += 2;
+ if (size == 0) {
+ return readAnnotationValues(v - 2, buf, false,
+ av.visitArray(name));
+ }
+ switch (this.b[v++] & 0xFF) {
+ case 'B':
+ byte[] bv = new byte[size];
+ for (i = 0; i < size; i++) {
+ bv[i] = (byte) readInt(items[readUnsignedShort(v)]);
+ v += 3;
+ }
+ av.visit(name, bv);
+ --v;
break;
- case 'C': // pointer to CONSTANT_Char
- av.visit(name,
- new Character((char) readInt(items[readUnsignedShort(v)])));
- v += 2;
+ case 'Z':
+ boolean[] zv = new boolean[size];
+ for (i = 0; i < size; i++) {
+ zv[i] = readInt(items[readUnsignedShort(v)]) != 0;
+ v += 3;
+ }
+ av.visit(name, zv);
+ --v;
break;
- case 's': // pointer to CONSTANT_Utf8
- av.visit(name, readUTF8(v, buf));
- v += 2;
+ case 'S':
+ short[] sv = new short[size];
+ for (i = 0; i < size; i++) {
+ sv[i] = (short) readInt(items[readUnsignedShort(v)]);
+ v += 3;
+ }
+ av.visit(name, sv);
+ --v;
break;
- case 'e': // enum_const_value
- av.visitEnum(name, readUTF8(v, buf), readUTF8(v + 2, buf));
- v += 4;
+ case 'C':
+ char[] cv = new char[size];
+ for (i = 0; i < size; i++) {
+ cv[i] = (char) readInt(items[readUnsignedShort(v)]);
+ v += 3;
+ }
+ av.visit(name, cv);
+ --v;
break;
- case 'c': // class_info
- av.visit(name, Type.getType(readUTF8(v, buf)));
- v += 2;
+ case 'I':
+ int[] iv = new int[size];
+ for (i = 0; i < size; i++) {
+ iv[i] = readInt(items[readUnsignedShort(v)]);
+ v += 3;
+ }
+ av.visit(name, iv);
+ --v;
break;
- case '@': // annotation_value
- v = readAnnotationValues(v + 2,
- buf,
- true,
- av.visitAnnotation(name, readUTF8(v, buf)));
+ case 'J':
+ long[] lv = new long[size];
+ for (i = 0; i < size; i++) {
+ lv[i] = readLong(items[readUnsignedShort(v)]);
+ v += 3;
+ }
+ av.visit(name, lv);
+ --v;
break;
- case '[': // array_value
- int size = readUnsignedShort(v);
- v += 2;
- if (size == 0) {
- return readAnnotationValues(v - 2,
- buf,
- false,
- av.visitArray(name));
+ case 'F':
+ float[] fv = new float[size];
+ for (i = 0; i < size; i++) {
+ fv[i] = Float
+ .intBitsToFloat(readInt(items[readUnsignedShort(v)]));
+ v += 3;
}
- switch (this.b[v++] & 0xFF) {
- case 'B':
- byte[] bv = new byte[size];
- for (i = 0; i < size; i++) {
- bv[i] = (byte) readInt(items[readUnsignedShort(v)]);
- v += 3;
- }
- av.visit(name, bv);
- --v;
- break;
- case 'Z':
- boolean[] zv = new boolean[size];
- for (i = 0; i < size; i++) {
- zv[i] = readInt(items[readUnsignedShort(v)]) != 0;
- v += 3;
- }
- av.visit(name, zv);
- --v;
- break;
- case 'S':
- short[] sv = new short[size];
- for (i = 0; i < size; i++) {
- sv[i] = (short) readInt(items[readUnsignedShort(v)]);
- v += 3;
- }
- av.visit(name, sv);
- --v;
- break;
- case 'C':
- char[] cv = new char[size];
- for (i = 0; i < size; i++) {
- cv[i] = (char) readInt(items[readUnsignedShort(v)]);
- v += 3;
- }
- av.visit(name, cv);
- --v;
- break;
- case 'I':
- int[] iv = new int[size];
- for (i = 0; i < size; i++) {
- iv[i] = readInt(items[readUnsignedShort(v)]);
- v += 3;
- }
- av.visit(name, iv);
- --v;
- break;
- case 'J':
- long[] lv = new long[size];
- for (i = 0; i < size; i++) {
- lv[i] = readLong(items[readUnsignedShort(v)]);
- v += 3;
- }
- av.visit(name, lv);
- --v;
- break;
- case 'F':
- float[] fv = new float[size];
- for (i = 0; i < size; i++) {
- fv[i] = Float.intBitsToFloat(readInt(items[readUnsignedShort(v)]));
- v += 3;
- }
- av.visit(name, fv);
- --v;
- break;
- case 'D':
- double[] dv = new double[size];
- for (i = 0; i < size; i++) {
- dv[i] = Double.longBitsToDouble(readLong(items[readUnsignedShort(v)]));
- v += 3;
- }
- av.visit(name, dv);
- --v;
- break;
- default:
- v = readAnnotationValues(v - 3,
- buf,
- false,
- av.visitArray(name));
+ av.visit(name, fv);
+ --v;
+ break;
+ case 'D':
+ double[] dv = new double[size];
+ for (i = 0; i < size; i++) {
+ dv[i] = Double
+ .longBitsToDouble(readLong(items[readUnsignedShort(v)]));
+ v += 3;
}
+ av.visit(name, dv);
+ --v;
+ break;
+ default:
+ v = readAnnotationValues(v - 3, buf, false, av.visitArray(name));
+ }
}
return v;
}
- private int readFrameType(
- final Object[] frame,
- final int index,
- int v,
- final char[] buf,
- final Label[] labels)
- {
- int type = b[v++] & 0xFF;
- switch (type) {
- case 0:
- frame[index] = Opcodes.TOP;
- break;
- case 1:
- frame[index] = Opcodes.INTEGER;
- break;
- case 2:
- frame[index] = Opcodes.FLOAT;
+ /**
+ * Computes the implicit frame of the method currently being parsed (as
+ * defined in the given {@link Context}) and stores it in the given context.
+ *
+ * @param frame
+ * information about the class being parsed.
+ */
+ private void getImplicitFrame(final Context frame) {
+ String desc = frame.desc;
+ Object[] locals = frame.local;
+ int local = 0;
+ if ((frame.access & Opcodes.ACC_STATIC) == 0) {
+ if ("<init>".equals(frame.name)) {
+ locals[local++] = Opcodes.UNINITIALIZED_THIS;
+ } else {
+ locals[local++] = readClass(header + 2, frame.buffer);
+ }
+ }
+ int i = 1;
+ loop: while (true) {
+ int j = i;
+ switch (desc.charAt(i++)) {
+ case 'Z':
+ case 'C':
+ case 'B':
+ case 'S':
+ case 'I':
+ locals[local++] = Opcodes.INTEGER;
break;
- case 3:
- frame[index] = Opcodes.DOUBLE;
+ case 'F':
+ locals[local++] = Opcodes.FLOAT;
break;
- case 4:
- frame[index] = Opcodes.LONG;
+ case 'J':
+ locals[local++] = Opcodes.LONG;
break;
- case 5:
- frame[index] = Opcodes.NULL;
+ case 'D':
+ locals[local++] = Opcodes.DOUBLE;
break;
- case 6:
- frame[index] = Opcodes.UNINITIALIZED_THIS;
+ case '[':
+ while (desc.charAt(i) == '[') {
+ ++i;
+ }
+ if (desc.charAt(i) == 'L') {
+ ++i;
+ while (desc.charAt(i) != ';') {
+ ++i;
+ }
+ }
+ locals[local++] = desc.substring(j, ++i);
break;
- case 7: // Object
- frame[index] = readClass(v, buf);
- v += 2;
+ case 'L':
+ while (desc.charAt(i) != ';') {
+ ++i;
+ }
+ locals[local++] = desc.substring(j + 1, i++);
break;
- default: // Uninitialized
- frame[index] = readLabel(readUnsignedShort(v), labels);
- v += 2;
+ default:
+ break loop;
+ }
+ }
+ frame.localCount = local;
+ }
+
+ /**
+ * Reads a stack map frame and stores the result in the given
+ * {@link Context} object.
+ *
+ * @param stackMap
+ * the start offset of a stack map frame in the class file.
+ * @param zip
+ * if the stack map frame at stackMap is compressed or not.
+ * @param unzip
+ * if the stack map frame must be uncompressed.
+ * @param frame
+ * where the parsed stack map frame must be stored.
+ * @return the offset of the first byte following the parsed frame.
+ */
+ private int readFrame(int stackMap, boolean zip, boolean unzip,
+ Context frame) {
+ char[] c = frame.buffer;
+ Label[] labels = frame.labels;
+ int tag;
+ int delta;
+ if (zip) {
+ tag = b[stackMap++] & 0xFF;
+ } else {
+ tag = MethodWriter.FULL_FRAME;
+ frame.offset = -1;
+ }
+ frame.localDiff = 0;
+ if (tag < MethodWriter.SAME_LOCALS_1_STACK_ITEM_FRAME) {
+ delta = tag;
+ frame.mode = Opcodes.F_SAME;
+ frame.stackCount = 0;
+ } else if (tag < MethodWriter.RESERVED) {
+ delta = tag - MethodWriter.SAME_LOCALS_1_STACK_ITEM_FRAME;
+ stackMap = readFrameType(frame.stack, 0, stackMap, c, labels);
+ frame.mode = Opcodes.F_SAME1;
+ frame.stackCount = 1;
+ } else {
+ delta = readUnsignedShort(stackMap);
+ stackMap += 2;
+ if (tag == MethodWriter.SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED) {
+ stackMap = readFrameType(frame.stack, 0, stackMap, c, labels);
+ frame.mode = Opcodes.F_SAME1;
+ frame.stackCount = 1;
+ } else if (tag >= MethodWriter.CHOP_FRAME
+ && tag < MethodWriter.SAME_FRAME_EXTENDED) {
+ frame.mode = Opcodes.F_CHOP;
+ frame.localDiff = MethodWriter.SAME_FRAME_EXTENDED - tag;
+ frame.localCount -= frame.localDiff;
+ frame.stackCount = 0;
+ } else if (tag == MethodWriter.SAME_FRAME_EXTENDED) {
+ frame.mode = Opcodes.F_SAME;
+ frame.stackCount = 0;
+ } else if (tag < MethodWriter.FULL_FRAME) {
+ int local = unzip ? frame.localCount : 0;
+ for (int i = tag - MethodWriter.SAME_FRAME_EXTENDED; i > 0; i--) {
+ stackMap = readFrameType(frame.local, local++, stackMap, c,
+ labels);
+ }
+ frame.mode = Opcodes.F_APPEND;
+ frame.localDiff = tag - MethodWriter.SAME_FRAME_EXTENDED;
+ frame.localCount += frame.localDiff;
+ frame.stackCount = 0;
+ } else { // if (tag == FULL_FRAME) {
+ frame.mode = Opcodes.F_FULL;
+ int n = readUnsignedShort(stackMap);
+ stackMap += 2;
+ frame.localDiff = n;
+ frame.localCount = n;
+ for (int local = 0; n > 0; n--) {
+ stackMap = readFrameType(frame.local, local++, stackMap, c,
+ labels);
+ }
+ n = readUnsignedShort(stackMap);
+ stackMap += 2;
+ frame.stackCount = n;
+ for (int stack = 0; n > 0; n--) {
+ stackMap = readFrameType(frame.stack, stack++, stackMap, c,
+ labels);
+ }
+ }
+ }
+ frame.offset += delta + 1;
+ readLabel(frame.offset, labels);
+ return stackMap;
+ }
+
+ /**
+ * Reads a stack map frame type and stores it at the given index in the
+ * given array.
+ *
+ * @param frame
+ * the array where the parsed type must be stored.
+ * @param index
+ * the index in 'frame' where the parsed type must be stored.
+ * @param v
+ * the start offset of the stack map frame type to read.
+ * @param buf
+ * a buffer to read strings.
+ * @param labels
+ * the labels of the method currently being parsed, indexed by
+ * their offset. If the parsed type is an Uninitialized type, a
+ * new label for the corresponding NEW instruction is stored in
+ * this array if it does not already exist.
+ * @return the offset of the first byte after the parsed type.
+ */
+ private int readFrameType(final Object[] frame, final int index, int v,
+ final char[] buf, final Label[] labels) {
+ int type = b[v++] & 0xFF;
+ switch (type) {
+ case 0:
+ frame[index] = Opcodes.TOP;
+ break;
+ case 1:
+ frame[index] = Opcodes.INTEGER;
+ break;
+ case 2:
+ frame[index] = Opcodes.FLOAT;
+ break;
+ case 3:
+ frame[index] = Opcodes.DOUBLE;
+ break;
+ case 4:
+ frame[index] = Opcodes.LONG;
+ break;
+ case 5:
+ frame[index] = Opcodes.NULL;
+ break;
+ case 6:
+ frame[index] = Opcodes.UNINITIALIZED_THIS;
+ break;
+ case 7: // Object
+ frame[index] = readClass(v, buf);
+ v += 2;
+ break;
+ default: // Uninitialized
+ frame[index] = readLabel(readUnsignedShort(v), labels);
+ v += 2;
}
return v;
}
@@ -1792,10 +2162,12 @@ public class ClassReader {
* implementation of this method creates a label for the given offset if it
* has not been already created.
*
- * @param offset a bytecode offset in a method.
- * @param labels the already created labels, indexed by their offset. If a
- * label already exists for offset this method must not create a new
- * one. Otherwise it must store the new label in this array.
+ * @param offset
+ * a bytecode offset in a method.
+ * @param labels
+ * the already created labels, indexed by their offset. If a
+ * label already exists for offset this method must not create a
+ * new one. Otherwise it must store the new label in this array.
* @return a non null Label, which must be equal to labels[offset].
*/
protected Label readLabel(int offset, Label[] labels) {
@@ -1806,39 +2178,67 @@ public class ClassReader {
}
/**
+ * Returns the start index of the attribute_info structure of this class.
+ *
+ * @return the start index of the attribute_info structure of this class.
+ */
+ private int getAttributes() {
+ // skips the header
+ int u = header + 8 + readUnsignedShort(header + 6) * 2;
+ // skips fields and methods
+ for (int i = readUnsignedShort(u); i > 0; --i) {
+ for (int j = readUnsignedShort(u + 8); j > 0; --j) {
+ u += 6 + readInt(u + 12);
+ }
+ u += 8;
+ }
+ u += 2;
+ for (int i = readUnsignedShort(u); i > 0; --i) {
+ for (int j = readUnsignedShort(u + 8); j > 0; --j) {
+ u += 6 + readInt(u + 12);
+ }
+ u += 8;
+ }
+ // the attribute_info structure starts just after the methods
+ return u + 2;
+ }
+
+ /**
* Reads an attribute in {@link #b b}.
*
- * @param attrs prototypes of the attributes that must be parsed during the
- * visit of the class. Any attribute whose type is not equal to the
- * type of one the prototypes is ignored (i.e. an empty
- * {@link Attribute} instance is returned).
- * @param type the type of the attribute.
- * @param off index of the first byte of the attribute's content in
- * {@link #b b}. The 6 attribute header bytes, containing the type
- * and the length of the attribute, are not taken into account here
- * (they have already been read).
- * @param len the length of the attribute's content.
- * @param buf buffer to be used to call {@link #readUTF8 readUTF8},
- * {@link #readClass(int,char[]) readClass} or
- * {@link #readConst readConst}.
- * @param codeOff index of the first byte of code's attribute content in
- * {@link #b b}, or -1 if the attribute to be read is not a code
- * attribute. The 6 attribute header bytes, containing the type and
- * the length of the attribute, are not taken into account here.
- * @param labels the labels of the method's code, or <tt>null</tt> if the
- * attribute to be read is not a code attribute.
+ * @param attrs
+ * prototypes of the attributes that must be parsed during the
+ * visit of the class. Any attribute whose type is not equal to
+ * the type of one the prototypes is ignored (i.e. an empty
+ * {@link Attribute} instance is returned).
+ * @param type
+ * the type of the attribute.
+ * @param off
+ * index of the first byte of the attribute's content in
+ * {@link #b b}. The 6 attribute header bytes, containing the
+ * type and the length of the attribute, are not taken into
+ * account here (they have already been read).
+ * @param len
+ * the length of the attribute's content.
+ * @param buf
+ * buffer to be used to call {@link #readUTF8 readUTF8},
+ * {@link #readClass(int,char[]) readClass} or {@link #readConst
+ * readConst}.
+ * @param codeOff
+ * index of the first byte of code's attribute content in
+ * {@link #b b}, or -1 if the attribute to be read is not a code
+ * attribute. The 6 attribute header bytes, containing the type
+ * and the length of the attribute, are not taken into account
+ * here.
+ * @param labels
+ * the labels of the method's code, or <tt>null</tt> if the
+ * attribute to be read is not a code attribute.
* @return the attribute that has been read, or <tt>null</tt> to skip this
* attribute.
*/
- private Attribute readAttribute(
- final Attribute[] attrs,
- final String type,
- final int off,
- final int len,
- final char[] buf,
- final int codeOff,
- final Label[] labels)
- {
+ private Attribute readAttribute(final Attribute[] attrs, final String type,
+ final int off, final int len, final char[] buf, final int codeOff,
+ final Label[] labels) {
for (int i = 0; i < attrs.length; ++i) {
if (attrs[i].type.equals(type)) {
return attrs[i].read(this, off, len, buf, codeOff, labels);
@@ -1852,11 +2252,21 @@ public class ClassReader {
// ------------------------------------------------------------------------
/**
+ * Returns the number of constant pool items in {@link #b b}.
+ *
+ * @return the number of constant pool items in {@link #b b}.
+ */
+ public int getItemCount() {
+ return items.length;
+ }
+
+ /**
* Returns the start index of the constant pool item in {@link #b b}, plus
* one. <i>This method is intended for {@link Attribute} sub classes, and is
* normally not needed by class generators or adapters.</i>
*
- * @param item the index a constant pool item.
+ * @param item
+ * the index a constant pool item.
* @return the start index of the constant pool item in {@link #b b}, plus
* one.
*/
@@ -1865,11 +2275,23 @@ public class ClassReader {
}
/**
+ * Returns the maximum length of the strings contained in the constant pool
+ * of the class.
+ *
+ * @return the maximum length of the strings contained in the constant pool
+ * of the class.
+ */
+ public int getMaxStringLength() {
+ return maxStringLength;
+ }
+
+ /**
* Reads a byte value in {@link #b b}. <i>This method is intended for
* {@link Attribute} sub classes, and is normally not needed by class
* generators or adapters.</i>
*
- * @param index the start index of the value to be read in {@link #b b}.
+ * @param index
+ * the start index of the value to be read in {@link #b b}.
* @return the read value.
*/
public int readByte(final int index) {
@@ -1877,11 +2299,12 @@ public class ClassReader {
}
/**
- * Reads an unsigned short value in {@link #b b}. <i>This method is
- * intended for {@link Attribute} sub classes, and is normally not needed by
- * class generators or adapters.</i>
+ * Reads an unsigned short value in {@link #b b}. <i>This method is intended
+ * for {@link Attribute} sub classes, and is normally not needed by class
+ * generators or adapters.</i>
*
- * @param index the start index of the value to be read in {@link #b b}.
+ * @param index
+ * the start index of the value to be read in {@link #b b}.
* @return the read value.
*/
public int readUnsignedShort(final int index) {
@@ -1894,7 +2317,8 @@ public class ClassReader {
* for {@link Attribute} sub classes, and is normally not needed by class
* generators or adapters.</i>
*
- * @param index the start index of the value to be read in {@link #b b}.
+ * @param index
+ * the start index of the value to be read in {@link #b b}.
* @return the read value.
*/
public short readShort(final int index) {
@@ -1907,7 +2331,8 @@ public class ClassReader {
* {@link Attribute} sub classes, and is normally not needed by class
* generators or adapters.</i>
*
- * @param index the start index of the value to be read in {@link #b b}.
+ * @param index
+ * the start index of the value to be read in {@link #b b}.
* @return the read value.
*/
public int readInt(final int index) {
@@ -1917,11 +2342,12 @@ public class ClassReader {
}
/**
- * Reads a signed long value in {@link #b b}. <i>This method is intended
- * for {@link Attribute} sub classes, and is normally not needed by class
+ * Reads a signed long value in {@link #b b}. <i>This method is intended for
+ * {@link Attribute} sub classes, and is normally not needed by class
* generators or adapters.</i>
*
- * @param index the start index of the value to be read in {@link #b b}.
+ * @param index
+ * the start index of the value to be read in {@link #b b}.
* @return the read value.
*/
public long readLong(final int index) {
@@ -1935,14 +2361,19 @@ public class ClassReader {
* is intended for {@link Attribute} sub classes, and is normally not needed
* by class generators or adapters.</i>
*
- * @param index the start index of an unsigned short value in {@link #b b},
- * whose value is the index of an UTF8 constant pool item.
- * @param buf buffer to be used to read the item. This buffer must be
- * sufficiently large. It is not automatically resized.
+ * @param index
+ * the start index of an unsigned short value in {@link #b b},
+ * whose value is the index of an UTF8 constant pool item.
+ * @param buf
+ * buffer to be used to read the item. This buffer must be
+ * sufficiently large. It is not automatically resized.
* @return the String corresponding to the specified UTF8 item.
*/
public String readUTF8(int index, final char[] buf) {
int item = readUnsignedShort(index);
+ if (index == 0 || item == 0) {
+ return null;
+ }
String s = strings[item];
if (s != null) {
return s;
@@ -1954,10 +2385,13 @@ public class ClassReader {
/**
* Reads UTF8 string in {@link #b b}.
*
- * @param index start offset of the UTF8 string to be read.
- * @param utfLen length of the UTF8 string to be read.
- * @param buf buffer to be used to read the string. This buffer must be
- * sufficiently large. It is not automatically resized.
+ * @param index
+ * start offset of the UTF8 string to be read.
+ * @param utfLen
+ * length of the UTF8 string to be read.
+ * @param buf
+ * buffer to be used to read the string. This buffer must be
+ * sufficiently large. It is not automatically resized.
* @return the String corresponding to the specified UTF8 string.
*/
private String readUTF(int index, final int utfLen, final char[] buf) {
@@ -1970,42 +2404,44 @@ public class ClassReader {
while (index < endIndex) {
c = b[index++];
switch (st) {
- case 0:
- c = c & 0xFF;
- if (c < 0x80) { // 0xxxxxxx
- buf[strLen++] = (char) c;
- } else if (c < 0xE0 && c > 0xBF) { // 110x xxxx 10xx xxxx
- cc = (char) (c & 0x1F);
- st = 1;
- } else { // 1110 xxxx 10xx xxxx 10xx xxxx
- cc = (char) (c & 0x0F);
- st = 2;
- }
- break;
-
- case 1: // byte 2 of 2-byte char or byte 3 of 3-byte char
- buf[strLen++] = (char) ((cc << 6) | (c & 0x3F));
- st = 0;
- break;
-
- case 2: // byte 2 of 3-byte char
- cc = (char) ((cc << 6) | (c & 0x3F));
+ case 0:
+ c = c & 0xFF;
+ if (c < 0x80) { // 0xxxxxxx
+ buf[strLen++] = (char) c;
+ } else if (c < 0xE0 && c > 0xBF) { // 110x xxxx 10xx xxxx
+ cc = (char) (c & 0x1F);
st = 1;
- break;
+ } else { // 1110 xxxx 10xx xxxx 10xx xxxx
+ cc = (char) (c & 0x0F);
+ st = 2;
+ }
+ break;
+
+ case 1: // byte 2 of 2-byte char or byte 3 of 3-byte char
+ buf[strLen++] = (char) ((cc << 6) | (c & 0x3F));
+ st = 0;
+ break;
+
+ case 2: // byte 2 of 3-byte char
+ cc = (char) ((cc << 6) | (c & 0x3F));
+ st = 1;
+ break;
}
}
return new String(buf, 0, strLen);
}
-
+
/**
* Reads a class constant pool item in {@link #b b}. <i>This method is
* intended for {@link Attribute} sub classes, and is normally not needed by
* class generators or adapters.</i>
*
- * @param index the start index of an unsigned short value in {@link #b b},
- * whose value is the index of a class constant pool item.
- * @param buf buffer to be used to read the item. This buffer must be
- * sufficiently large. It is not automatically resized.
+ * @param index
+ * the start index of an unsigned short value in {@link #b b},
+ * whose value is the index of a class constant pool item.
+ * @param buf
+ * buffer to be used to read the item. This buffer must be
+ * sufficiently large. It is not automatically resized.
* @return the String corresponding to the specified class item.
*/
public String readClass(final int index, final char[] buf) {
@@ -2020,29 +2456,41 @@ public class ClassReader {
* method is intended for {@link Attribute} sub classes, and is normally not
* needed by class generators or adapters.</i>
*
- * @param item the index of a constant pool item.
- * @param buf buffer to be used to read the item. This buffer must be
- * sufficiently large. It is not automatically resized.
- * @return the {@link Integer}, {@link Float}, {@link Long},
- * {@link Double}, {@link String} or {@link Type} corresponding to
+ * @param item
+ * the index of a constant pool item.
+ * @param buf
+ * buffer to be used to read the item. This buffer must be
+ * sufficiently large. It is not automatically resized.
+ * @return the {@link Integer}, {@link Float}, {@link Long}, {@link Double},
+ * {@link String}, {@link Type} or {@link Handle} corresponding to
* the given constant pool item.
*/
public Object readConst(final int item, final char[] buf) {
int index = items[item];
switch (b[index - 1]) {
- case ClassWriter.INT:
- return new Integer(readInt(index));
- case ClassWriter.FLOAT:
- return new Float(Float.intBitsToFloat(readInt(index)));
- case ClassWriter.LONG:
- return new Long(readLong(index));
- case ClassWriter.DOUBLE:
- return new Double(Double.longBitsToDouble(readLong(index)));
- case ClassWriter.CLASS:
- return Type.getObjectType(readUTF8(index, buf));
- // case ClassWriter.STR:
- default:
- return readUTF8(index, buf);
+ case ClassWriter.INT:
+ return new Integer(readInt(index));
+ case ClassWriter.FLOAT:
+ return new Float(Float.intBitsToFloat(readInt(index)));
+ case ClassWriter.LONG:
+ return new Long(readLong(index));
+ case ClassWriter.DOUBLE:
+ return new Double(Double.longBitsToDouble(readLong(index)));
+ case ClassWriter.CLASS:
+ return Type.getObjectType(readUTF8(index, buf));
+ case ClassWriter.STR:
+ return readUTF8(index, buf);
+ case ClassWriter.MTYPE:
+ return Type.getMethodType(readUTF8(index, buf));
+ default: // case ClassWriter.HANDLE_BASE + [1..9]:
+ int tag = readByte(index);
+ int[] items = this.items;
+ int cpIndex = items[readUnsignedShort(index + 1)];
+ String owner = readClass(cpIndex, buf);
+ cpIndex = items[readUnsignedShort(cpIndex + 2)];
+ String name = readUTF8(cpIndex, buf);
+ String desc = readUTF8(cpIndex + 2, buf);
+ return new Handle(tag, owner, name, desc);
}
}
}
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/ClassVisitor.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/ClassVisitor.java
index 7f1f297..7259c55 100644
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/ClassVisitor.java
+++ b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/ClassVisitor.java
@@ -1,6 +1,6 @@
/***
* ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2007 INRIA, France Telecom
+ * Copyright (c) 2000-2011 INRIA, France Telecom
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,168 +29,293 @@
*/
package org.eclipse.persistence.internal.libraries.asm;
+
/**
- * A visitor to visit a Java class. The methods of this interface must be called
- * in the following order: <tt>visit</tt> [ <tt>visitSource</tt> ] [
+ * A visitor to visit a Java class. The methods of this class must be called in
+ * the following order: <tt>visit</tt> [ <tt>visitSource</tt> ] [
* <tt>visitOuterClass</tt> ] ( <tt>visitAnnotation</tt> |
- * <tt>visitAttribute</tt> )* (<tt>visitInnerClass</tt> |
- * <tt>visitField</tt> | <tt>visitMethod</tt> )* <tt>visitEnd</tt>.
+ * <tt>visitTypeAnnotation</tt> | <tt>visitAttribute</tt> )* (
+ * <tt>visitInnerClass</tt> | <tt>visitField</tt> | <tt>visitMethod</tt> )*
+ * <tt>visitEnd</tt>.
*
* @author Eric Bruneton
*/
-public interface ClassVisitor {
+public abstract class ClassVisitor {
+
+ /**
+ * The ASM API version implemented by this visitor. The value of this field
+ * must be one of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}.
+ */
+ protected final int api;
+
+ /**
+ * The class visitor to which this visitor must delegate method calls. May
+ * be null.
+ */
+ protected ClassVisitor cv;
+
+ /**
+ * Constructs a new {@link ClassVisitor}.
+ *
+ * @param api
+ * the ASM API version implemented by this visitor. Must be one
+ * of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}.
+ */
+ public ClassVisitor(final int api) {
+ this(api, null);
+ }
+
+ /**
+ * Constructs a new {@link ClassVisitor}.
+ *
+ * @param api
+ * the ASM API version implemented by this visitor. Must be one
+ * of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}.
+ * @param cv
+ * the class visitor to which this visitor must delegate method
+ * calls. May be null.
+ */
+ public ClassVisitor(final int api, final ClassVisitor cv) {
+ if (api != Opcodes.ASM4 && api != Opcodes.ASM5) {
+ throw new IllegalArgumentException();
+ }
+ this.api = api;
+ this.cv = cv;
+ }
/**
* Visits the header of the class.
*
- * @param version the class version.
- * @param access the class's access flags (see {@link Opcodes}). This
- * parameter also indicates if the class is deprecated.
- * @param name the internal name of the class (see
- * {@link Type#getInternalName() getInternalName}).
- * @param signature the signature of this class. May be <tt>null</tt> if
- * the class is not a generic one, and does not extend or implement
- * generic classes or interfaces.
- * @param superName the internal of name of the super class (see
- * {@link Type#getInternalName() getInternalName}). For interfaces,
- * the super class is {@link Object}. May be <tt>null</tt>, but
- * only for the {@link Object} class.
- * @param interfaces the internal names of the class's interfaces (see
- * {@link Type#getInternalName() getInternalName}). May be
- * <tt>null</tt>.
+ * @param version
+ * the class version.
+ * @param access
+ * the class's access flags (see {@link Opcodes}). This parameter
+ * also indicates if the class is deprecated.
+ * @param name
+ * the internal name of the class (see
+ * {@link Type#getInternalName() getInternalName}).
+ * @param signature
+ * the signature of this class. May be <tt>null</tt> if the class
+ * is not a generic one, and does not extend or implement generic
+ * classes or interfaces.
+ * @param superName
+ * the internal of name of the super class (see
+ * {@link Type#getInternalName() getInternalName}). For
+ * interfaces, the super class is {@link Object}. May be
+ * <tt>null</tt>, but only for the {@link Object} class.
+ * @param interfaces
+ * the internal names of the class's interfaces (see
+ * {@link Type#getInternalName() getInternalName}). May be
+ * <tt>null</tt>.
*/
- void visit(
- int version,
- int access,
- String name,
- String signature,
- String superName,
- String[] interfaces);
+ public void visit(int version, int access, String name, String signature,
+ String superName, String[] interfaces) {
+ if (cv != null) {
+ cv.visit(version, access, name, signature, superName, interfaces);
+ }
+ }
/**
* Visits the source of the class.
*
- * @param source the name of the source file from which the class was
- * compiled. May be <tt>null</tt>.
- * @param debug additional debug information to compute the correspondance
- * between source and compiled elements of the class. May be
- * <tt>null</tt>.
+ * @param source
+ * the name of the source file from which the class was compiled.
+ * May be <tt>null</tt>.
+ * @param debug
+ * additional debug information to compute the correspondance
+ * between source and compiled elements of the class. May be
+ * <tt>null</tt>.
*/
- void visitSource(String source, String debug);
+ public void visitSource(String source, String debug) {
+ if (cv != null) {
+ cv.visitSource(source, debug);
+ }
+ }
/**
* Visits the enclosing class of the class. This method must be called only
* if the class has an enclosing class.
*
- * @param owner internal name of the enclosing class of the class.
- * @param name the name of the method that contains the class, or
- * <tt>null</tt> if the class is not enclosed in a method of its
- * enclosing class.
- * @param desc the descriptor of the method that contains the class, or
- * <tt>null</tt> if the class is not enclosed in a method of its
- * enclosing class.
+ * @param owner
+ * internal name of the enclosing class of the class.
+ * @param name
+ * the name of the method that contains the class, or
+ * <tt>null</tt> if the class is not enclosed in a method of its
+ * enclosing class.
+ * @param desc
+ * the descriptor of the method that contains the class, or
+ * <tt>null</tt> if the class is not enclosed in a method of its
+ * enclosing class.
*/
- void visitOuterClass(String owner, String name, String desc);
+ public void visitOuterClass(String owner, String name, String desc) {
+ if (cv != null) {
+ cv.visitOuterClass(owner, name, desc);
+ }
+ }
/**
* Visits an annotation of the class.
*
- * @param desc the class descriptor of the annotation class.
- * @param visible <tt>true</tt> if the annotation is visible at runtime.
+ * @param desc
+ * the class descriptor of the annotation class.
+ * @param visible
+ * <tt>true</tt> if the annotation is visible at runtime.
+ * @return a visitor to visit the annotation values, or <tt>null</tt> if
+ * this visitor is not interested in visiting this annotation.
+ */
+ public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
+ if (cv != null) {
+ return cv.visitAnnotation(desc, visible);
+ }
+ return null;
+ }
+
+ /**
+ * Visits an annotation on a type in the class signature.
+ *
+ * @param typeRef
+ * a reference to the annotated type. The sort of this type
+ * reference must be {@link TypeReference#CLASS_TYPE_PARAMETER
+ * CLASS_TYPE_PARAMETER},
+ * {@link TypeReference#CLASS_TYPE_PARAMETER_BOUND
+ * CLASS_TYPE_PARAMETER_BOUND} or
+ * {@link TypeReference#CLASS_EXTENDS CLASS_EXTENDS}. See
+ * {@link TypeReference}.
+ * @param typePath
+ * the path to the annotated type argument, wildcard bound, array
+ * element type, or static inner type within 'typeRef'. May be
+ * <tt>null</tt> if the annotation targets 'typeRef' as a whole.
+ * @param desc
+ * the class descriptor of the annotation class.
+ * @param visible
+ * <tt>true</tt> if the annotation is visible at runtime.
* @return a visitor to visit the annotation values, or <tt>null</tt> if
* this visitor is not interested in visiting this annotation.
*/
- AnnotationVisitor visitAnnotation(String desc, boolean visible);
+ public AnnotationVisitor visitTypeAnnotation(int typeRef,
+ TypePath typePath, String desc, boolean visible) {
+ if (api < Opcodes.ASM5) {
+ throw new RuntimeException();
+ }
+ if (cv != null) {
+ return cv.visitTypeAnnotation(typeRef, typePath, desc, visible);
+ }
+ return null;
+ }
/**
* Visits a non standard attribute of the class.
*
- * @param attr an attribute.
+ * @param attr
+ * an attribute.
*/
- void visitAttribute(Attribute attr);
+ public void visitAttribute(Attribute attr) {
+ if (cv != null) {
+ cv.visitAttribute(attr);
+ }
+ }
/**
* Visits information about an inner class. This inner class is not
* necessarily a member of the class being visited.
*
- * @param name the internal name of an inner class (see
- * {@link Type#getInternalName() getInternalName}).
- * @param outerName the internal name of the class to which the inner class
- * belongs (see {@link Type#getInternalName() getInternalName}). May
- * be <tt>null</tt> for not member classes.
- * @param innerName the (simple) name of the inner class inside its
- * enclosing class. May be <tt>null</tt> for anonymous inner
- * classes.
- * @param access the access flags of the inner class as originally declared
- * in the enclosing class.
+ * @param name
+ * the internal name of an inner class (see
+ * {@link Type#getInternalName() getInternalName}).
+ * @param outerName
+ * the internal name of the class to which the inner class
+ * belongs (see {@link Type#getInternalName() getInternalName}).
+ * May be <tt>null</tt> for not member classes.
+ * @param innerName
+ * the (simple) name of the inner class inside its enclosing
+ * class. May be <tt>null</tt> for anonymous inner classes.
+ * @param access
+ * the access flags of the inner class as originally declared in
+ * the enclosing class.
*/
- void visitInnerClass(
- String name,
- String outerName,
- String innerName,
- int access);
+ public void visitInnerClass(String name, String outerName,
+ String innerName, int access) {
+ if (cv != null) {
+ cv.visitInnerClass(name, outerName, innerName, access);
+ }
+ }
/**
* Visits a field of the class.
*
- * @param access the field's access flags (see {@link Opcodes}). This
- * parameter also indicates if the field is synthetic and/or
- * deprecated.
- * @param name the field's name.
- * @param desc the field's descriptor (see {@link Type Type}).
- * @param signature the field's signature. May be <tt>null</tt> if the
- * field's type does not use generic types.
- * @param value the field's initial value. This parameter, which may be
- * <tt>null</tt> if the field does not have an initial value, must
- * be an {@link Integer}, a {@link Float}, a {@link Long}, a
- * {@link Double} or a {@link String} (for <tt>int</tt>,
- * <tt>float</tt>, <tt>long</tt> or <tt>String</tt> fields
- * respectively). <i>This parameter is only used for static fields</i>.
- * Its value is ignored for non static fields, which must be
- * initialized through bytecode instructions in constructors or
- * methods.
+ * @param access
+ * the field's access flags (see {@link Opcodes}). This parameter
+ * also indicates if the field is synthetic and/or deprecated.
+ * @param name
+ * the field's name.
+ * @param desc
+ * the field's descriptor (see {@link Type Type}).
+ * @param signature
+ * the field's signature. May be <tt>null</tt> if the field's
+ * type does not use generic types.
+ * @param value
+ * the field's initial value. This parameter, which may be
+ * <tt>null</tt> if the field does not have an initial value,
+ * must be an {@link Integer}, a {@link Float}, a {@link Long}, a
+ * {@link Double} or a {@link String} (for <tt>int</tt>,
+ * <tt>float</tt>, <tt>long</tt> or <tt>String</tt> fields
+ * respectively). <i>This parameter is only used for static
+ * fields</i>. Its value is ignored for non static fields, which
+ * must be initialized through bytecode instructions in
+ * constructors or methods.
* @return a visitor to visit field annotations and attributes, or
- * <tt>null</tt> if this class visitor is not interested in
- * visiting these annotations and attributes.
+ * <tt>null</tt> if this class visitor is not interested in visiting
+ * these annotations and attributes.
*/
- FieldVisitor visitField(
- int access,
- String name,
- String desc,
- String signature,
- Object value);
+ public FieldVisitor visitField(int access, String name, String desc,
+ String signature, Object value) {
+ if (cv != null) {
+ return cv.visitField(access, name, desc, signature, value);
+ }
+ return null;
+ }
/**
* Visits a method of the class. This method <i>must</i> return a new
- * {@link MethodVisitor} instance (or <tt>null</tt>) each time it is
- * called, i.e., it should not return a previously returned visitor.
+ * {@link MethodVisitor} instance (or <tt>null</tt>) each time it is called,
+ * i.e., it should not return a previously returned visitor.
*
- * @param access the method's access flags (see {@link Opcodes}). This
- * parameter also indicates if the method is synthetic and/or
- * deprecated.
- * @param name the method's name.
- * @param desc the method's descriptor (see {@link Type Type}).
- * @param signature the method's signature. May be <tt>null</tt> if the
- * method parameters, return type and exceptions do not use generic
- * types.
- * @param exceptions the internal names of the method's exception classes
- * (see {@link Type#getInternalName() getInternalName}). May be
- * <tt>null</tt>.
+ * @param access
+ * the method's access flags (see {@link Opcodes}). This
+ * parameter also indicates if the method is synthetic and/or
+ * deprecated.
+ * @param name
+ * the method's name.
+ * @param desc
+ * the method's descriptor (see {@link Type Type}).
+ * @param signature
+ * the method's signature. May be <tt>null</tt> if the method
+ * parameters, return type and exceptions do not use generic
+ * types.
+ * @param exceptions
+ * the internal names of the method's exception classes (see
+ * {@link Type#getInternalName() getInternalName}). May be
+ * <tt>null</tt>.
* @return an object to visit the byte code of the method, or <tt>null</tt>
* if this class visitor is not interested in visiting the code of
* this method.
*/
- MethodVisitor visitMethod(
- int access,
- String name,
- String desc,
- String signature,
- String[] exceptions);
+ public MethodVisitor visitMethod(int access, String name, String desc,
+ String signature, String[] exceptions) {
+ if (cv != null) {
+ return cv.visitMethod(access, name, desc, signature, exceptions);
+ }
+ return null;
+ }
/**
* Visits the end of the class. This method, which is the last one to be
* called, is used to inform the visitor that all the fields and methods of
* the class have been visited.
*/
- void visitEnd();
+ public void visitEnd() {
+ if (cv != null) {
+ cv.visitEnd();
+ }
+ }
}
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/ClassWriter.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/ClassWriter.java
index ba811fe..fb5801a 100644
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/ClassWriter.java
+++ b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/ClassWriter.java
@@ -1,6 +1,6 @@
/***
* ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2007 INRIA, France Telecom
+ * Copyright (c) 2000-2011 INRIA, France Telecom
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,16 +29,17 @@
*/
package org.eclipse.persistence.internal.libraries.asm;
+
/**
* A {@link ClassVisitor} that generates classes in bytecode form. More
* precisely this visitor generates a byte array conforming to the Java class
* file format. It can be used alone, to generate a Java class "from scratch",
* or with one or more {@link ClassReader ClassReader} and adapter class visitor
* to generate a modified class from one or more existing Java classes.
- *
+ *
* @author Eric Bruneton
*/
-public class ClassWriter implements ClassVisitor {
+public class ClassWriter extends ClassVisitor {
/**
* Flag to automatically compute the maximum stack size and the maximum
@@ -47,7 +48,7 @@ public class ClassWriter implements ClassVisitor {
* {@link MethodVisitor} returned by the {@link #visitMethod visitMethod}
* method will be ignored, and computed automatically from the signature and
* the bytecode of each method.
- *
+ *
* @see #ClassWriter(int)
*/
public static final int COMPUTE_MAXS = 1;
@@ -60,17 +61,23 @@ public class ClassWriter implements ClassVisitor {
* {@link MethodVisitor#visitMaxs visitMaxs} method are also ignored and
* recomputed from the bytecode. In other words, computeFrames implies
* computeMaxs.
- *
+ *
* @see #ClassWriter(int)
*/
public static final int COMPUTE_FRAMES = 2;
/**
- * Pseudo access flag to distinguish between the synthetic attribute and
- * the synthetic access flag.
+ * Pseudo access flag to distinguish between the synthetic attribute and the
+ * synthetic access flag.
*/
static final int ACC_SYNTHETIC_ATTRIBUTE = 0x40000;
-
+
+ /**
+ * Factor to convert from ACC_SYNTHETIC_ATTRIBUTE to Opcode.ACC_SYNTHETIC.
+ */
+ static final int TO_ACC_SYNTHETIC = ACC_SYNTHETIC_ATTRIBUTE
+ / Opcodes.ACC_SYNTHETIC;
+
/**
* The type of instructions without any argument.
*/
@@ -109,52 +116,57 @@ public class ClassWriter implements ClassVisitor {
/**
* The type of the INVOKEINTERFACE/INVOKEDYNAMIC instruction.
*/
- static final int ITFDYNMETH_INSN = 7;
+ static final int ITFMETH_INSN = 7;
+
+ /**
+ * The type of the INVOKEDYNAMIC instruction.
+ */
+ static final int INDYMETH_INSN = 8;
/**
* The type of instructions with a 2 bytes bytecode offset label.
*/
- static final int LABEL_INSN = 8;
+ static final int LABEL_INSN = 9;
/**
* The type of instructions with a 4 bytes bytecode offset label.
*/
- static final int LABELW_INSN = 9;
+ static final int LABELW_INSN = 10;
/**
* The type of the LDC instruction.
*/
- static final int LDC_INSN = 10;
+ static final int LDC_INSN = 11;
/**
* The type of the LDC_W and LDC2_W instructions.
*/
- static final int LDCW_INSN = 11;
+ static final int LDCW_INSN = 12;
/**
* The type of the IINC instruction.
*/
- static final int IINC_INSN = 12;
+ static final int IINC_INSN = 13;
/**
* The type of the TABLESWITCH instruction.
*/
- static final int TABL_INSN = 13;
+ static final int TABL_INSN = 14;
/**
* The type of the LOOKUPSWITCH instruction.
*/
- static final int LOOK_INSN = 14;
+ static final int LOOK_INSN = 15;
/**
* The type of the MULTIANEWARRAY instruction.
*/
- static final int MANA_INSN = 15;
+ static final int MANA_INSN = 16;
/**
* The type of the WIDE instruction.
*/
- static final int WIDE_INSN = 16;
+ static final int WIDE_INSN = 17;
/**
* The instruction types of all JVM opcodes.
@@ -217,11 +229,33 @@ public class ClassWriter implements ClassVisitor {
static final int UTF8 = 1;
/**
+ * The type of CONSTANT_MethodType constant pool items.
+ */
+ static final int MTYPE = 16;
+
+ /**
+ * The type of CONSTANT_MethodHandle constant pool items.
+ */
+ static final int HANDLE = 15;
+
+ /**
+ * The type of CONSTANT_InvokeDynamic constant pool items.
+ */
+ static final int INDY = 18;
+
+ /**
+ * The base value for all CONSTANT_MethodHandle constant pool items.
+ * Internally, ASM store the 9 variations of CONSTANT_MethodHandle into 9
+ * different items.
+ */
+ static final int HANDLE_BASE = 20;
+
+ /**
* Normal type Item stored in the ClassWriter {@link ClassWriter#typeTable},
* instead of the constant pool, in order to avoid clashes with normal
* constant pool items in the ClassWriter constant pool's hash table.
*/
- static final int TYPE_NORMAL = 13;
+ static final int TYPE_NORMAL = 30;
/**
* Uninitialized type Item stored in the ClassWriter
@@ -229,14 +263,20 @@ public class ClassWriter implements ClassVisitor {
* avoid clashes with normal constant pool items in the ClassWriter constant
* pool's hash table.
*/
- static final int TYPE_UNINIT = 14;
+ static final int TYPE_UNINIT = 31;
/**
* Merged type Item stored in the ClassWriter {@link ClassWriter#typeTable},
* instead of the constant pool, in order to avoid clashes with normal
* constant pool items in the ClassWriter constant pool's hash table.
*/
- static final int TYPE_MERGED = 15;
+ static final int TYPE_MERGED = 32;
+
+ /**
+ * The type of BootstrapMethods items. These items are stored in a special
+ * class attribute named BootstrapMethods and not in the constant pool.
+ */
+ static final int BSM = 33;
/**
* The class reader from which this class writer was constructed, if any.
@@ -284,14 +324,19 @@ public class ClassWriter implements ClassVisitor {
final Item key3;
/**
+ * A reusable key used to look for items in the {@link #items} hash table.
+ */
+ final Item key4;
+
+ /**
* A type table used to temporarily store internal names that will not
* necessarily be stored in the constant pool. This type table is used by
* the control flow and data flow analysis algorithm used to compute stack
* map frames from scratch. This array associates to each index <tt>i</tt>
- * the Item whose index is <tt>i</tt>. All Item objects stored in this
- * array are also stored in the {@link #items} hash table. These two arrays
- * allow to retrieve an Item from its index or, conversely, to get the index
- * of an Item from its value. Each Item stores an internal name in its
+ * the Item whose index is <tt>i</tt>. All Item objects stored in this array
+ * are also stored in the {@link #items} hash table. These two arrays allow
+ * to retrieve an Item from its index or, conversely, to get the index of an
+ * Item from its value. Each Item stores an internal name in its
* {@link Item#strVal1} field.
*/
Item[] typeTable;
@@ -373,6 +418,16 @@ public class ClassWriter implements ClassVisitor {
private AnnotationWriter ianns;
/**
+ * The runtime visible type annotations of this class.
+ */
+ private AnnotationWriter tanns;
+
+ /**
+ * The runtime invisible type annotations of this class.
+ */
+ private AnnotationWriter itanns;
+
+ /**
* The non standard attributes of this class.
*/
private Attribute attrs;
@@ -388,25 +443,35 @@ public class ClassWriter implements ClassVisitor {
private ByteVector innerClasses;
/**
+ * The number of entries in the BootstrapMethods attribute.
+ */
+ int bootstrapMethodsCount;
+
+ /**
+ * The BootstrapMethods attribute.
+ */
+ ByteVector bootstrapMethods;
+
+ /**
* The fields of this class. These fields are stored in a linked list of
* {@link FieldWriter} objects, linked to each other by their
- * {@link FieldWriter#next} field. This field stores the first element of
- * this list.
+ * {@link FieldWriter#fv} field. This field stores the first element of this
+ * list.
*/
FieldWriter firstField;
/**
* The fields of this class. These fields are stored in a linked list of
* {@link FieldWriter} objects, linked to each other by their
- * {@link FieldWriter#next} field. This field stores the last element of
- * this list.
+ * {@link FieldWriter#fv} field. This field stores the last element of this
+ * list.
*/
FieldWriter lastField;
/**
* The methods of this class. These methods are stored in a linked list of
* {@link MethodWriter} objects, linked to each other by their
- * {@link MethodWriter#next} field. This field stores the first element of
+ * {@link MethodWriter#mv} field. This field stores the first element of
* this list.
*/
MethodWriter firstMethod;
@@ -414,8 +479,8 @@ public class ClassWriter implements ClassVisitor {
/**
* The methods of this class. These methods are stored in a linked list of
* {@link MethodWriter} objects, linked to each other by their
- * {@link MethodWriter#next} field. This field stores the last element of
- * this list.
+ * {@link MethodWriter#mv} field. This field stores the last element of this
+ * list.
*/
MethodWriter lastMethod;
@@ -423,12 +488,12 @@ public class ClassWriter implements ClassVisitor {
* <tt>true</tt> if the maximum stack size and number of local variables
* must be automatically computed.
*/
- private final boolean computeMaxs;
+ private boolean computeMaxs;
/**
* <tt>true</tt> if the stack map frames must be recomputed from scratch.
*/
- private final boolean computeFrames;
+ private boolean computeFrames;
/**
* <tt>true</tt> if the stack map tables of this class are invalid. The
@@ -450,10 +515,10 @@ public class ClassWriter implements ClassVisitor {
static {
int i;
byte[] b = new byte[220];
- String s = "AAAAAAAAAAAAAAAABCKLLDDDDDEEEEEEEEEEEEEEEEEEEEAAAAAAAADD"
+ String s = "AAAAAAAAAAAAAAAABCLMMDDDDDEEEEEEEEEEEEEEEEEEEEAAAAAAAADD"
+ "DDDEEEEEEEEEEEEEEEEEEEEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
- + "AAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAAIIIIIIIIIIIIIIIIDNOAA"
- + "AAAAGGGGGGGHHFBFAAFFAAQPIIJJIIIIIIIIIIIIIIIIII";
+ + "AAAAAAAAAAAAAAAAANAAAAAAAAAAAAAAAAAAAAJJJJJJJJJJJJJJJJDOPAA"
+ + "AAAAGGGGGGGHIFBFAAFFAARQJJKKJJJJJJJJJJJJJJJJJJ";
for (i = 0; i < b.length; ++i) {
b[i] = (byte) (s.charAt(i) - 'A');
}
@@ -493,8 +558,8 @@ public class ClassWriter implements ClassVisitor {
// for (i = Constants.GETSTATIC; i <= Constants.INVOKESTATIC; ++i) {
// b[i] = FIELDORMETH_INSN;
// }
- // b[Constants.INVOKEINTERFACE] = ITFDYNMETH_INSN;
- // b[Constants.INVOKEDYNAMIC] = ITFDYNMETH_INSN;
+ // b[Constants.INVOKEINTERFACE] = ITFMETH_INSN;
+ // b[Constants.INVOKEDYNAMIC] = INDYMETH_INSN;
//
// // LABEL(W)_INSN instructions
// for (i = Constants.IFEQ; i <= Constants.JSR; ++i) {
@@ -534,11 +599,14 @@ public class ClassWriter implements ClassVisitor {
/**
* Constructs a new {@link ClassWriter} object.
- *
- * @param flags option flags that can be used to modify the default behavior
- * of this class. See {@link #COMPUTE_MAXS}, {@link #COMPUTE_FRAMES}.
+ *
+ * @param flags
+ * option flags that can be used to modify the default behavior
+ * of this class. See {@link #COMPUTE_MAXS},
+ * {@link #COMPUTE_FRAMES}.
*/
public ClassWriter(final int flags) {
+ super(Opcodes.ASM5);
index = 1;
pool = new ByteVector();
items = new Item[256];
@@ -546,6 +614,7 @@ public class ClassWriter implements ClassVisitor {
key = new Item();
key2 = new Item();
key3 = new Item();
+ key4 = new Item();
this.computeMaxs = (flags & COMPUTE_MAXS) != 0;
this.computeFrames = (flags & COMPUTE_FRAMES) != 0;
}
@@ -554,28 +623,33 @@ public class ClassWriter implements ClassVisitor {
* Constructs a new {@link ClassWriter} object and enables optimizations for
* "mostly add" bytecode transformations. These optimizations are the
* following:
- *
- * <ul> <li>The constant pool from the original class is copied as is in
- * the new class, which saves time. New constant pool entries will be added
- * at the end if necessary, but unused constant pool entries <i>won't be
- * removed</i>.</li> <li>Methods that are not transformed are copied as
- * is in the new class, directly from the original class bytecode (i.e.
- * without emitting visit events for all the method instructions), which
- * saves a <i>lot</i> of time. Untransformed methods are detected by the
- * fact that the {@link ClassReader} receives {@link MethodVisitor} objects
- * that come from a {@link ClassWriter} (and not from a custom
- * {@link ClassAdapter} or any other {@link ClassVisitor} instance).</li>
+ *
+ * <ul>
+ * <li>The constant pool from the original class is copied as is in the new
+ * class, which saves time. New constant pool entries will be added at the
+ * end if necessary, but unused constant pool entries <i>won't be
+ * removed</i>.</li>
+ * <li>Methods that are not transformed are copied as is in the new class,
+ * directly from the original class bytecode (i.e. without emitting visit
+ * events for all the method instructions), which saves a <i>lot</i> of
+ * time. Untransformed methods are detected by the fact that the
+ * {@link ClassReader} receives {@link MethodVisitor} objects that come from
+ * a {@link ClassWriter} (and not from any other {@link ClassVisitor}
+ * instance).</li>
* </ul>
- *
- * @param classReader the {@link ClassReader} used to read the original
- * class. It will be used to copy the entire constant pool from the
- * original class and also to copy other fragments of original
- * bytecode where applicable.
- * @param flags option flags that can be used to modify the default behavior
- * of this class. <i>These option flags do not affect methods that
- * are copied as is in the new class. This means that the maximum
- * stack size nor the stack frames will be computed for these
- * methods</i>. See {@link #COMPUTE_MAXS}, {@link #COMPUTE_FRAMES}.
+ *
+ * @param classReader
+ * the {@link ClassReader} used to read the original class. It
+ * will be used to copy the entire constant pool from the
+ * original class and also to copy other fragments of original
+ * bytecode where applicable.
+ * @param flags
+ * option flags that can be used to modify the default behavior
+ * of this class. <i>These option flags do not affect methods
+ * that are copied as is in the new class. This means that the
+ * maximum stack size nor the stack frames will be computed for
+ * these methods</i>. See {@link #COMPUTE_MAXS},
+ * {@link #COMPUTE_FRAMES}.
*/
public ClassWriter(final ClassReader classReader, final int flags) {
this(flags);
@@ -584,17 +658,13 @@ public class ClassWriter implements ClassVisitor {
}
// ------------------------------------------------------------------------
- // Implementation of the ClassVisitor interface
+ // Implementation of the ClassVisitor abstract class
// ------------------------------------------------------------------------
- public void visit(
- final int version,
- final int access,
- final String name,
- final String signature,
- final String superName,
- final String[] interfaces)
- {
+ @Override
+ public final void visit(final int version, final int access,
+ final String name, final String signature, final String superName,
+ final String[] interfaces) {
this.version = version;
this.access = access;
this.name = newClass(name);
@@ -612,30 +682,29 @@ public class ClassWriter implements ClassVisitor {
}
}
- public void visitSource(final String file, final String debug) {
+ @Override
+ public final void visitSource(final String file, final String debug) {
if (file != null) {
sourceFile = newUTF8(file);
}
if (debug != null) {
- sourceDebug = new ByteVector().putUTF8(debug);
+ sourceDebug = new ByteVector().encodeUTF8(debug, 0,
+ Integer.MAX_VALUE);
}
}
- public void visitOuterClass(
- final String owner,
- final String name,
- final String desc)
- {
+ @Override
+ public final void visitOuterClass(final String owner, final String name,
+ final String desc) {
enclosingMethodOwner = newClass(owner);
if (name != null && desc != null) {
enclosingMethod = newNameType(name, desc);
}
}
- public AnnotationVisitor visitAnnotation(
- final String desc,
- final boolean visible)
- {
+ @Override
+ public final AnnotationVisitor visitAnnotation(final String desc,
+ final boolean visible) {
if (!ClassReader.ANNOTATIONS) {
return null;
}
@@ -653,55 +722,81 @@ public class ClassWriter implements ClassVisitor {
return aw;
}
- public void visitAttribute(final Attribute attr) {
+ @Override
+ public final AnnotationVisitor visitTypeAnnotation(int typeRef,
+ TypePath typePath, final String desc, final boolean visible) {
+ if (!ClassReader.ANNOTATIONS) {
+ return null;
+ }
+ ByteVector bv = new ByteVector();
+ // write target_type and target_info
+ AnnotationWriter.putTarget(typeRef, typePath, bv);
+ // write type, and reserve space for values count
+ bv.putShort(newUTF8(desc)).putShort(0);
+ AnnotationWriter aw = new AnnotationWriter(this, true, bv, bv,
+ bv.length - 2);
+ if (visible) {
+ aw.next = tanns;
+ tanns = aw;
+ } else {
+ aw.next = itanns;
+ itanns = aw;
+ }
+ return aw;
+ }
+
+ @Override
+ public final void visitAttribute(final Attribute attr) {
attr.next = attrs;
attrs = attr;
}
- public void visitInnerClass(
- final String name,
- final String outerName,
- final String innerName,
- final int access)
- {
+ @Override
+ public final void visitInnerClass(final String name,
+ final String outerName, final String innerName, final int access) {
if (innerClasses == null) {
innerClasses = new ByteVector();
}
- ++innerClassesCount;
- innerClasses.putShort(name == null ? 0 : newClass(name));
- innerClasses.putShort(outerName == null ? 0 : newClass(outerName));
- innerClasses.putShort(innerName == null ? 0 : newUTF8(innerName));
- innerClasses.putShort(access);
+ // �4.7.6 of the JVMS states "Every CONSTANT_Class_info entry in the
+ // constant_pool table which represents a class or interface C that is
+ // not a package member must have exactly one corresponding entry in the
+ // classes array". To avoid duplicates we keep track in the intVal field
+ // of the Item of each CONSTANT_Class_info entry C whether an inner
+ // class entry has already been added for C (this field is unused for
+ // class entries, and changing its value does not change the hashcode
+ // and equality tests). If so we store the index of this inner class
+ // entry (plus one) in intVal. This hack allows duplicate detection in
+ // O(1) time.
+ Item nameItem = newClassItem(name);
+ if (nameItem.intVal == 0) {
+ ++innerClassesCount;
+ innerClasses.putShort(nameItem.index);
+ innerClasses.putShort(outerName == null ? 0 : newClass(outerName));
+ innerClasses.putShort(innerName == null ? 0 : newUTF8(innerName));
+ innerClasses.putShort(access);
+ nameItem.intVal = innerClassesCount;
+ } else {
+ // Compare the inner classes entry nameItem.intVal - 1 with the
+ // arguments of this method and throw an exception if there is a
+ // difference?
+ }
}
- public FieldVisitor visitField(
- final int access,
- final String name,
- final String desc,
- final String signature,
- final Object value)
- {
+ @Override
+ public final FieldVisitor visitField(final int access, final String name,
+ final String desc, final String signature, final Object value) {
return new FieldWriter(this, access, name, desc, signature, value);
}
- public MethodVisitor visitMethod(
- final int access,
- final String name,
- final String desc,
- final String signature,
- final String[] exceptions)
- {
- return new MethodWriter(this,
- access,
- name,
- desc,
- signature,
- exceptions,
- computeMaxs,
- computeFrames);
+ @Override
+ public final MethodVisitor visitMethod(final int access, final String name,
+ final String desc, final String signature, final String[] exceptions) {
+ return new MethodWriter(this, access, name, desc, signature,
+ exceptions, computeMaxs, computeFrames);
}
- public void visitEnd() {
+ @Override
+ public final void visitEnd() {
}
// ------------------------------------------------------------------------
@@ -710,10 +805,13 @@ public class ClassWriter implements ClassVisitor {
/**
* Returns the bytecode of the class that was build with this class writer.
- *
+ *
* @return the bytecode of the class that was build with this class writer.
*/
public byte[] toByteArray() {
+ if (index > 0xFFFF) {
+ throw new RuntimeException("Class file too large!");
+ }
// computes the real size of the bytecode of this class
int size = 24 + 2 * interfaceCount;
int nbFields = 0;
@@ -721,16 +819,23 @@ public class ClassWriter implements ClassVisitor {
while (fb != null) {
++nbFields;
size += fb.getSize();
- fb = fb.next;
+ fb = (FieldWriter) fb.fv;
}
int nbMethods = 0;
MethodWriter mb = firstMethod;
while (mb != null) {
++nbMethods;
size += mb.getSize();
- mb = mb.next;
+ mb = (MethodWriter) mb.mv;
}
int attributeCount = 0;
+ if (bootstrapMethods != null) {
+ // we put it as first attribute in order to improve a bit
+ // ClassReader.copyBootstrapMethods
+ ++attributeCount;
+ size += 8 + bootstrapMethods.length;
+ newUTF8("BootstrapMethods");
+ }
if (ClassReader.SIGNATURES && signature != 0) {
++attributeCount;
size += 8;
@@ -743,7 +848,7 @@ public class ClassWriter implements ClassVisitor {
}
if (sourceDebug != null) {
++attributeCount;
- size += sourceDebug.length + 4;
+ size += sourceDebug.length + 6;
newUTF8("SourceDebugExtension");
}
if (enclosingMethodOwner != 0) {
@@ -756,12 +861,13 @@ public class ClassWriter implements ClassVisitor {
size += 6;
newUTF8("Deprecated");
}
- if ((access & Opcodes.ACC_SYNTHETIC) != 0
- && ((version & 0xFFFF) < Opcodes.V1_5 || (access & ACC_SYNTHETIC_ATTRIBUTE) != 0))
- {
- ++attributeCount;
- size += 6;
- newUTF8("Synthetic");
+ if ((access & Opcodes.ACC_SYNTHETIC) != 0) {
+ if ((version & 0xFFFF) < Opcodes.V1_5
+ || (access & ACC_SYNTHETIC_ATTRIBUTE) != 0) {
+ ++attributeCount;
+ size += 6;
+ newUTF8("Synthetic");
+ }
}
if (innerClasses != null) {
++attributeCount;
@@ -778,6 +884,16 @@ public class ClassWriter implements ClassVisitor {
size += 8 + ianns.getSize();
newUTF8("RuntimeInvisibleAnnotations");
}
+ if (ClassReader.ANNOTATIONS && tanns != null) {
+ ++attributeCount;
+ size += 8 + tanns.getSize();
+ newUTF8("RuntimeVisibleTypeAnnotations");
+ }
+ if (ClassReader.ANNOTATIONS && itanns != null) {
+ ++attributeCount;
+ size += 8 + itanns.getSize();
+ newUTF8("RuntimeInvisibleTypeAnnotations");
+ }
if (attrs != null) {
attributeCount += attrs.getCount();
size += attrs.getSize(this, null, 0, -1, -1);
@@ -788,9 +904,8 @@ public class ClassWriter implements ClassVisitor {
ByteVector out = new ByteVector(size);
out.putInt(0xCAFEBABE).putInt(version);
out.putShort(index).putByteArray(pool.data, 0, pool.length);
- int mask = Opcodes.ACC_DEPRECATED
- | ClassWriter.ACC_SYNTHETIC_ATTRIBUTE
- | ((access & ClassWriter.ACC_SYNTHETIC_ATTRIBUTE) / (ClassWriter.ACC_SYNTHETIC_ATTRIBUTE / Opcodes.ACC_SYNTHETIC));
+ int mask = Opcodes.ACC_DEPRECATED | ACC_SYNTHETIC_ATTRIBUTE
+ | ((access & ACC_SYNTHETIC_ATTRIBUTE) / TO_ACC_SYNTHETIC);
out.putShort(access & ~mask).putShort(name).putShort(superName);
out.putShort(interfaceCount);
for (int i = 0; i < interfaceCount; ++i) {
@@ -800,15 +915,21 @@ public class ClassWriter implements ClassVisitor {
fb = firstField;
while (fb != null) {
fb.put(out);
- fb = fb.next;
+ fb = (FieldWriter) fb.fv;
}
out.putShort(nbMethods);
mb = firstMethod;
while (mb != null) {
mb.put(out);
- mb = mb.next;
+ mb = (MethodWriter) mb.mv;
}
out.putShort(attributeCount);
+ if (bootstrapMethods != null) {
+ out.putShort(newUTF8("BootstrapMethods"));
+ out.putInt(bootstrapMethods.length + 2).putShort(
+ bootstrapMethodsCount);
+ out.putByteArray(bootstrapMethods.data, 0, bootstrapMethods.length);
+ }
if (ClassReader.SIGNATURES && signature != 0) {
out.putShort(newUTF8("Signature")).putInt(2).putShort(signature);
}
@@ -816,9 +937,9 @@ public class ClassWriter implements ClassVisitor {
out.putShort(newUTF8("SourceFile")).putInt(2).putShort(sourceFile);
}
if (sourceDebug != null) {
- int len = sourceDebug.length - 2;
+ int len = sourceDebug.length;
out.putShort(newUTF8("SourceDebugExtension")).putInt(len);
- out.putByteArray(sourceDebug.data, 2, len);
+ out.putByteArray(sourceDebug.data, 0, len);
}
if (enclosingMethodOwner != 0) {
out.putShort(newUTF8("EnclosingMethod")).putInt(4);
@@ -827,10 +948,11 @@ public class ClassWriter implements ClassVisitor {
if ((access & Opcodes.ACC_DEPRECATED) != 0) {
out.putShort(newUTF8("Deprecated")).putInt(0);
}
- if ((access & Opcodes.ACC_SYNTHETIC) != 0
- && ((version & 0xFFFF) < Opcodes.V1_5 || (access & ACC_SYNTHETIC_ATTRIBUTE) != 0))
- {
- out.putShort(newUTF8("Synthetic")).putInt(0);
+ if ((access & Opcodes.ACC_SYNTHETIC) != 0) {
+ if ((version & 0xFFFF) < Opcodes.V1_5
+ || (access & ACC_SYNTHETIC_ATTRIBUTE) != 0) {
+ out.putShort(newUTF8("Synthetic")).putInt(0);
+ }
}
if (innerClasses != null) {
out.putShort(newUTF8("InnerClasses"));
@@ -845,13 +967,34 @@ public class ClassWriter implements ClassVisitor {
out.putShort(newUTF8("RuntimeInvisibleAnnotations"));
ianns.put(out);
}
+ if (ClassReader.ANNOTATIONS && tanns != null) {
+ out.putShort(newUTF8("RuntimeVisibleTypeAnnotations"));
+ tanns.put(out);
+ }
+ if (ClassReader.ANNOTATIONS && itanns != null) {
+ out.putShort(newUTF8("RuntimeInvisibleTypeAnnotations"));
+ itanns.put(out);
+ }
if (attrs != null) {
attrs.put(this, null, 0, -1, -1, out);
}
if (invalidFrames) {
- ClassWriter cw = new ClassWriter(COMPUTE_FRAMES);
- new ClassReader(out.data).accept(cw, ClassReader.SKIP_FRAMES);
- return cw.toByteArray();
+ anns = null;
+ ianns = null;
+ attrs = null;
+ innerClassesCount = 0;
+ innerClasses = null;
+ bootstrapMethodsCount = 0;
+ bootstrapMethods = null;
+ firstField = null;
+ lastField = null;
+ firstMethod = null;
+ lastMethod = null;
+ computeMaxs = false;
+ computeFrames = true;
+ invalidFrames = false;
+ new ClassReader(out.data).accept(this, ClassReader.SKIP_FRAMES);
+ return toByteArray();
}
return out.data;
}
@@ -863,11 +1006,12 @@ public class ClassWriter implements ClassVisitor {
/**
* Adds a number or string constant to the constant pool of the class being
* build. Does nothing if the constant pool already contains a similar item.
- *
- * @param cst the value of the constant to be added to the constant pool.
- * This parameter must be an {@link Integer}, a {@link Float}, a
- * {@link Long}, a {@link Double}, a {@link String} or a
- * {@link Type}.
+ *
+ * @param cst
+ * the value of the constant to be added to the constant pool.
+ * This parameter must be an {@link Integer}, a {@link Float}, a
+ * {@link Long}, a {@link Double}, a {@link String} or a
+ * {@link Type}.
* @return a new or already existing constant item with the given value.
*/
Item newConstItem(final Object cst) {
@@ -899,9 +1043,17 @@ public class ClassWriter implements ClassVisitor {
return newString((String) cst);
} else if (cst instanceof Type) {
Type t = (Type) cst;
- return newClassItem(t.getSort() == Type.OBJECT
- ? t.getInternalName()
- : t.getDescriptor());
+ int s = t.getSort();
+ if (s == Type.OBJECT) {
+ return newClassItem(t.getInternalName());
+ } else if (s == Type.METHOD) {
+ return newMethodTypeItem(t.getDescriptor());
+ } else { // s == primitive type or array
+ return newClassItem(t.getDescriptor());
+ }
+ } else if (cst instanceof Handle) {
+ Handle h = (Handle) cst;
+ return newHandleItem(h.tag, h.owner, h.name, h.desc);
} else {
throw new IllegalArgumentException("value " + cst);
}
@@ -912,10 +1064,11 @@ public class ClassWriter implements ClassVisitor {
* build. Does nothing if the constant pool already contains a similar item.
* <i>This method is intended for {@link Attribute} sub classes, and is
* normally not needed by class generators or adapters.</i>
- *
- * @param cst the value of the constant to be added to the constant pool.
- * This parameter must be an {@link Integer}, a {@link Float}, a
- * {@link Long}, a {@link Double} or a {@link String}.
+ *
+ * @param cst
+ * the value of the constant to be added to the constant pool.
+ * This parameter must be an {@link Integer}, a {@link Float}, a
+ * {@link Long}, a {@link Double} or a {@link String}.
* @return the index of a new or already existing constant item with the
* given value.
*/
@@ -928,8 +1081,9 @@ public class ClassWriter implements ClassVisitor {
* nothing if the constant pool already contains a similar item. <i>This
* method is intended for {@link Attribute} sub classes, and is normally not
* needed by class generators or adapters.</i>
- *
- * @param value the String value.
+ *
+ * @param value
+ * the String value.
* @return the index of a new or already existing UTF8 item.
*/
public int newUTF8(final String value) {
@@ -948,8 +1102,9 @@ public class ClassWriter implements ClassVisitor {
* Does nothing if the constant pool already contains a similar item.
* <i>This method is intended for {@link Attribute} sub classes, and is
* normally not needed by class generators or adapters.</i>
- *
- * @param value the internal name of the class.
+ *
+ * @param value
+ * the internal name of the class.
* @return a new or already existing class reference item.
*/
Item newClassItem(final String value) {
@@ -968,8 +1123,9 @@ public class ClassWriter implements ClassVisitor {
* Does nothing if the constant pool already contains a similar item.
* <i>This method is intended for {@link Attribute} sub classes, and is
* normally not needed by class generators or adapters.</i>
- *
- * @param value the internal name of the class.
+ *
+ * @param value
+ * the internal name of the class.
* @return the index of a new or already existing class reference item.
*/
public int newClass(final String value) {
@@ -977,16 +1133,230 @@ public class ClassWriter implements ClassVisitor {
}
/**
+ * Adds a method type reference to the constant pool of the class being
+ * build. Does nothing if the constant pool already contains a similar item.
+ * <i>This method is intended for {@link Attribute} sub classes, and is
+ * normally not needed by class generators or adapters.</i>
+ *
+ * @param methodDesc
+ * method descriptor of the method type.
+ * @return a new or already existing method type reference item.
+ */
+ Item newMethodTypeItem(final String methodDesc) {
+ key2.set(MTYPE, methodDesc, null, null);
+ Item result = get(key2);
+ if (result == null) {
+ pool.put12(MTYPE, newUTF8(methodDesc));
+ result = new Item(index++, key2);
+ put(result);
+ }
+ return result;
+ }
+
+ /**
+ * Adds a method type reference to the constant pool of the class being
+ * build. Does nothing if the constant pool already contains a similar item.
+ * <i>This method is intended for {@link Attribute} sub classes, and is
+ * normally not needed by class generators or adapters.</i>
+ *
+ * @param methodDesc
+ * method descriptor of the method type.
+ * @return the index of a new or already existing method type reference
+ * item.
+ */
+ public int newMethodType(final String methodDesc) {
+ return newMethodTypeItem(methodDesc).index;
+ }
+
+ /**
+ * Adds a handle to the constant pool of the class being build. Does nothing
+ * if the constant pool already contains a similar item. <i>This method is
+ * intended for {@link Attribute} sub classes, and is normally not needed by
+ * class generators or adapters.</i>
+ *
+ * @param tag
+ * the kind of this handle. Must be {@link Opcodes#H_GETFIELD},
+ * {@link Opcodes#H_GETSTATIC}, {@link Opcodes#H_PUTFIELD},
+ * {@link Opcodes#H_PUTSTATIC}, {@link Opcodes#H_INVOKEVIRTUAL},
+ * {@link Opcodes#H_INVOKESTATIC},
+ * {@link Opcodes#H_INVOKESPECIAL},
+ * {@link Opcodes#H_NEWINVOKESPECIAL} or
+ * {@link Opcodes#H_INVOKEINTERFACE}.
+ * @param owner
+ * the internal name of the field or method owner class.
+ * @param name
+ * the name of the field or method.
+ * @param desc
+ * the descriptor of the field or method.
+ * @return a new or an already existing method type reference item.
+ */
+ Item newHandleItem(final int tag, final String owner, final String name,
+ final String desc) {
+ key4.set(HANDLE_BASE + tag, owner, name, desc);
+ Item result = get(key4);
+ if (result == null) {
+ if (tag <= Opcodes.H_PUTSTATIC) {
+ put112(HANDLE, tag, newField(owner, name, desc));
+ } else {
+ put112(HANDLE,
+ tag,
+ newMethod(owner, name, desc,
+ tag == Opcodes.H_INVOKEINTERFACE));
+ }
+ result = new Item(index++, key4);
+ put(result);
+ }
+ return result;
+ }
+
+ /**
+ * Adds a handle to the constant pool of the class being build. Does nothing
+ * if the constant pool already contains a similar item. <i>This method is
+ * intended for {@link Attribute} sub classes, and is normally not needed by
+ * class generators or adapters.</i>
+ *
+ * @param tag
+ * the kind of this handle. Must be {@link Opcodes#H_GETFIELD},
+ * {@link Opcodes#H_GETSTATIC}, {@link Opcodes#H_PUTFIELD},
+ * {@link Opcodes#H_PUTSTATIC}, {@link Opcodes#H_INVOKEVIRTUAL},
+ * {@link Opcodes#H_INVOKESTATIC},
+ * {@link Opcodes#H_INVOKESPECIAL},
+ * {@link Opcodes#H_NEWINVOKESPECIAL} or
+ * {@link Opcodes#H_INVOKEINTERFACE}.
+ * @param owner
+ * the internal name of the field or method owner class.
+ * @param name
+ * the name of the field or method.
+ * @param desc
+ * the descriptor of the field or method.
+ * @return the index of a new or already existing method type reference
+ * item.
+ */
+ public int newHandle(final int tag, final String owner, final String name,
+ final String desc) {
+ return newHandleItem(tag, owner, name, desc).index;
+ }
+
+ /**
+ * Adds an invokedynamic reference to the constant pool of the class being
+ * build. Does nothing if the constant pool already contains a similar item.
+ * <i>This method is intended for {@link Attribute} sub classes, and is
+ * normally not needed by class generators or adapters.</i>
+ *
+ * @param name
+ * name of the invoked method.
+ * @param desc
+ * descriptor of the invoke method.
+ * @param bsm
+ * the bootstrap method.
+ * @param bsmArgs
+ * the bootstrap method constant arguments.
+ *
+ * @return a new or an already existing invokedynamic type reference item.
+ */
+ Item newInvokeDynamicItem(final String name, final String desc,
+ final Handle bsm, final Object... bsmArgs) {
+ // cache for performance
+ ByteVector bootstrapMethods = this.bootstrapMethods;
+ if (bootstrapMethods == null) {
+ bootstrapMethods = this.bootstrapMethods = new ByteVector();
+ }
+
+ int position = bootstrapMethods.length; // record current position
+
+ int hashCode = bsm.hashCode();
+ bootstrapMethods.putShort(newHandle(bsm.tag, bsm.owner, bsm.name,
+ bsm.desc));
+
+ int argsLength = bsmArgs.length;
+ bootstrapMethods.putShort(argsLength);
+
+ for (int i = 0; i < argsLength; i++) {
+ Object bsmArg = bsmArgs[i];
+ hashCode ^= bsmArg.hashCode();
+ bootstrapMethods.putShort(newConst(bsmArg));
+ }
+
+ byte[] data = bootstrapMethods.data;
+ int length = (1 + 1 + argsLength) << 1; // (bsm + argCount + arguments)
+ hashCode &= 0x7FFFFFFF;
+ Item result = items[hashCode % items.length];
+ loop: while (result != null) {
+ if (result.type != BSM || result.hashCode != hashCode) {
+ result = result.next;
+ continue;
+ }
+
+ // because the data encode the size of the argument
+ // we don't need to test if these size are equals
+ int resultPosition = result.intVal;
+ for (int p = 0; p < length; p++) {
+ if (data[position + p] != data[resultPosition + p]) {
+ result = result.next;
+ continue loop;
+ }
+ }
+ break;
+ }
+
+ int bootstrapMethodIndex;
+ if (result != null) {
+ bootstrapMethodIndex = result.index;
+ bootstrapMethods.length = position; // revert to old position
+ } else {
+ bootstrapMethodIndex = bootstrapMethodsCount++;
+ result = new Item(bootstrapMethodIndex);
+ result.set(position, hashCode);
+ put(result);
+ }
+
+ // now, create the InvokeDynamic constant
+ key3.set(name, desc, bootstrapMethodIndex);
+ result = get(key3);
+ if (result == null) {
+ put122(INDY, bootstrapMethodIndex, newNameType(name, desc));
+ result = new Item(index++, key3);
+ put(result);
+ }
+ return result;
+ }
+
+ /**
+ * Adds an invokedynamic reference to the constant pool of the class being
+ * build. Does nothing if the constant pool already contains a similar item.
+ * <i>This method is intended for {@link Attribute} sub classes, and is
+ * normally not needed by class generators or adapters.</i>
+ *
+ * @param name
+ * name of the invoked method.
+ * @param desc
+ * descriptor of the invoke method.
+ * @param bsm
+ * the bootstrap method.
+ * @param bsmArgs
+ * the bootstrap method constant arguments.
+ *
+ * @return the index of a new or already existing invokedynamic reference
+ * item.
+ */
+ public int newInvokeDynamic(final String name, final String desc,
+ final Handle bsm, final Object... bsmArgs) {
+ return newInvokeDynamicItem(name, desc, bsm, bsmArgs).index;
+ }
+
+ /**
* Adds a field reference to the constant pool of the class being build.
* Does nothing if the constant pool already contains a similar item.
- *
- * @param owner the internal name of the field's owner class.
- * @param name the field's name.
- * @param desc the field's descriptor.
+ *
+ * @param owner
+ * the internal name of the field's owner class.
+ * @param name
+ * the field's name.
+ * @param desc
+ * the field's descriptor.
* @return a new or already existing field reference item.
*/
- Item newFieldItem(final String owner, final String name, final String desc)
- {
+ Item newFieldItem(final String owner, final String name, final String desc) {
key3.set(FIELD, owner, name, desc);
Item result = get(key3);
if (result == null) {
@@ -1002,33 +1372,35 @@ public class ClassWriter implements ClassVisitor {
* Does nothing if the constant pool already contains a similar item.
* <i>This method is intended for {@link Attribute} sub classes, and is
* normally not needed by class generators or adapters.</i>
- *
- * @param owner the internal name of the field's owner class.
- * @param name the field's name.
- * @param desc the field's descriptor.
+ *
+ * @param owner
+ * the internal name of the field's owner class.
+ * @param name
+ * the field's name.
+ * @param desc
+ * the field's descriptor.
* @return the index of a new or already existing field reference item.
*/
- public int newField(final String owner, final String name, final String desc)
- {
+ public int newField(final String owner, final String name, final String desc) {
return newFieldItem(owner, name, desc).index;
}
/**
* Adds a method reference to the constant pool of the class being build.
* Does nothing if the constant pool already contains a similar item.
- *
- * @param owner the internal name of the method's owner class.
- * @param name the method's name.
- * @param desc the method's descriptor.
- * @param itf <tt>true</tt> if <tt>owner</tt> is an interface.
+ *
+ * @param owner
+ * the internal name of the method's owner class.
+ * @param name
+ * the method's name.
+ * @param desc
+ * the method's descriptor.
+ * @param itf
+ * <tt>true</tt> if <tt>owner</tt> is an interface.
* @return a new or already existing method reference item.
*/
- Item newMethodItem(
- final String owner,
- final String name,
- final String desc,
- final boolean itf)
- {
+ Item newMethodItem(final String owner, final String name,
+ final String desc, final boolean itf) {
int type = itf ? IMETH : METH;
key3.set(type, owner, name, desc);
Item result = get(key3);
@@ -1045,27 +1417,28 @@ public class ClassWriter implements ClassVisitor {
* Does nothing if the constant pool already contains a similar item.
* <i>This method is intended for {@link Attribute} sub classes, and is
* normally not needed by class generators or adapters.</i>
- *
- * @param owner the internal name of the method's owner class.
- * @param name the method's name.
- * @param desc the method's descriptor.
- * @param itf <tt>true</tt> if <tt>owner</tt> is an interface.
+ *
+ * @param owner
+ * the internal name of the method's owner class.
+ * @param name
+ * the method's name.
+ * @param desc
+ * the method's descriptor.
+ * @param itf
+ * <tt>true</tt> if <tt>owner</tt> is an interface.
* @return the index of a new or already existing method reference item.
*/
- public int newMethod(
- final String owner,
- final String name,
- final String desc,
- final boolean itf)
- {
+ public int newMethod(final String owner, final String name,
+ final String desc, final boolean itf) {
return newMethodItem(owner, name, desc, itf).index;
}
/**
* Adds an integer to the constant pool of the class being build. Does
* nothing if the constant pool already contains a similar item.
- *
- * @param value the int value.
+ *
+ * @param value
+ * the int value.
* @return a new or already existing int item.
*/
Item newInteger(final int value) {
@@ -1082,8 +1455,9 @@ public class ClassWriter implements ClassVisitor {
/**
* Adds a float to the constant pool of the class being build. Does nothing
* if the constant pool already contains a similar item.
- *
- * @param value the float value.
+ *
+ * @param value
+ * the float value.
* @return a new or already existing float item.
*/
Item newFloat(final float value) {
@@ -1100,8 +1474,9 @@ public class ClassWriter implements ClassVisitor {
/**
* Adds a long to the constant pool of the class being build. Does nothing
* if the constant pool already contains a similar item.
- *
- * @param value the long value.
+ *
+ * @param value
+ * the long value.
* @return a new or already existing long item.
*/
Item newLong(final long value) {
@@ -1110,8 +1485,8 @@ public class ClassWriter implements ClassVisitor {
if (result == null) {
pool.putByte(LONG).putLong(value);
result = new Item(index, key);
- put(result);
index += 2;
+ put(result);
}
return result;
}
@@ -1119,8 +1494,9 @@ public class ClassWriter implements ClassVisitor {
/**
* Adds a double to the constant pool of the class being build. Does nothing
* if the constant pool already contains a similar item.
- *
- * @param value the double value.
+ *
+ * @param value
+ * the double value.
* @return a new or already existing double item.
*/
Item newDouble(final double value) {
@@ -1129,8 +1505,8 @@ public class ClassWriter implements ClassVisitor {
if (result == null) {
pool.putByte(DOUBLE).putLong(key.longVal);
result = new Item(index, key);
- put(result);
index += 2;
+ put(result);
}
return result;
}
@@ -1138,8 +1514,9 @@ public class ClassWriter implements ClassVisitor {
/**
* Adds a string to the constant pool of the class being build. Does nothing
* if the constant pool already contains a similar item.
- *
- * @param value the String value.
+ *
+ * @param value
+ * the String value.
* @return a new or already existing string item.
*/
private Item newString(final String value) {
@@ -1158,21 +1535,25 @@ public class ClassWriter implements ClassVisitor {
* nothing if the constant pool already contains a similar item. <i>This
* method is intended for {@link Attribute} sub classes, and is normally not
* needed by class generators or adapters.</i>
- *
- * @param name a name.
- * @param desc a type descriptor.
+ *
+ * @param name
+ * a name.
+ * @param desc
+ * a type descriptor.
* @return the index of a new or already existing name and type item.
*/
public int newNameType(final String name, final String desc) {
return newNameTypeItem(name, desc).index;
}
-
+
/**
* Adds a name and type to the constant pool of the class being build. Does
* nothing if the constant pool already contains a similar item.
- *
- * @param name a name.
- * @param desc a type descriptor.
+ *
+ * @param name
+ * a name.
+ * @param desc
+ * a type descriptor.
* @return a new or already existing name and type item.
*/
Item newNameTypeItem(final String name, final String desc) {
@@ -1189,8 +1570,9 @@ public class ClassWriter implements ClassVisitor {
/**
* Adds the given internal name to {@link #typeTable} and returns its index.
* Does nothing if the type table already contains this internal name.
- *
- * @param type the internal name to be added to the type table.
+ *
+ * @param type
+ * the internal name to be added to the type table.
* @return the index of this internal name in the type table.
*/
int addType(final String type) {
@@ -1206,10 +1588,12 @@ public class ClassWriter implements ClassVisitor {
* Adds the given "uninitialized" type to {@link #typeTable} and returns its
* index. This method is used for UNINITIALIZED types, made of an internal
* name and a bytecode offset.
- *
- * @param type the internal name to be added to the type table.
- * @param offset the bytecode offset of the NEW instruction that created
- * this UNINITIALIZED type value.
+ *
+ * @param type
+ * the internal name to be added to the type table.
+ * @param offset
+ * the bytecode offset of the NEW instruction that created this
+ * UNINITIALIZED type value.
* @return the index of this internal name in the type table.
*/
int addUninitializedType(final String type, final int offset) {
@@ -1226,8 +1610,9 @@ public class ClassWriter implements ClassVisitor {
/**
* Adds the given Item to {@link #typeTable}.
- *
- * @param item the value to be added to the type table.
+ *
+ * @param item
+ * the value to be added to the type table.
* @return the added Item, which a new Item instance with the same value as
* the given Item.
*/
@@ -1252,9 +1637,11 @@ public class ClassWriter implements ClassVisitor {
* method calls {@link #getCommonSuperClass} and caches the result in the
* {@link #items} hash table to speedup future calls with the same
* parameters.
- *
- * @param type1 index of an internal name in {@link #typeTable}.
- * @param type2 index of an internal name in {@link #typeTable}.
+ *
+ * @param type1
+ * index of an internal name in {@link #typeTable}.
+ * @param type2
+ * index of an internal name in {@link #typeTable}.
* @return the index of the common super type of the two given types.
*/
int getMergedType(final int type1, final int type2) {
@@ -1274,24 +1661,26 @@ public class ClassWriter implements ClassVisitor {
/**
* Returns the common super type of the two given types. The default
- * implementation of this method <i>loads<i> the two given classes and uses
+ * implementation of this method <i>loads</i> the two given classes and uses
* the java.lang.Class methods to find the common super class. It can be
* overridden to compute this common super type in other ways, in particular
* without actually loading any class, or to take into account the class
* that is currently being generated by this ClassWriter, which can of
* course not be loaded since it is under construction.
- *
- * @param type1 the internal name of a class.
- * @param type2 the internal name of another class.
+ *
+ * @param type1
+ * the internal name of a class.
+ * @param type2
+ * the internal name of another class.
* @return the internal name of the common super class of the two given
* classes.
*/
- protected String getCommonSuperClass(final String type1, final String type2)
- {
- Class c, d;
+ protected String getCommonSuperClass(final String type1, final String type2) {
+ Class<?> c, d;
+ ClassLoader classLoader = getClass().getClassLoader();
try {
- c = Class.forName(type1.replace('/', '.'));
- d = Class.forName(type2.replace('/', '.'));
+ c = Class.forName(type1.replace('/', '.'), false, classLoader);
+ d = Class.forName(type2.replace('/', '.'), false, classLoader);
} catch (Exception e) {
throw new RuntimeException(e.toString());
}
@@ -1314,8 +1703,9 @@ public class ClassWriter implements ClassVisitor {
/**
* Returns the constant pool's hash table item which is equal to the given
* item.
- *
- * @param key a constant pool item.
+ *
+ * @param key
+ * a constant pool item.
* @return the constant pool's hash table item which is equal to the given
* item, or <tt>null</tt> if there is no such item.
*/
@@ -1330,11 +1720,12 @@ public class ClassWriter implements ClassVisitor {
/**
* Puts the given item in the constant pool's hash table. The hash table
* <i>must</i> not already contains this item.
- *
- * @param i the item to be added to the constant pool's hash table.
+ *
+ * @param i
+ * the item to be added to the constant pool's hash table.
*/
private void put(final Item i) {
- if (index > threshold) {
+ if (index + typeCount > threshold) {
int ll = items.length;
int nl = ll * 2 + 1;
Item[] newItems = new Item[nl];
@@ -1358,12 +1749,29 @@ public class ClassWriter implements ClassVisitor {
/**
* Puts one byte and two shorts into the constant pool.
- *
- * @param b a byte.
- * @param s1 a short.
- * @param s2 another short.
+ *
+ * @param b
+ * a byte.
+ * @param s1
+ * a short.
+ * @param s2
+ * another short.
*/
private void put122(final int b, final int s1, final int s2) {
pool.put12(b, s1).putShort(s2);
}
+
+ /**
+ * Puts two bytes and one short into the constant pool.
+ *
+ * @param b1
+ * a byte.
+ * @param b2
+ * another byte.
+ * @param s
+ * a short.
+ */
+ private void put112(final int b1, final int b2, final int s) {
+ pool.put11(b1, b2).putShort(s);
+ }
}
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/Context.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/Context.java
new file mode 100644
index 0000000..71eac9f
--- /dev/null
+++ b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/Context.java
@@ -0,0 +1,146 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package org.eclipse.persistence.internal.libraries.asm;
+
+
+/**
+ * Information about a class being parsed in a {@link ClassReader}.
+ *
+ * @author Eric Bruneton
+ */
+class Context {
+
+ /**
+ * Prototypes of the attributes that must be parsed for this class.
+ */
+ Attribute[] attrs;
+
+ /**
+ * The {@link ClassReader} option flags for the parsing of this class.
+ */
+ int flags;
+
+ /**
+ * The buffer used to read strings.
+ */
+ char[] buffer;
+
+ /**
+ * The start index of each bootstrap method.
+ */
+ int[] bootstrapMethods;
+
+ /**
+ * The access flags of the method currently being parsed.
+ */
+ int access;
+
+ /**
+ * The name of the method currently being parsed.
+ */
+ String name;
+
+ /**
+ * The descriptor of the method currently being parsed.
+ */
+ String desc;
+
+ /**
+ * The label objects, indexed by bytecode offset, of the method currently
+ * being parsed (only bytecode offsets for which a label is needed have a
+ * non null associated Label object).
+ */
+ Label[] labels;
+
+ /**
+ * The target of the type annotation currently being parsed.
+ */
+ int typeRef;
+
+ /**
+ * The path of the type annotation currently being parsed.
+ */
+ TypePath typePath;
+
+ /**
+ * The offset of the latest stack map frame that has been parsed.
+ */
+ int offset;
+
+ /**
+ * The labels corresponding to the start of the local variable ranges in the
+ * local variable type annotation currently being parsed.
+ */
+ Label[] start;
+
+ /**
+ * The labels corresponding to the end of the local variable ranges in the
+ * local variable type annotation currently being parsed.
+ */
+ Label[] end;
+
+ /**
+ * The local variable indices for each local variable range in the local
+ * variable type annotation currently being parsed.
+ */
+ int[] index;
+
+ /**
+ * The encoding of the latest stack map frame that has been parsed.
+ */
+ int mode;
+
+ /**
+ * The number of locals in the latest stack map frame that has been parsed.
+ */
+ int localCount;
+
+ /**
+ * The number locals in the latest stack map frame that has been parsed,
+ * minus the number of locals in the previous frame.
+ */
+ int localDiff;
+
+ /**
+ * The local values of the latest stack map frame that has been parsed.
+ */
+ Object[] local;
+
+ /**
+ * The stack size of the latest stack map frame that has been parsed.
+ */
+ int stackCount;
+
+ /**
+ * The stack values of the latest stack map frame that has been parsed.
+ */
+ Object[] stack;
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/Edge.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/Edge.java
index 6e87d75..5520bf2 100644
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/Edge.java
+++ b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/Edge.java
@@ -1,6 +1,6 @@
/***
* ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2007 INRIA, France Telecom
+ * Copyright (c) 2000-2011 INRIA, France Telecom
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,6 +29,7 @@
*/
package org.eclipse.persistence.internal.libraries.asm;
+
/**
* An edge in the control flow graph of a method body. See {@link Label Label}.
*
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/FieldVisitor.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/FieldVisitor.java
index 4dc203a..82a2d9b 100644
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/FieldVisitor.java
+++ b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/FieldVisitor.java
@@ -1,6 +1,6 @@
/***
* ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2007 INRIA, France Telecom
+ * Copyright (c) 2000-2011 INRIA, France Telecom
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,36 +29,123 @@
*/
package org.eclipse.persistence.internal.libraries.asm;
+
/**
- * A visitor to visit a Java field. The methods of this interface must be called
- * in the following order: ( <tt>visitAnnotation</tt> |
- * <tt>visitAttribute</tt> )* <tt>visitEnd</tt>.
+ * A visitor to visit a Java field. The methods of this class must be called in
+ * the following order: ( <tt>visitAnnotation</tt> |
+ * <tt>visitTypeAnnotation</tt> | <tt>visitAttribute</tt> )* <tt>visitEnd</tt>.
*
* @author Eric Bruneton
*/
-public interface FieldVisitor {
+public abstract class FieldVisitor {
+
+ /**
+ * The ASM API version implemented by this visitor. The value of this field
+ * must be one of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}.
+ */
+ protected final int api;
+
+ /**
+ * The field visitor to which this visitor must delegate method calls. May
+ * be null.
+ */
+ protected FieldVisitor fv;
+
+ /**
+ * Constructs a new {@link FieldVisitor}.
+ *
+ * @param api
+ * the ASM API version implemented by this visitor. Must be one
+ * of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}.
+ */
+ public FieldVisitor(final int api) {
+ this(api, null);
+ }
+
+ /**
+ * Constructs a new {@link FieldVisitor}.
+ *
+ * @param api
+ * the ASM API version implemented by this visitor. Must be one
+ * of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}.
+ * @param fv
+ * the field visitor to which this visitor must delegate method
+ * calls. May be null.
+ */
+ public FieldVisitor(final int api, final FieldVisitor fv) {
+ if (api != Opcodes.ASM4 && api != Opcodes.ASM5) {
+ throw new IllegalArgumentException();
+ }
+ this.api = api;
+ this.fv = fv;
+ }
/**
* Visits an annotation of the field.
*
- * @param desc the class descriptor of the annotation class.
- * @param visible <tt>true</tt> if the annotation is visible at runtime.
+ * @param desc
+ * the class descriptor of the annotation class.
+ * @param visible
+ * <tt>true</tt> if the annotation is visible at runtime.
+ * @return a visitor to visit the annotation values, or <tt>null</tt> if
+ * this visitor is not interested in visiting this annotation.
+ */
+ public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
+ if (fv != null) {
+ return fv.visitAnnotation(desc, visible);
+ }
+ return null;
+ }
+
+ /**
+ * Visits an annotation on the type of the field.
+ *
+ * @param typeRef
+ * a reference to the annotated type. The sort of this type
+ * reference must be {@link TypeReference#FIELD FIELD}. See
+ * {@link TypeReference}.
+ * @param typePath
+ * the path to the annotated type argument, wildcard bound, array
+ * element type, or static inner type within 'typeRef'. May be
+ * <tt>null</tt> if the annotation targets 'typeRef' as a whole.
+ * @param desc
+ * the class descriptor of the annotation class.
+ * @param visible
+ * <tt>true</tt> if the annotation is visible at runtime.
* @return a visitor to visit the annotation values, or <tt>null</tt> if
* this visitor is not interested in visiting this annotation.
*/
- AnnotationVisitor visitAnnotation(String desc, boolean visible);
+ public AnnotationVisitor visitTypeAnnotation(int typeRef,
+ TypePath typePath, String desc, boolean visible) {
+ if (api < Opcodes.ASM5) {
+ throw new RuntimeException();
+ }
+ if (fv != null) {
+ return fv.visitTypeAnnotation(typeRef, typePath, desc, visible);
+ }
+ return null;
+ }
/**
* Visits a non standard attribute of the field.
*
- * @param attr an attribute.
+ * @param attr
+ * an attribute.
*/
- void visitAttribute(Attribute attr);
+ public void visitAttribute(Attribute attr) {
+ if (fv != null) {
+ fv.visitAttribute(attr);
+ }
+ }
/**
* Visits the end of the field. This method, which is the last one to be
* called, is used to inform the visitor that all the annotations and
* attributes of the field have been visited.
*/
- void visitEnd();
+ public void visitEnd() {
+ if (fv != null) {
+ fv.visitEnd();
+ }
+ }
}
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/FieldWriter.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/FieldWriter.java
index a1b504c..2129a2e 100644
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/FieldWriter.java
+++ b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/FieldWriter.java
@@ -1,6 +1,6 @@
/***
* ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2007 INRIA, France Telecom
+ * Copyright (c) 2000-2011 INRIA, France Telecom
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,17 +29,13 @@
*/
package org.eclipse.persistence.internal.libraries.asm;
+
/**
* An {@link FieldVisitor} that generates Java fields in bytecode form.
*
* @author Eric Bruneton
*/
-final class FieldWriter implements FieldVisitor {
-
- /**
- * Next field writer (see {@link ClassWriter#firstField firstField}).
- */
- FieldWriter next;
+final class FieldWriter extends FieldVisitor {
/**
* The class writer to which this field must be added.
@@ -86,6 +82,17 @@ final class FieldWriter implements FieldVisitor {
private AnnotationWriter ianns;
/**
+ * The runtime visible type annotations of this field. May be <tt>null</tt>.
+ */
+ private AnnotationWriter tanns;
+
+ /**
+ * The runtime invisible type annotations of this field. May be
+ * <tt>null</tt>.
+ */
+ private AnnotationWriter itanns;
+
+ /**
* The non standard attributes of this field. May be <tt>null</tt>.
*/
private Attribute attrs;
@@ -97,25 +104,26 @@ final class FieldWriter implements FieldVisitor {
/**
* Constructs a new {@link FieldWriter}.
*
- * @param cw the class writer to which this field must be added.
- * @param access the field's access flags (see {@link Opcodes}).
- * @param name the field's name.
- * @param desc the field's descriptor (see {@link Type}).
- * @param signature the field's signature. May be <tt>null</tt>.
- * @param value the field's constant value. May be <tt>null</tt>.
+ * @param cw
+ * the class writer to which this field must be added.
+ * @param access
+ * the field's access flags (see {@link Opcodes}).
+ * @param name
+ * the field's name.
+ * @param desc
+ * the field's descriptor (see {@link Type}).
+ * @param signature
+ * the field's signature. May be <tt>null</tt>.
+ * @param value
+ * the field's constant value. May be <tt>null</tt>.
*/
- FieldWriter(
- final ClassWriter cw,
- final int access,
- final String name,
- final String desc,
- final String signature,
- final Object value)
- {
+ FieldWriter(final ClassWriter cw, final int access, final String name,
+ final String desc, final String signature, final Object value) {
+ super(Opcodes.ASM5);
if (cw.firstField == null) {
cw.firstField = this;
} else {
- cw.lastField.next = this;
+ cw.lastField.fv = this;
}
cw.lastField = this;
this.cw = cw;
@@ -131,13 +139,12 @@ final class FieldWriter implements FieldVisitor {
}
// ------------------------------------------------------------------------
- // Implementation of the FieldVisitor interface
+ // Implementation of the FieldVisitor abstract class
// ------------------------------------------------------------------------
- public AnnotationVisitor visitAnnotation(
- final String desc,
- final boolean visible)
- {
+ @Override
+ public AnnotationVisitor visitAnnotation(final String desc,
+ final boolean visible) {
if (!ClassReader.ANNOTATIONS) {
return null;
}
@@ -155,11 +162,36 @@ final class FieldWriter implements FieldVisitor {
return aw;
}
+ @Override
+ public AnnotationVisitor visitTypeAnnotation(final int typeRef,
+ final TypePath typePath, final String desc, final boolean visible) {
+ if (!ClassReader.ANNOTATIONS) {
+ return null;
+ }
+ ByteVector bv = new ByteVector();
+ // write target_type and target_info
+ AnnotationWriter.putTarget(typeRef, typePath, bv);
+ // write type, and reserve space for values count
+ bv.putShort(cw.newUTF8(desc)).putShort(0);
+ AnnotationWriter aw = new AnnotationWriter(cw, true, bv, bv,
+ bv.length - 2);
+ if (visible) {
+ aw.next = tanns;
+ tanns = aw;
+ } else {
+ aw.next = itanns;
+ itanns = aw;
+ }
+ return aw;
+ }
+
+ @Override
public void visitAttribute(final Attribute attr) {
attr.next = attrs;
attrs = attr;
}
+ @Override
public void visitEnd() {
}
@@ -178,11 +210,12 @@ final class FieldWriter implements FieldVisitor {
cw.newUTF8("ConstantValue");
size += 8;
}
- if ((access & Opcodes.ACC_SYNTHETIC) != 0
- && ((cw.version & 0xFFFF) < Opcodes.V1_5 || (access & ClassWriter.ACC_SYNTHETIC_ATTRIBUTE) != 0))
- {
- cw.newUTF8("Synthetic");
- size += 6;
+ if ((access & Opcodes.ACC_SYNTHETIC) != 0) {
+ if ((cw.version & 0xFFFF) < Opcodes.V1_5
+ || (access & ClassWriter.ACC_SYNTHETIC_ATTRIBUTE) != 0) {
+ cw.newUTF8("Synthetic");
+ size += 6;
+ }
}
if ((access & Opcodes.ACC_DEPRECATED) != 0) {
cw.newUTF8("Deprecated");
@@ -200,6 +233,14 @@ final class FieldWriter implements FieldVisitor {
cw.newUTF8("RuntimeInvisibleAnnotations");
size += 8 + ianns.getSize();
}
+ if (ClassReader.ANNOTATIONS && tanns != null) {
+ cw.newUTF8("RuntimeVisibleTypeAnnotations");
+ size += 8 + tanns.getSize();
+ }
+ if (ClassReader.ANNOTATIONS && itanns != null) {
+ cw.newUTF8("RuntimeInvisibleTypeAnnotations");
+ size += 8 + itanns.getSize();
+ }
if (attrs != null) {
size += attrs.getSize(cw, null, 0, -1, -1);
}
@@ -209,21 +250,23 @@ final class FieldWriter implements FieldVisitor {
/**
* Puts the content of this field into the given byte vector.
*
- * @param out where the content of this field must be put.
+ * @param out
+ * where the content of this field must be put.
*/
void put(final ByteVector out) {
- int mask = Opcodes.ACC_DEPRECATED
- | ClassWriter.ACC_SYNTHETIC_ATTRIBUTE
- | ((access & ClassWriter.ACC_SYNTHETIC_ATTRIBUTE) / (ClassWriter.ACC_SYNTHETIC_ATTRIBUTE / Opcodes.ACC_SYNTHETIC));
+ final int FACTOR = ClassWriter.TO_ACC_SYNTHETIC;
+ int mask = Opcodes.ACC_DEPRECATED | ClassWriter.ACC_SYNTHETIC_ATTRIBUTE
+ | ((access & ClassWriter.ACC_SYNTHETIC_ATTRIBUTE) / FACTOR);
out.putShort(access & ~mask).putShort(name).putShort(desc);
int attributeCount = 0;
if (value != 0) {
++attributeCount;
}
- if ((access & Opcodes.ACC_SYNTHETIC) != 0
- && ((cw.version & 0xFFFF) < Opcodes.V1_5 || (access & ClassWriter.ACC_SYNTHETIC_ATTRIBUTE) != 0))
- {
- ++attributeCount;
+ if ((access & Opcodes.ACC_SYNTHETIC) != 0) {
+ if ((cw.version & 0xFFFF) < Opcodes.V1_5
+ || (access & ClassWriter.ACC_SYNTHETIC_ATTRIBUTE) != 0) {
+ ++attributeCount;
+ }
}
if ((access & Opcodes.ACC_DEPRECATED) != 0) {
++attributeCount;
@@ -237,6 +280,12 @@ final class FieldWriter implements FieldVisitor {
if (ClassReader.ANNOTATIONS && ianns != null) {
++attributeCount;
}
+ if (ClassReader.ANNOTATIONS && tanns != null) {
+ ++attributeCount;
+ }
+ if (ClassReader.ANNOTATIONS && itanns != null) {
+ ++attributeCount;
+ }
if (attrs != null) {
attributeCount += attrs.getCount();
}
@@ -245,10 +294,11 @@ final class FieldWriter implements FieldVisitor {
out.putShort(cw.newUTF8("ConstantValue"));
out.putInt(2).putShort(value);
}
- if ((access & Opcodes.ACC_SYNTHETIC) != 0
- && ((cw.version & 0xFFFF) < Opcodes.V1_5 || (access & ClassWriter.ACC_SYNTHETIC_ATTRIBUTE) != 0))
- {
- out.putShort(cw.newUTF8("Synthetic")).putInt(0);
+ if ((access & Opcodes.ACC_SYNTHETIC) != 0) {
+ if ((cw.version & 0xFFFF) < Opcodes.V1_5
+ || (access & ClassWriter.ACC_SYNTHETIC_ATTRIBUTE) != 0) {
+ out.putShort(cw.newUTF8("Synthetic")).putInt(0);
+ }
}
if ((access & Opcodes.ACC_DEPRECATED) != 0) {
out.putShort(cw.newUTF8("Deprecated")).putInt(0);
@@ -265,6 +315,14 @@ final class FieldWriter implements FieldVisitor {
out.putShort(cw.newUTF8("RuntimeInvisibleAnnotations"));
ianns.put(out);
}
+ if (ClassReader.ANNOTATIONS && tanns != null) {
+ out.putShort(cw.newUTF8("RuntimeVisibleTypeAnnotations"));
+ tanns.put(out);
+ }
+ if (ClassReader.ANNOTATIONS && itanns != null) {
+ out.putShort(cw.newUTF8("RuntimeInvisibleTypeAnnotations"));
+ itanns.put(out);
+ }
if (attrs != null) {
attrs.put(cw, null, 0, -1, -1, out);
}
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/Frame.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/Frame.java
index 3389b1e..cbd16ec 100644
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/Frame.java
+++ b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/Frame.java
@@ -1,6 +1,6 @@
/***
* ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2007 INRIA, France Telecom
+ * Copyright (c) 2000-2011 INRIA, France Telecom
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,6 +29,7 @@
*/
package org.eclipse.persistence.internal.libraries.asm;
+
/**
* Information about the input and output stack map frames of a basic block.
*
@@ -70,8 +71,8 @@ final class Frame {
* stack types. VALUE depends on KIND. For LOCAL types, it is an index in
* the input local variable types. For STACK types, it is a position
* relatively to the top of input frame stack. For BASE types, it is either
- * one of the constants defined in FrameVisitor, or for OBJECT and
- * UNINITIALIZED types, a tag and an index in the type table.
+ * one of the constants defined below, or for OBJECT and UNINITIALIZED
+ * types, a tag and an index in the type table.
*
* Output frames can contain types of any kind and with a positive or
* negative dimension (and even unassigned types, represented by 0 - which
@@ -80,13 +81,13 @@ final class Frame {
* table contains only internal type names (array type descriptors are
* forbidden - dimensions must be represented through the DIM field).
*
- * The LONG and DOUBLE types are always represented by using two slots (LONG +
- * TOP or DOUBLE + TOP), for local variable types as well as in the operand
- * stack. This is necessary to be able to simulate DUPx_y instructions,
- * whose effect would be dependent on the actual type values if types were
- * always represented by a single slot in the stack (and this is not
- * possible, since actual type values are not always known - cf LOCAL and
- * STACK type kinds).
+ * The LONG and DOUBLE types are always represented by using two slots (LONG
+ * + TOP or DOUBLE + TOP), for local variable types as well as in the
+ * operand stack. This is necessary to be able to simulate DUPx_y
+ * instructions, whose effect would be dependent on the actual type values
+ * if types were always represented by a single slot in the stack (and this
+ * is not possible, since actual type values are not always known - cf LOCAL
+ * and STACK type kinds).
*/
/**
@@ -116,10 +117,10 @@ final class Frame {
/**
* Flag used for LOCAL and STACK types. Indicates that if this type happens
- * to be a long or double type (during the computations of input frames),
- * then it must be set to TOP because the second word of this value has
- * been reused to store other data in the basic block. Hence the first word
- * no longer stores a valid long or double value.
+ * to be a long or double type (during the computations of input frames),
+ * then it must be set to TOP because the second word of this value has been
+ * reused to store other data in the basic block. Hence the first word no
+ * longer stores a valid long or double value.
*/
static final int TOP_IF_LONG_OR_DOUBLE = 0x800000;
@@ -437,7 +438,7 @@ final class Frame {
// NA, //INVOKESPECIAL, // -
// NA, //INVOKESTATIC, // -
// NA, //INVOKEINTERFACE, // -
- // NA, //INVOKEDYNAMIC, // -
+ // NA, //INVOKEDYNAMIC, // visitInvokeDynamicInsn
// 1, //NEW, // visitTypeInsn
// 0, //NEWARRAY, // visitIntInsn
// 0, //ANEWARRAY, // visitTypeInsn
@@ -523,7 +524,8 @@ final class Frame {
/**
* Returns the output frame local variable type at the given index.
*
- * @param local the index of the local that must be returned.
+ * @param local
+ * the index of the local that must be returned.
* @return the output frame local variable type at the given index.
*/
private int get(final int local) {
@@ -545,8 +547,10 @@ final class Frame {
/**
* Sets the output frame local variable type at the given index.
*
- * @param local the index of the local that must be set.
- * @param type the value of the local that must be set.
+ * @param local
+ * the index of the local that must be set.
+ * @param type
+ * the value of the local that must be set.
*/
private void set(final int local, final int type) {
// creates and/or resizes the output local variables array if necessary
@@ -566,7 +570,8 @@ final class Frame {
/**
* Pushes a new type onto the output frame stack.
*
- * @param type the type that must be pushed.
+ * @param type
+ * the type that must be pushed.
*/
private void push(final int type) {
// creates and/or resizes the output stack array if necessary
@@ -591,10 +596,12 @@ final class Frame {
/**
* Pushes a new type onto the output frame stack.
*
- * @param cw the ClassWriter to which this label belongs.
- * @param desc the descriptor of the type to be pushed. Can also be a method
- * descriptor (in this case this method pushes its return type onto
- * the output frame stack).
+ * @param cw
+ * the ClassWriter to which this label belongs.
+ * @param desc
+ * the descriptor of the type to be pushed. Can also be a method
+ * descriptor (in this case this method pushes its return type
+ * onto the output frame stack).
*/
private void push(final ClassWriter cw, final String desc) {
int type = type(cw, desc);
@@ -609,72 +616,74 @@ final class Frame {
/**
* Returns the int encoding of the given type.
*
- * @param cw the ClassWriter to which this label belongs.
- * @param desc a type descriptor.
+ * @param cw
+ * the ClassWriter to which this label belongs.
+ * @param desc
+ * a type descriptor.
* @return the int encoding of the given type.
*/
private static int type(final ClassWriter cw, final String desc) {
String t;
int index = desc.charAt(0) == '(' ? desc.indexOf(')') + 1 : 0;
switch (desc.charAt(index)) {
- case 'V':
- return 0;
+ case 'V':
+ return 0;
+ case 'Z':
+ case 'C':
+ case 'B':
+ case 'S':
+ case 'I':
+ return INTEGER;
+ case 'F':
+ return FLOAT;
+ case 'J':
+ return LONG;
+ case 'D':
+ return DOUBLE;
+ case 'L':
+ // stores the internal name, not the descriptor!
+ t = desc.substring(index + 1, desc.length() - 1);
+ return OBJECT | cw.addType(t);
+ // case '[':
+ default:
+ // extracts the dimensions and the element type
+ int data;
+ int dims = index + 1;
+ while (desc.charAt(dims) == '[') {
+ ++dims;
+ }
+ switch (desc.charAt(dims)) {
case 'Z':
+ data = BOOLEAN;
+ break;
case 'C':
+ data = CHAR;
+ break;
case 'B':
+ data = BYTE;
+ break;
case 'S':
+ data = SHORT;
+ break;
case 'I':
- return INTEGER;
+ data = INTEGER;
+ break;
case 'F':
- return FLOAT;
+ data = FLOAT;
+ break;
case 'J':
- return LONG;
+ data = LONG;
+ break;
case 'D':
- return DOUBLE;
- case 'L':
- // stores the internal name, not the descriptor!
- t = desc.substring(index + 1, desc.length() - 1);
- return OBJECT | cw.addType(t);
- // case '[':
+ data = DOUBLE;
+ break;
+ // case 'L':
default:
- // extracts the dimensions and the element type
- int data;
- int dims = index + 1;
- while (desc.charAt(dims) == '[') {
- ++dims;
- }
- switch (desc.charAt(dims)) {
- case 'Z':
- data = BOOLEAN;
- break;
- case 'C':
- data = CHAR;
- break;
- case 'B':
- data = BYTE;
- break;
- case 'S':
- data = SHORT;
- break;
- case 'I':
- data = INTEGER;
- break;
- case 'F':
- data = FLOAT;
- break;
- case 'J':
- data = LONG;
- break;
- case 'D':
- data = DOUBLE;
- break;
- // case 'L':
- default:
- // stores the internal name, not the descriptor
- t = desc.substring(dims + 1, desc.length() - 1);
- data = OBJECT | cw.addType(t);
- }
- return (dims - index) << 28 | data;
+ // stores the internal name, not the descriptor
+ t = desc.substring(dims + 1, desc.length() - 1);
+ data = OBJECT | cw.addType(t);
+ }
+ return (dims - index) << 28 | data;
}
}
@@ -695,7 +704,8 @@ final class Frame {
/**
* Pops the given number of types from the output frame stack.
*
- * @param elements the number of types that must be popped.
+ * @param elements
+ * the number of types that must be popped.
*/
private void pop(final int elements) {
if (outputStackTop >= elements) {
@@ -712,9 +722,10 @@ final class Frame {
/**
* Pops a type from the output frame stack.
*
- * @param desc the descriptor of the type to be popped. Can also be a method
- * descriptor (in this case this method pops the types corresponding
- * to the method arguments).
+ * @param desc
+ * the descriptor of the type to be popped. Can also be a method
+ * descriptor (in this case this method pops the types
+ * corresponding to the method arguments).
*/
private void pop(final String desc) {
char c = desc.charAt(0);
@@ -731,7 +742,8 @@ final class Frame {
* Adds a new type to the list of types on which a constructor is invoked in
* the basic block.
*
- * @param var a type on a which a constructor is invoked.
+ * @param var
+ * a type on a which a constructor is invoked.
*/
private void init(final int var) {
// creates and/or resizes the initializations array if necessary
@@ -752,8 +764,10 @@ final class Frame {
* Replaces the given type with the appropriate type if it is one of the
* types on which a constructor is invoked in the basic block.
*
- * @param cw the ClassWriter to which this label belongs.
- * @param t a type
+ * @param cw
+ * the ClassWriter to which this label belongs.
+ * @param t
+ * a type
* @return t or, if t is one of the types on which a constructor is invoked
* in the basic block, the type corresponding to this constructor.
*/
@@ -787,17 +801,17 @@ final class Frame {
* Initializes the input frame of the first basic block from the method
* descriptor.
*
- * @param cw the ClassWriter to which this label belongs.
- * @param access the access flags of the method to which this label belongs.
- * @param args the formal parameter types of this method.
- * @param maxLocals the maximum number of local variables of this method.
+ * @param cw
+ * the ClassWriter to which this label belongs.
+ * @param access
+ * the access flags of the method to which this label belongs.
+ * @param args
+ * the formal parameter types of this method.
+ * @param maxLocals
+ * the maximum number of local variables of this method.
*/
- void initInputFrame(
- final ClassWriter cw,
- final int access,
- final Type[] args,
- final int maxLocals)
- {
+ void initInputFrame(final ClassWriter cw, final int access,
+ final Type[] args, final int maxLocals) {
inputLocals = new int[maxLocals];
inputStack = new int[0];
int i = 0;
@@ -823,429 +837,435 @@ final class Frame {
/**
* Simulates the action of the given instruction on the output stack frame.
*
- * @param opcode the opcode of the instruction.
- * @param arg the operand of the instruction, if any.
- * @param cw the class writer to which this label belongs.
- * @param item the operand of the instructions, if any.
+ * @param opcode
+ * the opcode of the instruction.
+ * @param arg
+ * the operand of the instruction, if any.
+ * @param cw
+ * the class writer to which this label belongs.
+ * @param item
+ * the operand of the instructions, if any.
*/
- void execute(
- final int opcode,
- final int arg,
- final ClassWriter cw,
- final Item item)
- {
+ void execute(final int opcode, final int arg, final ClassWriter cw,
+ final Item item) {
int t1, t2, t3, t4;
switch (opcode) {
- case Opcodes.NOP:
- case Opcodes.INEG:
- case Opcodes.LNEG:
- case Opcodes.FNEG:
- case Opcodes.DNEG:
- case Opcodes.I2B:
- case Opcodes.I2C:
- case Opcodes.I2S:
- case Opcodes.GOTO:
- case Opcodes.RETURN:
- break;
- case Opcodes.ACONST_NULL:
- push(NULL);
- break;
- case Opcodes.ICONST_M1:
- case Opcodes.ICONST_0:
- case Opcodes.ICONST_1:
- case Opcodes.ICONST_2:
- case Opcodes.ICONST_3:
- case Opcodes.ICONST_4:
- case Opcodes.ICONST_5:
- case Opcodes.BIPUSH:
- case Opcodes.SIPUSH:
- case Opcodes.ILOAD:
+ case Opcodes.NOP:
+ case Opcodes.INEG:
+ case Opcodes.LNEG:
+ case Opcodes.FNEG:
+ case Opcodes.DNEG:
+ case Opcodes.I2B:
+ case Opcodes.I2C:
+ case Opcodes.I2S:
+ case Opcodes.GOTO:
+ case Opcodes.RETURN:
+ break;
+ case Opcodes.ACONST_NULL:
+ push(NULL);
+ break;
+ case Opcodes.ICONST_M1:
+ case Opcodes.ICONST_0:
+ case Opcodes.ICONST_1:
+ case Opcodes.ICONST_2:
+ case Opcodes.ICONST_3:
+ case Opcodes.ICONST_4:
+ case Opcodes.ICONST_5:
+ case Opcodes.BIPUSH:
+ case Opcodes.SIPUSH:
+ case Opcodes.ILOAD:
+ push(INTEGER);
+ break;
+ case Opcodes.LCONST_0:
+ case Opcodes.LCONST_1:
+ case Opcodes.LLOAD:
+ push(LONG);
+ push(TOP);
+ break;
+ case Opcodes.FCONST_0:
+ case Opcodes.FCONST_1:
+ case Opcodes.FCONST_2:
+ case Opcodes.FLOAD:
+ push(FLOAT);
+ break;
+ case Opcodes.DCONST_0:
+ case Opcodes.DCONST_1:
+ case Opcodes.DLOAD:
+ push(DOUBLE);
+ push(TOP);
+ break;
+ case Opcodes.LDC:
+ switch (item.type) {
+ case ClassWriter.INT:
push(INTEGER);
break;
- case Opcodes.LCONST_0:
- case Opcodes.LCONST_1:
- case Opcodes.LLOAD:
+ case ClassWriter.LONG:
push(LONG);
push(TOP);
break;
- case Opcodes.FCONST_0:
- case Opcodes.FCONST_1:
- case Opcodes.FCONST_2:
- case Opcodes.FLOAD:
+ case ClassWriter.FLOAT:
push(FLOAT);
break;
- case Opcodes.DCONST_0:
- case Opcodes.DCONST_1:
- case Opcodes.DLOAD:
+ case ClassWriter.DOUBLE:
push(DOUBLE);
push(TOP);
break;
- case Opcodes.LDC:
- switch (item.type) {
- case ClassWriter.INT:
- push(INTEGER);
- break;
- case ClassWriter.LONG:
- push(LONG);
- push(TOP);
- break;
- case ClassWriter.FLOAT:
- push(FLOAT);
- break;
- case ClassWriter.DOUBLE:
- push(DOUBLE);
- push(TOP);
- break;
- case ClassWriter.CLASS:
- push(OBJECT | cw.addType("java/lang/Class"));
- break;
- // case ClassWriter.STR:
- default:
- push(OBJECT | cw.addType("java/lang/String"));
- }
- break;
- case Opcodes.ALOAD:
- push(get(arg));
- break;
- case Opcodes.IALOAD:
- case Opcodes.BALOAD:
- case Opcodes.CALOAD:
- case Opcodes.SALOAD:
- pop(2);
- push(INTEGER);
- break;
- case Opcodes.LALOAD:
- case Opcodes.D2L:
- pop(2);
- push(LONG);
- push(TOP);
- break;
- case Opcodes.FALOAD:
- pop(2);
- push(FLOAT);
+ case ClassWriter.CLASS:
+ push(OBJECT | cw.addType("java/lang/Class"));
break;
- case Opcodes.DALOAD:
- case Opcodes.L2D:
- pop(2);
- push(DOUBLE);
- push(TOP);
+ case ClassWriter.STR:
+ push(OBJECT | cw.addType("java/lang/String"));
break;
- case Opcodes.AALOAD:
- pop(1);
- t1 = pop();
- push(ELEMENT_OF + t1);
+ case ClassWriter.MTYPE:
+ push(OBJECT | cw.addType("java/lang/invoke/MethodType"));
break;
- case Opcodes.ISTORE:
- case Opcodes.FSTORE:
- case Opcodes.ASTORE:
- t1 = pop();
- set(arg, t1);
- if (arg > 0) {
- t2 = get(arg - 1);
- // if t2 is of kind STACK or LOCAL we cannot know its size!
- if (t2 == LONG || t2 == DOUBLE) {
- set(arg - 1, TOP);
- } else if ((t2 & KIND) != BASE) {
- set(arg - 1, t2 | TOP_IF_LONG_OR_DOUBLE);
- }
+ // case ClassWriter.HANDLE_BASE + [1..9]:
+ default:
+ push(OBJECT | cw.addType("java/lang/invoke/MethodHandle"));
+ }
+ break;
+ case Opcodes.ALOAD:
+ push(get(arg));
+ break;
+ case Opcodes.IALOAD:
+ case Opcodes.BALOAD:
+ case Opcodes.CALOAD:
+ case Opcodes.SALOAD:
+ pop(2);
+ push(INTEGER);
+ break;
+ case Opcodes.LALOAD:
+ case Opcodes.D2L:
+ pop(2);
+ push(LONG);
+ push(TOP);
+ break;
+ case Opcodes.FALOAD:
+ pop(2);
+ push(FLOAT);
+ break;
+ case Opcodes.DALOAD:
+ case Opcodes.L2D:
+ pop(2);
+ push(DOUBLE);
+ push(TOP);
+ break;
+ case Opcodes.AALOAD:
+ pop(1);
+ t1 = pop();
+ push(ELEMENT_OF + t1);
+ break;
+ case Opcodes.ISTORE:
+ case Opcodes.FSTORE:
+ case Opcodes.ASTORE:
+ t1 = pop();
+ set(arg, t1);
+ if (arg > 0) {
+ t2 = get(arg - 1);
+ // if t2 is of kind STACK or LOCAL we cannot know its size!
+ if (t2 == LONG || t2 == DOUBLE) {
+ set(arg - 1, TOP);
+ } else if ((t2 & KIND) != BASE) {
+ set(arg - 1, t2 | TOP_IF_LONG_OR_DOUBLE);
}
- break;
- case Opcodes.LSTORE:
- case Opcodes.DSTORE:
- pop(1);
- t1 = pop();
- set(arg, t1);
- set(arg + 1, TOP);
- if (arg > 0) {
- t2 = get(arg - 1);
- // if t2 is of kind STACK or LOCAL we cannot know its size!
- if (t2 == LONG || t2 == DOUBLE) {
- set(arg - 1, TOP);
- } else if ((t2 & KIND) != BASE) {
- set(arg - 1, t2 | TOP_IF_LONG_OR_DOUBLE);
- }
+ }
+ break;
+ case Opcodes.LSTORE:
+ case Opcodes.DSTORE:
+ pop(1);
+ t1 = pop();
+ set(arg, t1);
+ set(arg + 1, TOP);
+ if (arg > 0) {
+ t2 = get(arg - 1);
+ // if t2 is of kind STACK or LOCAL we cannot know its size!
+ if (t2 == LONG || t2 == DOUBLE) {
+ set(arg - 1, TOP);
+ } else if ((t2 & KIND) != BASE) {
+ set(arg - 1, t2 | TOP_IF_LONG_OR_DOUBLE);
}
- break;
- case Opcodes.IASTORE:
- case Opcodes.BASTORE:
- case Opcodes.CASTORE:
- case Opcodes.SASTORE:
- case Opcodes.FASTORE:
- case Opcodes.AASTORE:
- pop(3);
- break;
- case Opcodes.LASTORE:
- case Opcodes.DASTORE:
- pop(4);
- break;
- case Opcodes.POP:
- case Opcodes.IFEQ:
- case Opcodes.IFNE:
- case Opcodes.IFLT:
- case Opcodes.IFGE:
- case Opcodes.IFGT:
- case Opcodes.IFLE:
- case Opcodes.IRETURN:
- case Opcodes.FRETURN:
- case Opcodes.ARETURN:
- case Opcodes.TABLESWITCH:
- case Opcodes.LOOKUPSWITCH:
- case Opcodes.ATHROW:
- case Opcodes.MONITORENTER:
- case Opcodes.MONITOREXIT:
- case Opcodes.IFNULL:
- case Opcodes.IFNONNULL:
- pop(1);
- break;
- case Opcodes.POP2:
- case Opcodes.IF_ICMPEQ:
- case Opcodes.IF_ICMPNE:
- case Opcodes.IF_ICMPLT:
- case Opcodes.IF_ICMPGE:
- case Opcodes.IF_ICMPGT:
- case Opcodes.IF_ICMPLE:
- case Opcodes.IF_ACMPEQ:
- case Opcodes.IF_ACMPNE:
- case Opcodes.LRETURN:
- case Opcodes.DRETURN:
- pop(2);
- break;
- case Opcodes.DUP:
- t1 = pop();
- push(t1);
- push(t1);
- break;
- case Opcodes.DUP_X1:
- t1 = pop();
- t2 = pop();
- push(t1);
- push(t2);
- push(t1);
- break;
- case Opcodes.DUP_X2:
- t1 = pop();
- t2 = pop();
- t3 = pop();
- push(t1);
- push(t3);
- push(t2);
- push(t1);
- break;
- case Opcodes.DUP2:
- t1 = pop();
- t2 = pop();
- push(t2);
- push(t1);
- push(t2);
- push(t1);
- break;
- case Opcodes.DUP2_X1:
- t1 = pop();
- t2 = pop();
- t3 = pop();
- push(t2);
- push(t1);
- push(t3);
- push(t2);
- push(t1);
- break;
- case Opcodes.DUP2_X2:
- t1 = pop();
- t2 = pop();
- t3 = pop();
- t4 = pop();
- push(t2);
- push(t1);
- push(t4);
- push(t3);
- push(t2);
- push(t1);
- break;
- case Opcodes.SWAP:
+ }
+ break;
+ case Opcodes.IASTORE:
+ case Opcodes.BASTORE:
+ case Opcodes.CASTORE:
+ case Opcodes.SASTORE:
+ case Opcodes.FASTORE:
+ case Opcodes.AASTORE:
+ pop(3);
+ break;
+ case Opcodes.LASTORE:
+ case Opcodes.DASTORE:
+ pop(4);
+ break;
+ case Opcodes.POP:
+ case Opcodes.IFEQ:
+ case Opcodes.IFNE:
+ case Opcodes.IFLT:
+ case Opcodes.IFGE:
+ case Opcodes.IFGT:
+ case Opcodes.IFLE:
+ case Opcodes.IRETURN:
+ case Opcodes.FRETURN:
+ case Opcodes.ARETURN:
+ case Opcodes.TABLESWITCH:
+ case Opcodes.LOOKUPSWITCH:
+ case Opcodes.ATHROW:
+ case Opcodes.MONITORENTER:
+ case Opcodes.MONITOREXIT:
+ case Opcodes.IFNULL:
+ case Opcodes.IFNONNULL:
+ pop(1);
+ break;
+ case Opcodes.POP2:
+ case Opcodes.IF_ICMPEQ:
+ case Opcodes.IF_ICMPNE:
+ case Opcodes.IF_ICMPLT:
+ case Opcodes.IF_ICMPGE:
+ case Opcodes.IF_ICMPGT:
+ case Opcodes.IF_ICMPLE:
+ case Opcodes.IF_ACMPEQ:
+ case Opcodes.IF_ACMPNE:
+ case Opcodes.LRETURN:
+ case Opcodes.DRETURN:
+ pop(2);
+ break;
+ case Opcodes.DUP:
+ t1 = pop();
+ push(t1);
+ push(t1);
+ break;
+ case Opcodes.DUP_X1:
+ t1 = pop();
+ t2 = pop();
+ push(t1);
+ push(t2);
+ push(t1);
+ break;
+ case Opcodes.DUP_X2:
+ t1 = pop();
+ t2 = pop();
+ t3 = pop();
+ push(t1);
+ push(t3);
+ push(t2);
+ push(t1);
+ break;
+ case Opcodes.DUP2:
+ t1 = pop();
+ t2 = pop();
+ push(t2);
+ push(t1);
+ push(t2);
+ push(t1);
+ break;
+ case Opcodes.DUP2_X1:
+ t1 = pop();
+ t2 = pop();
+ t3 = pop();
+ push(t2);
+ push(t1);
+ push(t3);
+ push(t2);
+ push(t1);
+ break;
+ case Opcodes.DUP2_X2:
+ t1 = pop();
+ t2 = pop();
+ t3 = pop();
+ t4 = pop();
+ push(t2);
+ push(t1);
+ push(t4);
+ push(t3);
+ push(t2);
+ push(t1);
+ break;
+ case Opcodes.SWAP:
+ t1 = pop();
+ t2 = pop();
+ push(t1);
+ push(t2);
+ break;
+ case Opcodes.IADD:
+ case Opcodes.ISUB:
+ case Opcodes.IMUL:
+ case Opcodes.IDIV:
+ case Opcodes.IREM:
+ case Opcodes.IAND:
+ case Opcodes.IOR:
+ case Opcodes.IXOR:
+ case Opcodes.ISHL:
+ case Opcodes.ISHR:
+ case Opcodes.IUSHR:
+ case Opcodes.L2I:
+ case Opcodes.D2I:
+ case Opcodes.FCMPL:
+ case Opcodes.FCMPG:
+ pop(2);
+ push(INTEGER);
+ break;
+ case Opcodes.LADD:
+ case Opcodes.LSUB:
+ case Opcodes.LMUL:
+ case Opcodes.LDIV:
+ case Opcodes.LREM:
+ case Opcodes.LAND:
+ case Opcodes.LOR:
+ case Opcodes.LXOR:
+ pop(4);
+ push(LONG);
+ push(TOP);
+ break;
+ case Opcodes.FADD:
+ case Opcodes.FSUB:
+ case Opcodes.FMUL:
+ case Opcodes.FDIV:
+ case Opcodes.FREM:
+ case Opcodes.L2F:
+ case Opcodes.D2F:
+ pop(2);
+ push(FLOAT);
+ break;
+ case Opcodes.DADD:
+ case Opcodes.DSUB:
+ case Opcodes.DMUL:
+ case Opcodes.DDIV:
+ case Opcodes.DREM:
+ pop(4);
+ push(DOUBLE);
+ push(TOP);
+ break;
+ case Opcodes.LSHL:
+ case Opcodes.LSHR:
+ case Opcodes.LUSHR:
+ pop(3);
+ push(LONG);
+ push(TOP);
+ break;
+ case Opcodes.IINC:
+ set(arg, INTEGER);
+ break;
+ case Opcodes.I2L:
+ case Opcodes.F2L:
+ pop(1);
+ push(LONG);
+ push(TOP);
+ break;
+ case Opcodes.I2F:
+ pop(1);
+ push(FLOAT);
+ break;
+ case Opcodes.I2D:
+ case Opcodes.F2D:
+ pop(1);
+ push(DOUBLE);
+ push(TOP);
+ break;
+ case Opcodes.F2I:
+ case Opcodes.ARRAYLENGTH:
+ case Opcodes.INSTANCEOF:
+ pop(1);
+ push(INTEGER);
+ break;
+ case Opcodes.LCMP:
+ case Opcodes.DCMPL:
+ case Opcodes.DCMPG:
+ pop(4);
+ push(INTEGER);
+ break;
+ case Opcodes.JSR:
+ case Opcodes.RET:
+ throw new RuntimeException(
+ "JSR/RET are not supported with computeFrames option");
+ case Opcodes.GETSTATIC:
+ push(cw, item.strVal3);
+ break;
+ case Opcodes.PUTSTATIC:
+ pop(item.strVal3);
+ break;
+ case Opcodes.GETFIELD:
+ pop(1);
+ push(cw, item.strVal3);
+ break;
+ case Opcodes.PUTFIELD:
+ pop(item.strVal3);
+ pop();
+ break;
+ case Opcodes.INVOKEVIRTUAL:
+ case Opcodes.INVOKESPECIAL:
+ case Opcodes.INVOKESTATIC:
+ case Opcodes.INVOKEINTERFACE:
+ pop(item.strVal3);
+ if (opcode != Opcodes.INVOKESTATIC) {
t1 = pop();
- t2 = pop();
- push(t1);
- push(t2);
- break;
- case Opcodes.IADD:
- case Opcodes.ISUB:
- case Opcodes.IMUL:
- case Opcodes.IDIV:
- case Opcodes.IREM:
- case Opcodes.IAND:
- case Opcodes.IOR:
- case Opcodes.IXOR:
- case Opcodes.ISHL:
- case Opcodes.ISHR:
- case Opcodes.IUSHR:
- case Opcodes.L2I:
- case Opcodes.D2I:
- case Opcodes.FCMPL:
- case Opcodes.FCMPG:
- pop(2);
- push(INTEGER);
- break;
- case Opcodes.LADD:
- case Opcodes.LSUB:
- case Opcodes.LMUL:
- case Opcodes.LDIV:
- case Opcodes.LREM:
- case Opcodes.LAND:
- case Opcodes.LOR:
- case Opcodes.LXOR:
- pop(4);
- push(LONG);
- push(TOP);
- break;
- case Opcodes.FADD:
- case Opcodes.FSUB:
- case Opcodes.FMUL:
- case Opcodes.FDIV:
- case Opcodes.FREM:
- case Opcodes.L2F:
- case Opcodes.D2F:
- pop(2);
- push(FLOAT);
- break;
- case Opcodes.DADD:
- case Opcodes.DSUB:
- case Opcodes.DMUL:
- case Opcodes.DDIV:
- case Opcodes.DREM:
- pop(4);
- push(DOUBLE);
- push(TOP);
- break;
- case Opcodes.LSHL:
- case Opcodes.LSHR:
- case Opcodes.LUSHR:
- pop(3);
- push(LONG);
- push(TOP);
- break;
- case Opcodes.IINC:
- set(arg, INTEGER);
- break;
- case Opcodes.I2L:
- case Opcodes.F2L:
- pop(1);
- push(LONG);
- push(TOP);
- break;
- case Opcodes.I2F:
- pop(1);
- push(FLOAT);
- break;
- case Opcodes.I2D:
- case Opcodes.F2D:
- pop(1);
- push(DOUBLE);
- push(TOP);
- break;
- case Opcodes.F2I:
- case Opcodes.ARRAYLENGTH:
- case Opcodes.INSTANCEOF:
- pop(1);
- push(INTEGER);
- break;
- case Opcodes.LCMP:
- case Opcodes.DCMPL:
- case Opcodes.DCMPG:
- pop(4);
- push(INTEGER);
- break;
- case Opcodes.JSR:
- case Opcodes.RET:
- throw new RuntimeException("JSR/RET are not supported with computeFrames option");
- case Opcodes.GETSTATIC:
- push(cw, item.strVal3);
- break;
- case Opcodes.PUTSTATIC:
- pop(item.strVal3);
- break;
- case Opcodes.GETFIELD:
- pop(1);
- push(cw, item.strVal3);
- break;
- case Opcodes.PUTFIELD:
- pop(item.strVal3);
- pop();
- break;
- case Opcodes.INVOKEVIRTUAL:
- case Opcodes.INVOKESPECIAL:
- case Opcodes.INVOKESTATIC:
- case Opcodes.INVOKEINTERFACE:
- pop(item.strVal3);
- if (opcode != Opcodes.INVOKESTATIC) {
- t1 = pop();
- if (opcode == Opcodes.INVOKESPECIAL
- && item.strVal2.charAt(0) == '<')
- {
- init(t1);
- }
+ if (opcode == Opcodes.INVOKESPECIAL
+ && item.strVal2.charAt(0) == '<') {
+ init(t1);
}
- push(cw, item.strVal3);
+ }
+ push(cw, item.strVal3);
+ break;
+ case Opcodes.INVOKEDYNAMIC:
+ pop(item.strVal2);
+ push(cw, item.strVal2);
+ break;
+ case Opcodes.NEW:
+ push(UNINITIALIZED | cw.addUninitializedType(item.strVal1, arg));
+ break;
+ case Opcodes.NEWARRAY:
+ pop();
+ switch (arg) {
+ case Opcodes.T_BOOLEAN:
+ push(ARRAY_OF | BOOLEAN);
break;
- case Opcodes.INVOKEDYNAMIC:
- pop(item.strVal2);
- push(cw, item.strVal2);
+ case Opcodes.T_CHAR:
+ push(ARRAY_OF | CHAR);
break;
- case Opcodes.NEW:
- push(UNINITIALIZED | cw.addUninitializedType(item.strVal1, arg));
+ case Opcodes.T_BYTE:
+ push(ARRAY_OF | BYTE);
break;
- case Opcodes.NEWARRAY:
- pop();
- switch (arg) {
- case Opcodes.T_BOOLEAN:
- push(ARRAY_OF | BOOLEAN);
- break;
- case Opcodes.T_CHAR:
- push(ARRAY_OF | CHAR);
- break;
- case Opcodes.T_BYTE:
- push(ARRAY_OF | BYTE);
- break;
- case Opcodes.T_SHORT:
- push(ARRAY_OF | SHORT);
- break;
- case Opcodes.T_INT:
- push(ARRAY_OF | INTEGER);
- break;
- case Opcodes.T_FLOAT:
- push(ARRAY_OF | FLOAT);
- break;
- case Opcodes.T_DOUBLE:
- push(ARRAY_OF | DOUBLE);
- break;
- // case Opcodes.T_LONG:
- default:
- push(ARRAY_OF | LONG);
- break;
- }
+ case Opcodes.T_SHORT:
+ push(ARRAY_OF | SHORT);
break;
- case Opcodes.ANEWARRAY:
- String s = item.strVal1;
- pop();
- if (s.charAt(0) == '[') {
- push(cw, '[' + s);
- } else {
- push(ARRAY_OF | OBJECT | cw.addType(s));
- }
+ case Opcodes.T_INT:
+ push(ARRAY_OF | INTEGER);
break;
- case Opcodes.CHECKCAST:
- s = item.strVal1;
- pop();
- if (s.charAt(0) == '[') {
- push(cw, s);
- } else {
- push(OBJECT | cw.addType(s));
- }
+ case Opcodes.T_FLOAT:
+ push(ARRAY_OF | FLOAT);
+ break;
+ case Opcodes.T_DOUBLE:
+ push(ARRAY_OF | DOUBLE);
break;
- // case Opcodes.MULTIANEWARRAY:
+ // case Opcodes.T_LONG:
default:
- pop(arg);
- push(cw, item.strVal1);
+ push(ARRAY_OF | LONG);
break;
+ }
+ break;
+ case Opcodes.ANEWARRAY:
+ String s = item.strVal1;
+ pop();
+ if (s.charAt(0) == '[') {
+ push(cw, '[' + s);
+ } else {
+ push(ARRAY_OF | OBJECT | cw.addType(s));
+ }
+ break;
+ case Opcodes.CHECKCAST:
+ s = item.strVal1;
+ pop();
+ if (s.charAt(0) == '[') {
+ push(cw, s);
+ } else {
+ push(OBJECT | cw.addType(s));
+ }
+ break;
+ // case Opcodes.MULTIANEWARRAY:
+ default:
+ pop(arg);
+ push(cw, item.strVal1);
+ break;
}
}
@@ -1254,10 +1274,13 @@ final class Frame {
* frames of this basic block. Returns <tt>true</tt> if the input frame of
* the given label has been changed by this operation.
*
- * @param cw the ClassWriter to which this label belongs.
- * @param frame the basic block whose input frame must be updated.
- * @param edge the kind of the {@link Edge} between this label and 'label'.
- * See {@link Edge#info}.
+ * @param cw
+ * the ClassWriter to which this label belongs.
+ * @param frame
+ * the basic block whose input frame must be updated.
+ * @param edge
+ * the kind of the {@link Edge} between this label and 'label'.
+ * See {@link Edge#info}.
* @return <tt>true</tt> if the input frame of the given label has been
* changed by this operation.
*/
@@ -1288,7 +1311,8 @@ final class Frame {
} else {
t = dim + inputStack[nStack - (s & VALUE)];
}
- if ((s & TOP_IF_LONG_OR_DOUBLE) != 0 && (t == LONG || t == DOUBLE)) {
+ if ((s & TOP_IF_LONG_OR_DOUBLE) != 0
+ && (t == LONG || t == DOUBLE)) {
t = TOP;
}
}
@@ -1340,7 +1364,8 @@ final class Frame {
} else {
t = dim + inputStack[nStack - (s & VALUE)];
}
- if ((s & TOP_IF_LONG_OR_DOUBLE) != 0 && (t == LONG || t == DOUBLE)) {
+ if ((s & TOP_IF_LONG_OR_DOUBLE) != 0
+ && (t == LONG || t == DOUBLE)) {
t = TOP;
}
}
@@ -1357,19 +1382,19 @@ final class Frame {
* type. Returns <tt>true</tt> if the type array has been modified by this
* operation.
*
- * @param cw the ClassWriter to which this label belongs.
- * @param t the type with which the type array element must be merged.
- * @param types an array of types.
- * @param index the index of the type that must be merged in 'types'.
+ * @param cw
+ * the ClassWriter to which this label belongs.
+ * @param t
+ * the type with which the type array element must be merged.
+ * @param types
+ * an array of types.
+ * @param index
+ * the index of the type that must be merged in 'types'.
* @return <tt>true</tt> if the type array has been modified by this
* operation.
*/
- private static boolean merge(
- final ClassWriter cw,
- int t,
- final int[] types,
- final int index)
- {
+ private static boolean merge(final ClassWriter cw, int t,
+ final int[] types, final int index) {
int u = types[index];
if (u == t) {
// if the types are equal, merge(u,t)=u, so there is no change
@@ -1393,6 +1418,7 @@ final class Frame {
// if t is the NULL type, merge(u,t)=u, so there is no change
return false;
} else if ((t & (DIM | BASE_KIND)) == (u & (DIM | BASE_KIND))) {
+ // if t and u have the same dimension and same base kind
if ((u & BASE_KIND) == OBJECT) {
// if t is also a reference type, and if u and t have the
// same dimension merge(u,t) = dim(t) | common parent of the
@@ -1405,9 +1431,13 @@ final class Frame {
v = OBJECT | cw.addType("java/lang/Object");
}
} else if ((t & BASE_KIND) == OBJECT || (t & DIM) != 0) {
- // if t is any other reference or array type,
- // merge(u,t)=java/lang/Object
- v = OBJECT | cw.addType("java/lang/Object");
+ // if t is any other reference or array type, the merged type
+ // is Object, or min(dim(u), dim(t)) | java/lang/Object is u
+ // and t have different array dimensions
+ int tdim = t & DIM;
+ int udim = u & DIM;
+ v = (udim != tdim ? Math.min(tdim, udim) : 0) | OBJECT
+ | cw.addType("java/lang/Object");
} else {
// if t is any other type, merge(u,t)=TOP
v = TOP;
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/Handle.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/Handle.java
new file mode 100644
index 0000000..423f7c8
--- /dev/null
+++ b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/Handle.java
@@ -0,0 +1,171 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package org.eclipse.persistence.internal.libraries.asm;
+
+
+/**
+ * A reference to a field or a method.
+ *
+ * @author Remi Forax
+ * @author Eric Bruneton
+ */
+public final class Handle {
+
+ /**
+ * The kind of field or method designated by this Handle. Should be
+ * {@link Opcodes#H_GETFIELD}, {@link Opcodes#H_GETSTATIC},
+ * {@link Opcodes#H_PUTFIELD}, {@link Opcodes#H_PUTSTATIC},
+ * {@link Opcodes#H_INVOKEVIRTUAL}, {@link Opcodes#H_INVOKESTATIC},
+ * {@link Opcodes#H_INVOKESPECIAL}, {@link Opcodes#H_NEWINVOKESPECIAL} or
+ * {@link Opcodes#H_INVOKEINTERFACE}.
+ */
+ final int tag;
+
+ /**
+ * The internal name of the class that owns the field or method designated
+ * by this handle.
+ */
+ final String owner;
+
+ /**
+ * The name of the field or method designated by this handle.
+ */
+ final String name;
+
+ /**
+ * The descriptor of the field or method designated by this handle.
+ */
+ final String desc;
+
+ /**
+ * Constructs a new field or method handle.
+ *
+ * @param tag
+ * the kind of field or method designated by this Handle. Must be
+ * {@link Opcodes#H_GETFIELD}, {@link Opcodes#H_GETSTATIC},
+ * {@link Opcodes#H_PUTFIELD}, {@link Opcodes#H_PUTSTATIC},
+ * {@link Opcodes#H_INVOKEVIRTUAL},
+ * {@link Opcodes#H_INVOKESTATIC},
+ * {@link Opcodes#H_INVOKESPECIAL},
+ * {@link Opcodes#H_NEWINVOKESPECIAL} or
+ * {@link Opcodes#H_INVOKEINTERFACE}.
+ * @param owner
+ * the internal name of the class that owns the field or method
+ * designated by this handle.
+ * @param name
+ * the name of the field or method designated by this handle.
+ * @param desc
+ * the descriptor of the field or method designated by this
+ * handle.
+ */
+ public Handle(int tag, String owner, String name, String desc) {
+ this.tag = tag;
+ this.owner = owner;
+ this.name = name;
+ this.desc = desc;
+ }
+
+ /**
+ * Returns the kind of field or method designated by this handle.
+ *
+ * @return {@link Opcodes#H_GETFIELD}, {@link Opcodes#H_GETSTATIC},
+ * {@link Opcodes#H_PUTFIELD}, {@link Opcodes#H_PUTSTATIC},
+ * {@link Opcodes#H_INVOKEVIRTUAL}, {@link Opcodes#H_INVOKESTATIC},
+ * {@link Opcodes#H_INVOKESPECIAL},
+ * {@link Opcodes#H_NEWINVOKESPECIAL} or
+ * {@link Opcodes#H_INVOKEINTERFACE}.
+ */
+ public int getTag() {
+ return tag;
+ }
+
+ /**
+ * Returns the internal name of the class that owns the field or method
+ * designated by this handle.
+ *
+ * @return the internal name of the class that owns the field or method
+ * designated by this handle.
+ */
+ public String getOwner() {
+ return owner;
+ }
+
+ /**
+ * Returns the name of the field or method designated by this handle.
+ *
+ * @return the name of the field or method designated by this handle.
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Returns the descriptor of the field or method designated by this handle.
+ *
+ * @return the descriptor of the field or method designated by this handle.
+ */
+ public String getDesc() {
+ return desc;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof Handle)) {
+ return false;
+ }
+ Handle h = (Handle) obj;
+ return tag == h.tag && owner.equals(h.owner) && name.equals(h.name)
+ && desc.equals(h.desc);
+ }
+
+ @Override
+ public int hashCode() {
+ return tag + owner.hashCode() * name.hashCode() * desc.hashCode();
+ }
+
+ /**
+ * Returns the textual representation of this handle. The textual
+ * representation is:
+ *
+ * <pre>
+ * owner '.' name desc ' ' '(' tag ')'
+ * </pre>
+ *
+ * . As this format is unambiguous, it can be parsed if necessary.
+ */
+ @Override
+ public String toString() {
+ return owner + '.' + name + desc + " (" + tag + ')';
+ }
+}
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/Handler.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/Handler.java
index 33d917a..071c83d 100644
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/Handler.java
+++ b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/Handler.java
@@ -1,6 +1,6 @@
/***
* ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2007 INRIA, France Telecom
+ * Copyright (c) 2000-2011 INRIA, France Telecom
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,6 +29,7 @@
*/
package org.eclipse.persistence.internal.libraries.asm;
+
/**
* Information about an exception handler block.
*
@@ -67,4 +68,55 @@ class Handler {
* Next exception handler block info.
*/
Handler next;
+
+ /**
+ * Removes the range between start and end from the given exception
+ * handlers.
+ *
+ * @param h
+ * an exception handler list.
+ * @param start
+ * the start of the range to be removed.
+ * @param end
+ * the end of the range to be removed. Maybe null.
+ * @return the exception handler list with the start-end range removed.
+ */
+ static Handler remove(Handler h, Label start, Label end) {
+ if (h == null) {
+ return null;
+ } else {
+ h.next = remove(h.next, start, end);
+ }
+ int hstart = h.start.position;
+ int hend = h.end.position;
+ int s = start.position;
+ int e = end == null ? Integer.MAX_VALUE : end.position;
+ // if [hstart,hend[ and [s,e[ intervals intersect...
+ if (s < hend && e > hstart) {
+ if (s <= hstart) {
+ if (e >= hend) {
+ // [hstart,hend[ fully included in [s,e[, h removed
+ h = h.next;
+ } else {
+ // [hstart,hend[ minus [s,e[ = [e,hend[
+ h.start = end;
+ }
+ } else if (e >= hend) {
+ // [hstart,hend[ minus [s,e[ = [hstart,s[
+ h.end = start;
+ } else {
+ // [hstart,hend[ minus [s,e[ = [hstart,s[ + [e,hend[
+ Handler g = new Handler();
+ g.start = end;
+ g.end = h.end;
+ g.handler = h.handler;
+ g.desc = h.desc;
+ g.type = h.type;
+ g.next = h.next;
+ h.end = start;
+ h.next = g;
+ }
+ }
+ return h;
+ }
}
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/Item.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/Item.java
index bcd2858..7f7a8c4 100644
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/Item.java
+++ b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/Item.java
@@ -1,6 +1,6 @@
/***
* ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2007 INRIA, France Telecom
+ * Copyright (c) 2000-2011 INRIA, France Telecom
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,6 +29,7 @@
*/
package org.eclipse.persistence.internal.libraries.asm;
+
/**
* A constant pool item. Constant pool items can be created with the 'newXXX'
* methods in the {@link ClassWriter} class.
@@ -50,7 +51,12 @@ final class Item {
* {@link ClassWriter#DOUBLE}, {@link ClassWriter#UTF8},
* {@link ClassWriter#STR}, {@link ClassWriter#CLASS},
* {@link ClassWriter#NAME_TYPE}, {@link ClassWriter#FIELD},
- * {@link ClassWriter#METH}, {@link ClassWriter#IMETH}.
+ * {@link ClassWriter#METH}, {@link ClassWriter#IMETH},
+ * {@link ClassWriter#MTYPE}, {@link ClassWriter#INDY}.
+ *
+ * MethodHandle constant 9 variations are stored using a range of 9 values
+ * from {@link ClassWriter#HANDLE_BASE} + 1 to
+ * {@link ClassWriter#HANDLE_BASE} + 9.
*
* Special Item types are used for Items that are stored in the ClassWriter
* {@link ClassWriter#typeTable}, instead of the constant pool, in order to
@@ -110,7 +116,8 @@ final class Item {
* Constructs an uninitialized {@link Item} for constant pool element at
* given position.
*
- * @param index index of the item to be constructed.
+ * @param index
+ * index of the item to be constructed.
*/
Item(final int index) {
this.index = index;
@@ -119,8 +126,10 @@ final class Item {
/**
* Constructs a copy of the given item.
*
- * @param index index of the item to be constructed.
- * @param i the item that must be copied into the item to be constructed.
+ * @param index
+ * index of the item to be constructed.
+ * @param i
+ * the item that must be copied into the item to be constructed.
*/
Item(final int index, final Item i) {
this.index = index;
@@ -136,7 +145,8 @@ final class Item {
/**
* Sets this item to an integer item.
*
- * @param intVal the value of this item.
+ * @param intVal
+ * the value of this item.
*/
void set(final int intVal) {
this.type = ClassWriter.INT;
@@ -147,7 +157,8 @@ final class Item {
/**
* Sets this item to a long item.
*
- * @param longVal the value of this item.
+ * @param longVal
+ * the value of this item.
*/
void set(final long longVal) {
this.type = ClassWriter.LONG;
@@ -158,7 +169,8 @@ final class Item {
/**
* Sets this item to a float item.
*
- * @param floatVal the value of this item.
+ * @param floatVal
+ * the value of this item.
*/
void set(final float floatVal) {
this.type = ClassWriter.FLOAT;
@@ -169,7 +181,8 @@ final class Item {
/**
* Sets this item to a double item.
*
- * @param doubleVal the value of this item.
+ * @param doubleVal
+ * the value of this item.
*/
void set(final double doubleVal) {
this.type = ClassWriter.DOUBLE;
@@ -180,74 +193,119 @@ final class Item {
/**
* Sets this item to an item that do not hold a primitive value.
*
- * @param type the type of this item.
- * @param strVal1 first part of the value of this item.
- * @param strVal2 second part of the value of this item.
- * @param strVal3 third part of the value of this item.
- */
- void set(
- final int type,
- final String strVal1,
- final String strVal2,
- final String strVal3)
- {
+ * @param type
+ * the type of this item.
+ * @param strVal1
+ * first part of the value of this item.
+ * @param strVal2
+ * second part of the value of this item.
+ * @param strVal3
+ * third part of the value of this item.
+ */
+ void set(final int type, final String strVal1, final String strVal2,
+ final String strVal3) {
this.type = type;
this.strVal1 = strVal1;
this.strVal2 = strVal2;
this.strVal3 = strVal3;
switch (type) {
- case ClassWriter.UTF8:
- case ClassWriter.STR:
- case ClassWriter.CLASS:
- case ClassWriter.TYPE_NORMAL:
- hashCode = 0x7FFFFFFF & (type + strVal1.hashCode());
- return;
- case ClassWriter.NAME_TYPE:
- hashCode = 0x7FFFFFFF & (type + strVal1.hashCode()
- * strVal2.hashCode());
- return;
- // ClassWriter.FIELD:
- // ClassWriter.METH:
- // ClassWriter.IMETH:
- default:
- hashCode = 0x7FFFFFFF & (type + strVal1.hashCode()
- * strVal2.hashCode() * strVal3.hashCode());
+ case ClassWriter.UTF8:
+ case ClassWriter.STR:
+ case ClassWriter.CLASS:
+ case ClassWriter.MTYPE:
+ case ClassWriter.TYPE_NORMAL:
+ hashCode = 0x7FFFFFFF & (type + strVal1.hashCode());
+ return;
+ case ClassWriter.NAME_TYPE: {
+ hashCode = 0x7FFFFFFF & (type + strVal1.hashCode()
+ * strVal2.hashCode());
+ return;
+ }
+ // ClassWriter.FIELD:
+ // ClassWriter.METH:
+ // ClassWriter.IMETH:
+ // ClassWriter.HANDLE_BASE + 1..9
+ default:
+ hashCode = 0x7FFFFFFF & (type + strVal1.hashCode()
+ * strVal2.hashCode() * strVal3.hashCode());
}
}
/**
+ * Sets the item to an InvokeDynamic item.
+ *
+ * @param name
+ * invokedynamic's name.
+ * @param desc
+ * invokedynamic's desc.
+ * @param bsmIndex
+ * zero based index into the class attribute BootrapMethods.
+ */
+ void set(String name, String desc, int bsmIndex) {
+ this.type = ClassWriter.INDY;
+ this.longVal = bsmIndex;
+ this.strVal1 = name;
+ this.strVal2 = desc;
+ this.hashCode = 0x7FFFFFFF & (ClassWriter.INDY + bsmIndex
+ * strVal1.hashCode() * strVal2.hashCode());
+ }
+
+ /**
+ * Sets the item to a BootstrapMethod item.
+ *
+ * @param position
+ * position in byte in the class attribute BootrapMethods.
+ * @param hashCode
+ * hashcode of the item. This hashcode is processed from the
+ * hashcode of the bootstrap method and the hashcode of all
+ * bootstrap arguments.
+ */
+ void set(int position, int hashCode) {
+ this.type = ClassWriter.BSM;
+ this.intVal = position;
+ this.hashCode = hashCode;
+ }
+
+ /**
* Indicates if the given item is equal to this one. <i>This method assumes
- * that the two items have the same {@link #type}</i>.
+ * that the two items have the same {@link #type}</i>.
*
- * @param i the item to be compared to this one. Both items must have the
- * same {@link #type}.
+ * @param i
+ * the item to be compared to this one. Both items must have the
+ * same {@link #type}.
* @return <tt>true</tt> if the given item if equal to this one,
* <tt>false</tt> otherwise.
*/
boolean isEqualTo(final Item i) {
switch (type) {
- case ClassWriter.UTF8:
- case ClassWriter.STR:
- case ClassWriter.CLASS:
- case ClassWriter.TYPE_NORMAL:
- return i.strVal1.equals(strVal1);
- case ClassWriter.TYPE_MERGED:
- case ClassWriter.LONG:
- case ClassWriter.DOUBLE:
- return i.longVal == longVal;
- case ClassWriter.INT:
- case ClassWriter.FLOAT:
- return i.intVal == intVal;
- case ClassWriter.TYPE_UNINIT:
- return i.intVal == intVal && i.strVal1.equals(strVal1);
- case ClassWriter.NAME_TYPE:
- return i.strVal1.equals(strVal1) && i.strVal2.equals(strVal2);
- // case ClassWriter.FIELD:
- // case ClassWriter.METH:
- // case ClassWriter.IMETH:
- default:
- return i.strVal1.equals(strVal1) && i.strVal2.equals(strVal2)
- && i.strVal3.equals(strVal3);
+ case ClassWriter.UTF8:
+ case ClassWriter.STR:
+ case ClassWriter.CLASS:
+ case ClassWriter.MTYPE:
+ case ClassWriter.TYPE_NORMAL:
+ return i.strVal1.equals(strVal1);
+ case ClassWriter.TYPE_MERGED:
+ case ClassWriter.LONG:
+ case ClassWriter.DOUBLE:
+ return i.longVal == longVal;
+ case ClassWriter.INT:
+ case ClassWriter.FLOAT:
+ return i.intVal == intVal;
+ case ClassWriter.TYPE_UNINIT:
+ return i.intVal == intVal && i.strVal1.equals(strVal1);
+ case ClassWriter.NAME_TYPE:
+ return i.strVal1.equals(strVal1) && i.strVal2.equals(strVal2);
+ case ClassWriter.INDY: {
+ return i.longVal == longVal && i.strVal1.equals(strVal1)
+ && i.strVal2.equals(strVal2);
+ }
+ // case ClassWriter.FIELD:
+ // case ClassWriter.METH:
+ // case ClassWriter.IMETH:
+ // case ClassWriter.HANDLE_BASE + 1..9
+ default:
+ return i.strVal1.equals(strVal1) && i.strVal2.equals(strVal2)
+ && i.strVal3.equals(strVal3);
}
}
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/Label.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/Label.java
index ff6c5a7..b118a0a 100644
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/Label.java
+++ b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/Label.java
@@ -1,6 +1,6 @@
/***
* ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2007 INRIA, France Telecom
+ * Copyright (c) 2000-2011 INRIA, France Telecom
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,12 +29,13 @@
*/
package org.eclipse.persistence.internal.libraries.asm;
+
/**
* A label represents a position in the bytecode of a method. Labels are used
* for jump, goto, and switch instructions, and for try catch blocks. A label
- * designates the <i>instruction</i> that is just after. Note however that
- * there can be other elements between a label and the instruction it
- * designates (such as other labels, stack map frames, line numbers, etc.).
+ * designates the <i>instruction</i> that is just after. Note however that there
+ * can be other elements between a label and the instruction it designates (such
+ * as other labels, stack map frames, line numbers, etc.).
*
* @author Eric Bruneton
*/
@@ -96,7 +97,7 @@ public class Label {
static final int SUBROUTINE = 512;
/**
- * Indicates if this subroutine basic block has been visited by a
+ * Indicates if this subroutine basic block has been visited by a
* visitSubroutine(null, ...) call.
*/
static final int VISITED = 1024;
@@ -110,8 +111,8 @@ public class Label {
/**
* Field used to associate user information to a label. Warning: this field
* is used by the ASM tree package. In order to use it with the ASM tree
- * package you must override the {@link
- * org.eclipse.persistence.internal.libraries.asm.tree.MethodNode#getLabelNode} method.
+ * package you must override the
+ * {@link org.eclipse.persistence.internal.libraries.asm.tree.MethodNode#getLabelNode} method.
*/
public Object info;
@@ -154,7 +155,7 @@ public class Label {
* indicates if this reference uses 2 or 4 bytes, and its absolute value
* gives the position of the bytecode instruction. This array is also used
* as a bitset to store the subroutines to which a basic block belongs. This
- * information is needed in {@linked MethodWriter#visitMaxs}, after all
+ * information is needed in {@linked MethodWriter#visitMaxs}, after all
* forward references have been resolved. Hence the same array can be used
* for both purposes without problems.
*/
@@ -177,11 +178,11 @@ public class Label {
* state of the local variables and the operand stack at the end of each
* basic block, called the "output frame", <i>relatively</i> to the frame
* state at the beginning of the basic block, which is called the "input
- * frame", and which is <i>unknown</i> during this step. The second step,
- * in {@link MethodWriter#visitMaxs}, is a fix point algorithm that
- * computes information about the input frame of each basic block, from the
- * input state of the first basic block (known from the method signature),
- * and by the using the previously computed relative output frames.
+ * frame", and which is <i>unknown</i> during this step. The second step, in
+ * {@link MethodWriter#visitMaxs}, is a fix point algorithm that computes
+ * information about the input frame of each basic block, from the input
+ * state of the first basic block (known from the method signature), and by
+ * the using the previously computed relative output frames.
*
* The algorithm used to compute the maximum stack size only computes the
* relative output and absolute input stack heights, while the algorithm
@@ -238,7 +239,7 @@ public class Label {
/**
* The next basic block in the basic block stack. This stack is used in the
* main loop of the fix point algorithm used in the second step of the
- * control flow analysis algorithms. It is also used in
+ * control flow analysis algorithms. It is also used in
* {@link #visitSubroutine} to avoid using a recursive method.
*
* @see MethodWriter#visitMaxs
@@ -266,11 +267,13 @@ public class Label {
* generators or adapters.</i>
*
* @return the offset corresponding to this label.
- * @throws IllegalStateException if this label is not resolved yet.
+ * @throws IllegalStateException
+ * if this label is not resolved yet.
*/
public int getOffset() {
if ((status & RESOLVED) == 0) {
- throw new IllegalStateException("Label offset position has not been resolved yet");
+ throw new IllegalStateException(
+ "Label offset position has not been resolved yet");
}
return position;
}
@@ -281,21 +284,21 @@ public class Label {
* directly. Otherwise, a null offset is written and a new forward reference
* is declared for this label.
*
- * @param owner the code writer that calls this method.
- * @param out the bytecode of the method.
- * @param source the position of first byte of the bytecode instruction that
- * contains this label.
- * @param wideOffset <tt>true</tt> if the reference must be stored in 4
- * bytes, or <tt>false</tt> if it must be stored with 2 bytes.
- * @throws IllegalArgumentException if this label has not been created by
- * the given code writer.
- */
- void put(
- final MethodWriter owner,
- final ByteVector out,
- final int source,
- final boolean wideOffset)
- {
+ * @param owner
+ * the code writer that calls this method.
+ * @param out
+ * the bytecode of the method.
+ * @param source
+ * the position of first byte of the bytecode instruction that
+ * contains this label.
+ * @param wideOffset
+ * <tt>true</tt> if the reference must be stored in 4 bytes, or
+ * <tt>false</tt> if it must be stored with 2 bytes.
+ * @throws IllegalArgumentException
+ * if this label has not been created by the given code writer.
+ */
+ void put(final MethodWriter owner, final ByteVector out, final int source,
+ final boolean wideOffset) {
if ((status & RESOLVED) == 0) {
if (wideOffset) {
addReference(-1 - source, out.length);
@@ -319,25 +322,21 @@ public class Label {
* yet. For backward references, the offset of the reference can be, and
* must be, computed and stored directly.
*
- * @param sourcePosition the position of the referencing instruction. This
- * position will be used to compute the offset of this forward
- * reference.
- * @param referencePosition the position where the offset for this forward
- * reference must be stored.
- */
- private void addReference(
- final int sourcePosition,
- final int referencePosition)
- {
+ * @param sourcePosition
+ * the position of the referencing instruction. This position
+ * will be used to compute the offset of this forward reference.
+ * @param referencePosition
+ * the position where the offset for this forward reference must
+ * be stored.
+ */
+ private void addReference(final int sourcePosition,
+ final int referencePosition) {
if (srcAndRefPositions == null) {
srcAndRefPositions = new int[6];
}
if (referenceCount >= srcAndRefPositions.length) {
int[] a = new int[srcAndRefPositions.length + 6];
- System.arraycopy(srcAndRefPositions,
- 0,
- a,
- 0,
+ System.arraycopy(srcAndRefPositions, 0, a, 0,
srcAndRefPositions.length);
srcAndRefPositions = a;
}
@@ -351,9 +350,12 @@ public class Label {
* position becomes known. This method fills in the blanks that where left
* in the bytecode by each forward reference previously added to this label.
*
- * @param owner the code writer that calls this method.
- * @param position the position of this label in the bytecode.
- * @param data the bytecode of the method.
+ * @param owner
+ * the code writer that calls this method.
+ * @param position
+ * the position of this label in the bytecode.
+ * @param data
+ * the bytecode of the method.
* @return <tt>true</tt> if a blank that was left for this label was to
* small to store the offset. In such a case the corresponding jump
* instruction is replaced with a pseudo instruction (using unused
@@ -361,14 +363,12 @@ public class Label {
* instructions will need to be replaced with true instructions with
* wider offsets (4 bytes instead of 2). This is done in
* {@link MethodWriter#resizeInstructions}.
- * @throws IllegalArgumentException if this label has already been resolved,
- * or if it has not been created by the given code writer.
- */
- boolean resolve(
- final MethodWriter owner,
- final int position,
- final byte[] data)
- {
+ * @throws IllegalArgumentException
+ * if this label has already been resolved, or if it has not
+ * been created by the given code writer.
+ */
+ boolean resolve(final MethodWriter owner, final int position,
+ final byte[] data) {
boolean needUpdate = false;
this.status |= RESOLVED;
this.position = position;
@@ -431,7 +431,8 @@ public class Label {
/**
* Returns true is this basic block belongs to the given subroutine.
*
- * @param id a subroutine id.
+ * @param id
+ * a subroutine id.
* @return true is this basic block belongs to the given subroutine.
*/
boolean inSubroutine(final long id) {
@@ -445,7 +446,8 @@ public class Label {
* Returns true if this basic block and the given one belong to a common
* subroutine.
*
- * @param block another basic block.
+ * @param block
+ * another basic block.
* @return true if this basic block and the given one belong to a common
* subroutine.
*/
@@ -464,8 +466,10 @@ public class Label {
/**
* Marks this basic block as belonging to the given subroutine.
*
- * @param id a subroutine id.
- * @param nbSubroutines the total number of subroutines in the method.
+ * @param id
+ * a subroutine id.
+ * @param nbSubroutines
+ * the total number of subroutines in the method.
*/
void addToSubroutine(final long id, final int nbSubroutines) {
if ((status & VISITED) == 0) {
@@ -474,21 +478,23 @@ public class Label {
}
srcAndRefPositions[(int) (id >>> 32)] |= (int) id;
}
-
+
/**
* Finds the basic blocks that belong to a given subroutine, and marks these
* blocks as belonging to this subroutine. This method follows the control
* flow graph to find all the blocks that are reachable from the current
* block WITHOUT following any JSR target.
*
- * @param JSR a JSR block that jumps to this subroutine. If this JSR is not
- * null it is added to the successor of the RET blocks found in the
- * subroutine.
- * @param id the id of this subroutine.
- * @param nbSubroutines the total number of subroutines in the method.
- */
- void visitSubroutine(final Label JSR, final long id, final int nbSubroutines)
- {
+ * @param JSR
+ * a JSR block that jumps to this subroutine. If this JSR is not
+ * null it is added to the successor of the RET blocks found in
+ * the subroutine.
+ * @param id
+ * the id of this subroutine.
+ * @param nbSubroutines
+ * the total number of subroutines in the method.
+ */
+ void visitSubroutine(final Label JSR, final long id, final int nbSubroutines) {
// user managed stack of labels, to avoid using a recursive method
// (recursivity can lead to stack overflow with very large methods)
Label stack = this;
@@ -497,7 +503,7 @@ public class Label {
Label l = stack;
stack = l.next;
l.next = null;
-
+
if (JSR != null) {
if ((l.status & VISITED2) != 0) {
continue;
@@ -519,13 +525,13 @@ public class Label {
continue;
}
// marks the l block as belonging to subroutine 'id'
- l.addToSubroutine(id, nbSubroutines);
+ l.addToSubroutine(id, nbSubroutines);
}
// pushes each successor of l on the stack, except JSR targets
Edge e = l.successors;
while (e != null) {
// if the l block is a JSR block, then 'l.successors.next' leads
- // to the JSR target (see {@link #visitJumpInsn}) and must
+ // to the JSR target (see {@link #visitJumpInsn}) and must
// therefore not be followed
if ((l.status & Label.JSR) == 0 || e != l.successors.next) {
// pushes e.successor on the stack if it not already added
@@ -548,6 +554,7 @@ public class Label {
*
* @return a string representation of this label.
*/
+ @Override
public String toString() {
return "L" + System.identityHashCode(this);
}
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/MethodAdapter.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/MethodAdapter.java
deleted file mode 100644
index 2e75e93..0000000
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/MethodAdapter.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2007 INRIA, France Telecom
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-package org.eclipse.persistence.internal.libraries.asm;
-
-/**
- * An empty {@link MethodVisitor} that delegates to another
- * {@link MethodVisitor}. This class can be used as a super class to quickly
- * implement usefull method adapter classes, just by overriding the necessary
- * methods.
- *
- * @author Eric Bruneton
- */
-public class MethodAdapter implements MethodVisitor {
-
- /**
- * The {@link MethodVisitor} to which this adapter delegates calls.
- */
- protected MethodVisitor mv;
-
- /**
- * Constructs a new {@link MethodAdapter} object.
- *
- * @param mv the code visitor to which this adapter must delegate calls.
- */
- public MethodAdapter(final MethodVisitor mv) {
- this.mv = mv;
- }
-
- public AnnotationVisitor visitAnnotationDefault() {
- return mv.visitAnnotationDefault();
- }
-
- public AnnotationVisitor visitAnnotation(
- final String desc,
- final boolean visible)
- {
- return mv.visitAnnotation(desc, visible);
- }
-
- public AnnotationVisitor visitParameterAnnotation(
- final int parameter,
- final String desc,
- final boolean visible)
- {
- return mv.visitParameterAnnotation(parameter, desc, visible);
- }
-
- public void visitAttribute(final Attribute attr) {
- mv.visitAttribute(attr);
- }
-
- public void visitCode() {
- mv.visitCode();
- }
-
- public void visitFrame(
- final int type,
- final int nLocal,
- final Object[] local,
- final int nStack,
- final Object[] stack)
- {
- mv.visitFrame(type, nLocal, local, nStack, stack);
- }
-
- public void visitInsn(final int opcode) {
- mv.visitInsn(opcode);
- }
-
- public void visitIntInsn(final int opcode, final int operand) {
- mv.visitIntInsn(opcode, operand);
- }
-
- public void visitVarInsn(final int opcode, final int var) {
- mv.visitVarInsn(opcode, var);
- }
-
- public void visitTypeInsn(final int opcode, final String type) {
- mv.visitTypeInsn(opcode, type);
- }
-
- public void visitFieldInsn(
- final int opcode,
- final String owner,
- final String name,
- final String desc)
- {
- mv.visitFieldInsn(opcode, owner, name, desc);
- }
-
- public void visitMethodInsn(
- final int opcode,
- final String owner,
- final String name,
- final String desc)
- {
- mv.visitMethodInsn(opcode, owner, name, desc);
- }
-
- public void visitJumpInsn(final int opcode, final Label label) {
- mv.visitJumpInsn(opcode, label);
- }
-
- public void visitLabel(final Label label) {
- mv.visitLabel(label);
- }
-
- public void visitLdcInsn(final Object cst) {
- mv.visitLdcInsn(cst);
- }
-
- public void visitIincInsn(final int var, final int increment) {
- mv.visitIincInsn(var, increment);
- }
-
- public void visitTableSwitchInsn(
- final int min,
- final int max,
- final Label dflt,
- final Label[] labels)
- {
- mv.visitTableSwitchInsn(min, max, dflt, labels);
- }
-
- public void visitLookupSwitchInsn(
- final Label dflt,
- final int[] keys,
- final Label[] labels)
- {
- mv.visitLookupSwitchInsn(dflt, keys, labels);
- }
-
- public void visitMultiANewArrayInsn(final String desc, final int dims) {
- mv.visitMultiANewArrayInsn(desc, dims);
- }
-
- public void visitTryCatchBlock(
- final Label start,
- final Label end,
- final Label handler,
- final String type)
- {
- mv.visitTryCatchBlock(start, end, handler, type);
- }
-
- public void visitLocalVariable(
- final String name,
- final String desc,
- final String signature,
- final Label start,
- final Label end,
- final int index)
- {
- mv.visitLocalVariable(name, desc, signature, start, end, index);
- }
-
- public void visitLineNumber(final int line, final Label start) {
- mv.visitLineNumber(line, start);
- }
-
- public void visitMaxs(final int maxStack, final int maxLocals) {
- mv.visitMaxs(maxStack, maxLocals);
- }
-
- public void visitEnd() {
- mv.visitEnd();
- }
-}
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/MethodVisitor.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/MethodVisitor.java
index 6b04303..6c90831 100644
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/MethodVisitor.java
+++ b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/MethodVisitor.java
@@ -1,6 +1,6 @@
/***
* ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2007 INRIA, France Telecom
+ * Copyright (c) 2000-2011 INRIA, France Telecom
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,76 +29,206 @@
*/
package org.eclipse.persistence.internal.libraries.asm;
+
/**
- * A visitor to visit a Java method. The methods of this interface must be
- * called in the following order: [ <tt>visitAnnotationDefault</tt> ] (
- * <tt>visitAnnotation</tt> | <tt>visitParameterAnnotation</tt> |
- * <tt>visitAttribute</tt> )* [ <tt>visitCode</tt> ( <tt>visitFrame</tt> |
- * <tt>visit</tt><i>X</i>Insn</tt> | <tt>visitLabel</tt> | <tt>visitTryCatchBlock</tt> |
- * <tt>visitLocalVariable</tt> | <tt>visitLineNumber</tt>)* <tt>visitMaxs</tt> ]
- * <tt>visitEnd</tt>. In addition, the <tt>visit</tt><i>X</i>Insn</tt>
- * and <tt>visitLabel</tt> methods must be called in the sequential order of
- * the bytecode instructions of the visited code, <tt>visitTryCatchBlock</tt>
- * must be called <i>before</i> the labels passed as arguments have been
- * visited, and the <tt>visitLocalVariable</tt> and <tt>visitLineNumber</tt>
- * methods must be called <i>after</i> the labels passed as arguments have been
- * visited.
+ * A visitor to visit a Java method. The methods of this class must be called in
+ * the following order: ( <tt>visitParameter</tt> )* [
+ * <tt>visitAnnotationDefault</tt> ] ( <tt>visitAnnotation</tt> |
+ * <tt>visitTypeAnnotation</tt> | <tt>visitAttribute</tt> )* [
+ * <tt>visitCode</tt> ( <tt>visitFrame</tt> | <tt>visit<i>X</i>Insn</tt> |
+ * <tt>visitLabel</tt> | <tt>visitInsnAnnotation</tt> |
+ * <tt>visitTryCatchBlock</tt> | <tt>visitTryCatchBlockAnnotation</tt> |
+ * <tt>visitLocalVariable</tt> | <tt>visitLocalVariableAnnotation</tt> |
+ * <tt>visitLineNumber</tt> )* <tt>visitMaxs</tt> ] <tt>visitEnd</tt>. In
+ * addition, the <tt>visit<i>X</i>Insn</tt> and <tt>visitLabel</tt> methods must
+ * be called in the sequential order of the bytecode instructions of the visited
+ * code, <tt>visitInsnAnnotation</tt> must be called <i>after</i> the annotated
+ * instruction, <tt>visitTryCatchBlock</tt> must be called <i>before</i> the
+ * labels passed as arguments have been visited,
+ * <tt>visitTryCatchBlockAnnotation</tt> must be called <i>after</i> the
+ * corresponding try catch block has been visited, and the
+ * <tt>visitLocalVariable</tt>, <tt>visitLocalVariableAnnotation</tt> and
+ * <tt>visitLineNumber</tt> methods must be called <i>after</i> the labels
+ * passed as arguments have been visited.
*
* @author Eric Bruneton
*/
-public interface MethodVisitor {
+public abstract class MethodVisitor {
+
+ /**
+ * The ASM API version implemented by this visitor. The value of this field
+ * must be one of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}.
+ */
+ protected final int api;
+
+ /**
+ * The method visitor to which this visitor must delegate method calls. May
+ * be null.
+ */
+ protected MethodVisitor mv;
+
+ /**
+ * Constructs a new {@link MethodVisitor}.
+ *
+ * @param api
+ * the ASM API version implemented by this visitor. Must be one
+ * of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}.
+ */
+ public MethodVisitor(final int api) {
+ this(api, null);
+ }
+
+ /**
+ * Constructs a new {@link MethodVisitor}.
+ *
+ * @param api
+ * the ASM API version implemented by this visitor. Must be one
+ * of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}.
+ * @param mv
+ * the method visitor to which this visitor must delegate method
+ * calls. May be null.
+ */
+ public MethodVisitor(final int api, final MethodVisitor mv) {
+ if (api != Opcodes.ASM4 && api != Opcodes.ASM5) {
+ throw new IllegalArgumentException();
+ }
+ this.api = api;
+ this.mv = mv;
+ }
// -------------------------------------------------------------------------
- // Annotations and non standard attributes
+ // Parameters, annotations and non standard attributes
// -------------------------------------------------------------------------
/**
+ * Visits a parameter of this method.
+ *
+ * @param name
+ * parameter name or null if none is provided.
+ * @param access
+ * the parameter's access flags, only <tt>ACC_FINAL</tt>,
+ * <tt>ACC_SYNTHETIC</tt> or/and <tt>ACC_MANDATED</tt> are
+ * allowed (see {@link Opcodes}).
+ */
+ public void visitParameter(String name, int access) {
+ if (api < Opcodes.ASM5) {
+ throw new RuntimeException();
+ }
+ if (mv != null) {
+ mv.visitParameter(name, access);
+ }
+ }
+
+ /**
* Visits the default value of this annotation interface method.
*
* @return a visitor to the visit the actual default value of this
- * annotation interface method, or <tt>null</tt> if this visitor
- * is not interested in visiting this default value. The 'name'
+ * annotation interface method, or <tt>null</tt> if this visitor is
+ * not interested in visiting this default value. The 'name'
* parameters passed to the methods of this annotation visitor are
* ignored. Moreover, exacly one visit method must be called on this
* annotation visitor, followed by visitEnd.
*/
- AnnotationVisitor visitAnnotationDefault();
+ public AnnotationVisitor visitAnnotationDefault() {
+ if (mv != null) {
+ return mv.visitAnnotationDefault();
+ }
+ return null;
+ }
/**
* Visits an annotation of this method.
*
- * @param desc the class descriptor of the annotation class.
- * @param visible <tt>true</tt> if the annotation is visible at runtime.
+ * @param desc
+ * the class descriptor of the annotation class.
+ * @param visible
+ * <tt>true</tt> if the annotation is visible at runtime.
+ * @return a visitor to visit the annotation values, or <tt>null</tt> if
+ * this visitor is not interested in visiting this annotation.
+ */
+ public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
+ if (mv != null) {
+ return mv.visitAnnotation(desc, visible);
+ }
+ return null;
+ }
+
+ /**
+ * Visits an annotation on a type in the method signature.
+ *
+ * @param typeRef
+ * a reference to the annotated type. The sort of this type
+ * reference must be {@link TypeReference#METHOD_TYPE_PARAMETER
+ * METHOD_TYPE_PARAMETER},
+ * {@link TypeReference#METHOD_TYPE_PARAMETER_BOUND
+ * METHOD_TYPE_PARAMETER_BOUND},
+ * {@link TypeReference#METHOD_RETURN METHOD_RETURN},
+ * {@link TypeReference#METHOD_RECEIVER METHOD_RECEIVER},
+ * {@link TypeReference#METHOD_FORMAL_PARAMETER
+ * METHOD_FORMAL_PARAMETER} or {@link TypeReference#THROWS
+ * THROWS}. See {@link TypeReference}.
+ * @param typePath
+ * the path to the annotated type argument, wildcard bound, array
+ * element type, or static inner type within 'typeRef'. May be
+ * <tt>null</tt> if the annotation targets 'typeRef' as a whole.
+ * @param desc
+ * the class descriptor of the annotation class.
+ * @param visible
+ * <tt>true</tt> if the annotation is visible at runtime.
* @return a visitor to visit the annotation values, or <tt>null</tt> if
* this visitor is not interested in visiting this annotation.
*/
- AnnotationVisitor visitAnnotation(String desc, boolean visible);
+ public AnnotationVisitor visitTypeAnnotation(int typeRef,
+ TypePath typePath, String desc, boolean visible) {
+ if (api < Opcodes.ASM5) {
+ throw new RuntimeException();
+ }
+ if (mv != null) {
+ return mv.visitTypeAnnotation(typeRef, typePath, desc, visible);
+ }
+ return null;
+ }
/**
* Visits an annotation of a parameter this method.
*
- * @param parameter the parameter index.
- * @param desc the class descriptor of the annotation class.
- * @param visible <tt>true</tt> if the annotation is visible at runtime.
+ * @param parameter
+ * the parameter index.
+ * @param desc
+ * the class descriptor of the annotation class.
+ * @param visible
+ * <tt>true</tt> if the annotation is visible at runtime.
* @return a visitor to visit the annotation values, or <tt>null</tt> if
* this visitor is not interested in visiting this annotation.
*/
- AnnotationVisitor visitParameterAnnotation(
- int parameter,
- String desc,
- boolean visible);
+ public AnnotationVisitor visitParameterAnnotation(int parameter,
+ String desc, boolean visible) {
+ if (mv != null) {
+ return mv.visitParameterAnnotation(parameter, desc, visible);
+ }
+ return null;
+ }
/**
* Visits a non standard attribute of this method.
*
- * @param attr an attribute.
+ * @param attr
+ * an attribute.
*/
- void visitAttribute(Attribute attr);
+ public void visitAttribute(Attribute attr) {
+ if (mv != null) {
+ mv.visitAttribute(attr);
+ }
+ }
/**
* Starts the visit of the method's code, if any (i.e. non abstract method).
*/
- void visitCode();
+ public void visitCode() {
+ if (mv != null) {
+ mv.visitCode();
+ }
+ }
/**
* Visits the current state of the local variables and operand stack
@@ -107,56 +237,80 @@ public interface MethodVisitor {
* such as GOTO or THROW, that is the target of a jump instruction, or that
* starts an exception handler block. The visited types must describe the
* values of the local variables and of the operand stack elements <i>just
- * before</i> <b>i</b> is executed. <br> <br> (*) this is mandatory only
- * for classes whose version is greater than or equal to
- * {@link Opcodes#V1_6 V1_6}. <br> <br> Packed frames are basically
- * "deltas" from the state of the previous frame (very first frame is
- * implicitly defined by the method's parameters and access flags): <ul>
+ * before</i> <b>i</b> is executed.<br>
+ * <br>
+ * (*) this is mandatory only for classes whose version is greater than or
+ * equal to {@link Opcodes#V1_6 V1_6}. <br>
+ * <br>
+ * The frames of a method must be given either in expanded form, or in
+ * compressed form (all frames must use the same format, i.e. you must not
+ * mix expanded and compressed frames within a single method):
+ * <ul>
+ * <li>In expanded form, all frames must have the F_NEW type.</li>
+ * <li>In compressed form, frames are basically "deltas" from the state of
+ * the previous frame:
+ * <ul>
* <li>{@link Opcodes#F_SAME} representing frame with exactly the same
- * locals as the previous frame and with the empty stack.</li> <li>{@link Opcodes#F_SAME1}
- * representing frame with exactly the same locals as the previous frame and
- * with single value on the stack (<code>nStack</code> is 1 and
- * <code>stack[0]</code> contains value for the type of the stack item).</li>
+ * locals as the previous frame and with the empty stack.</li>
+ * <li>{@link Opcodes#F_SAME1} representing frame with exactly the same
+ * locals as the previous frame and with single value on the stack (
+ * <code>nStack</code> is 1 and <code>stack[0]</code> contains value for the
+ * type of the stack item).</li>
* <li>{@link Opcodes#F_APPEND} representing frame with current locals are
* the same as the locals in the previous frame, except that additional
* locals are defined (<code>nLocal</code> is 1, 2 or 3 and
* <code>local</code> elements contains values representing added types).</li>
- * <li>{@link Opcodes#F_CHOP} representing frame with current locals are
- * the same as the locals in the previous frame, except that the last 1-3
- * locals are absent and with the empty stack (<code>nLocals</code> is 1,
- * 2 or 3). </li> <li>{@link Opcodes#F_FULL} representing complete frame
- * data.</li> </li> </ul>
- *
- * @param type the type of this stack map frame. Must be
- * {@link Opcodes#F_NEW} for expanded frames, or
- * {@link Opcodes#F_FULL}, {@link Opcodes#F_APPEND},
- * {@link Opcodes#F_CHOP}, {@link Opcodes#F_SAME} or
- * {@link Opcodes#F_APPEND}, {@link Opcodes#F_SAME1} for compressed
- * frames.
- * @param nLocal the number of local variables in the visited frame.
- * @param local the local variable types in this frame. This array must not
- * be modified. Primitive types are represented by
- * {@link Opcodes#TOP}, {@link Opcodes#INTEGER},
- * {@link Opcodes#FLOAT}, {@link Opcodes#LONG},
- * {@link Opcodes#DOUBLE},{@link Opcodes#NULL} or
- * {@link Opcodes#UNINITIALIZED_THIS} (long and double are
- * represented by a single element). Reference types are represented
- * by String objects (representing internal names), and uninitialized
- * types by Label objects (this label designates the NEW instruction
- * that created this uninitialized value).
- * @param nStack the number of operand stack elements in the visited frame.
- * @param stack the operand stack types in this frame. This array must not
- * be modified. Its content has the same format as the "local" array.
- * @throw IllegalStateException if a frame is visited just after another
- * one, without any instruction between the two (unless this frame
- * is a Opcodes#F_SAME frame, in which case it is silently ignored).
- */
- void visitFrame(
- int type,
- int nLocal,
- Object[] local,
- int nStack,
- Object[] stack);
+ * <li>{@link Opcodes#F_CHOP} representing frame with current locals are the
+ * same as the locals in the previous frame, except that the last 1-3 locals
+ * are absent and with the empty stack (<code>nLocals</code> is 1, 2 or 3).</li>
+ * <li>{@link Opcodes#F_FULL} representing complete frame data.</li>
+ * </ul>
+ * </li>
+ * </ul>
+ * <br>
+ * In both cases the first frame, corresponding to the method's parameters
+ * and access flags, is implicit and must not be visited. Also, it is
+ * illegal to visit two or more frames for the same code location (i.e., at
+ * least one instruction must be visited between two calls to visitFrame).
+ *
+ * @param type
+ * the type of this stack map frame. Must be
+ * {@link Opcodes#F_NEW} for expanded frames, or
+ * {@link Opcodes#F_FULL}, {@link Opcodes#F_APPEND},
+ * {@link Opcodes#F_CHOP}, {@link Opcodes#F_SAME} or
+ * {@link Opcodes#F_APPEND}, {@link Opcodes#F_SAME1} for
+ * compressed frames.
+ * @param nLocal
+ * the number of local variables in the visited frame.
+ * @param local
+ * the local variable types in this frame. This array must not be
+ * modified. Primitive types are represented by
+ * {@link Opcodes#TOP}, {@link Opcodes#INTEGER},
+ * {@link Opcodes#FLOAT}, {@link Opcodes#LONG},
+ * {@link Opcodes#DOUBLE},{@link Opcodes#NULL} or
+ * {@link Opcodes#UNINITIALIZED_THIS} (long and double are
+ * represented by a single element). Reference types are
+ * represented by String objects (representing internal names),
+ * and uninitialized types by Label objects (this label
+ * designates the NEW instruction that created this uninitialized
+ * value).
+ * @param nStack
+ * the number of operand stack elements in the visited frame.
+ * @param stack
+ * the operand stack types in this frame. This array must not be
+ * modified. Its content has the same format as the "local"
+ * array.
+ * @throws IllegalStateException
+ * if a frame is visited just after another one, without any
+ * instruction between the two (unless this frame is a
+ * Opcodes#F_SAME frame, in which case it is silently ignored).
+ */
+ public void visitFrame(int type, int nLocal, Object[] local, int nStack,
+ Object[] stack) {
+ if (mv != null) {
+ mv.visitFrame(type, nLocal, local, nStack, stack);
+ }
+ }
// -------------------------------------------------------------------------
// Normal instructions
@@ -165,165 +319,389 @@ public interface MethodVisitor {
/**
* Visits a zero operand instruction.
*
- * @param opcode the opcode of the instruction to be visited. This opcode is
- * either NOP, ACONST_NULL, ICONST_M1, ICONST_0, ICONST_1, ICONST_2,
- * ICONST_3, ICONST_4, ICONST_5, LCONST_0, LCONST_1, FCONST_0,
- * FCONST_1, FCONST_2, DCONST_0, DCONST_1, IALOAD, LALOAD, FALOAD,
- * DALOAD, AALOAD, BALOAD, CALOAD, SALOAD, IASTORE, LASTORE, FASTORE,
- * DASTORE, AASTORE, BASTORE, CASTORE, SASTORE, POP, POP2, DUP,
- * DUP_X1, DUP_X2, DUP2, DUP2_X1, DUP2_X2, SWAP, IADD, LADD, FADD,
- * DADD, ISUB, LSUB, FSUB, DSUB, IMUL, LMUL, FMUL, DMUL, IDIV, LDIV,
- * FDIV, DDIV, IREM, LREM, FREM, DREM, INEG, LNEG, FNEG, DNEG, ISHL,
- * LSHL, ISHR, LSHR, IUSHR, LUSHR, IAND, LAND, IOR, LOR, IXOR, LXOR,
- * I2L, I2F, I2D, L2I, L2F, L2D, F2I, F2L, F2D, D2I, D2L, D2F, I2B,
- * I2C, I2S, LCMP, FCMPL, FCMPG, DCMPL, DCMPG, IRETURN, LRETURN,
- * FRETURN, DRETURN, ARETURN, RETURN, ARRAYLENGTH, ATHROW,
- * MONITORENTER, or MONITOREXIT.
+ * @param opcode
+ * the opcode of the instruction to be visited. This opcode is
+ * either NOP, ACONST_NULL, ICONST_M1, ICONST_0, ICONST_1,
+ * ICONST_2, ICONST_3, ICONST_4, ICONST_5, LCONST_0, LCONST_1,
+ * FCONST_0, FCONST_1, FCONST_2, DCONST_0, DCONST_1, IALOAD,
+ * LALOAD, FALOAD, DALOAD, AALOAD, BALOAD, CALOAD, SALOAD,
+ * IASTORE, LASTORE, FASTORE, DASTORE, AASTORE, BASTORE, CASTORE,
+ * SASTORE, POP, POP2, DUP, DUP_X1, DUP_X2, DUP2, DUP2_X1,
+ * DUP2_X2, SWAP, IADD, LADD, FADD, DADD, ISUB, LSUB, FSUB, DSUB,
+ * IMUL, LMUL, FMUL, DMUL, IDIV, LDIV, FDIV, DDIV, IREM, LREM,
+ * FREM, DREM, INEG, LNEG, FNEG, DNEG, ISHL, LSHL, ISHR, LSHR,
+ * IUSHR, LUSHR, IAND, LAND, IOR, LOR, IXOR, LXOR, I2L, I2F, I2D,
+ * L2I, L2F, L2D, F2I, F2L, F2D, D2I, D2L, D2F, I2B, I2C, I2S,
+ * LCMP, FCMPL, FCMPG, DCMPL, DCMPG, IRETURN, LRETURN, FRETURN,
+ * DRETURN, ARETURN, RETURN, ARRAYLENGTH, ATHROW, MONITORENTER,
+ * or MONITOREXIT.
*/
- void visitInsn(int opcode);
+ public void visitInsn(int opcode) {
+ if (mv != null) {
+ mv.visitInsn(opcode);
+ }
+ }
/**
* Visits an instruction with a single int operand.
*
- * @param opcode the opcode of the instruction to be visited. This opcode is
- * either BIPUSH, SIPUSH or NEWARRAY.
- * @param operand the operand of the instruction to be visited.<br> When
- * opcode is BIPUSH, operand value should be between Byte.MIN_VALUE
- * and Byte.MAX_VALUE.<br> When opcode is SIPUSH, operand value
- * should be between Short.MIN_VALUE and Short.MAX_VALUE.<br> When
- * opcode is NEWARRAY, operand value should be one of
- * {@link Opcodes#T_BOOLEAN}, {@link Opcodes#T_CHAR},
- * {@link Opcodes#T_FLOAT}, {@link Opcodes#T_DOUBLE},
- * {@link Opcodes#T_BYTE}, {@link Opcodes#T_SHORT},
- * {@link Opcodes#T_INT} or {@link Opcodes#T_LONG}.
+ * @param opcode
+ * the opcode of the instruction to be visited. This opcode is
+ * either BIPUSH, SIPUSH or NEWARRAY.
+ * @param operand
+ * the operand of the instruction to be visited.<br>
+ * When opcode is BIPUSH, operand value should be between
+ * Byte.MIN_VALUE and Byte.MAX_VALUE.<br>
+ * When opcode is SIPUSH, operand value should be between
+ * Short.MIN_VALUE and Short.MAX_VALUE.<br>
+ * When opcode is NEWARRAY, operand value should be one of
+ * {@link Opcodes#T_BOOLEAN}, {@link Opcodes#T_CHAR},
+ * {@link Opcodes#T_FLOAT}, {@link Opcodes#T_DOUBLE},
+ * {@link Opcodes#T_BYTE}, {@link Opcodes#T_SHORT},
+ * {@link Opcodes#T_INT} or {@link Opcodes#T_LONG}.
*/
- void visitIntInsn(int opcode, int operand);
+ public void visitIntInsn(int opcode, int operand) {
+ if (mv != null) {
+ mv.visitIntInsn(opcode, operand);
+ }
+ }
/**
* Visits a local variable instruction. A local variable instruction is an
* instruction that loads or stores the value of a local variable.
*
- * @param opcode the opcode of the local variable instruction to be visited.
- * This opcode is either ILOAD, LLOAD, FLOAD, DLOAD, ALOAD, ISTORE,
- * LSTORE, FSTORE, DSTORE, ASTORE or RET.
- * @param var the operand of the instruction to be visited. This operand is
- * the index of a local variable.
+ * @param opcode
+ * the opcode of the local variable instruction to be visited.
+ * This opcode is either ILOAD, LLOAD, FLOAD, DLOAD, ALOAD,
+ * ISTORE, LSTORE, FSTORE, DSTORE, ASTORE or RET.
+ * @param var
+ * the operand of the instruction to be visited. This operand is
+ * the index of a local variable.
*/
- void visitVarInsn(int opcode, int var);
+ public void visitVarInsn(int opcode, int var) {
+ if (mv != null) {
+ mv.visitVarInsn(opcode, var);
+ }
+ }
/**
* Visits a type instruction. A type instruction is an instruction that
* takes the internal name of a class as parameter.
*
- * @param opcode the opcode of the type instruction to be visited. This
- * opcode is either NEW, ANEWARRAY, CHECKCAST or INSTANCEOF.
- * @param type the operand of the instruction to be visited. This operand
- * must be the internal name of an object or array class (see {@link
- * Type#getInternalName() getInternalName}).
+ * @param opcode
+ * the opcode of the type instruction to be visited. This opcode
+ * is either NEW, ANEWARRAY, CHECKCAST or INSTANCEOF.
+ * @param type
+ * the operand of the instruction to be visited. This operand
+ * must be the internal name of an object or array class (see
+ * {@link Type#getInternalName() getInternalName}).
*/
- void visitTypeInsn(int opcode, String type);
+ public void visitTypeInsn(int opcode, String type) {
+ if (mv != null) {
+ mv.visitTypeInsn(opcode, type);
+ }
+ }
/**
* Visits a field instruction. A field instruction is an instruction that
* loads or stores the value of a field of an object.
*
- * @param opcode the opcode of the type instruction to be visited. This
- * opcode is either GETSTATIC, PUTSTATIC, GETFIELD or PUTFIELD.
- * @param owner the internal name of the field's owner class (see {@link
- * Type#getInternalName() getInternalName}).
- * @param name the field's name.
- * @param desc the field's descriptor (see {@link Type Type}).
+ * @param opcode
+ * the opcode of the type instruction to be visited. This opcode
+ * is either GETSTATIC, PUTSTATIC, GETFIELD or PUTFIELD.
+ * @param owner
+ * the internal name of the field's owner class (see
+ * {@link Type#getInternalName() getInternalName}).
+ * @param name
+ * the field's name.
+ * @param desc
+ * the field's descriptor (see {@link Type Type}).
*/
- void visitFieldInsn(int opcode, String owner, String name, String desc);
+ public void visitFieldInsn(int opcode, String owner, String name,
+ String desc) {
+ if (mv != null) {
+ mv.visitFieldInsn(opcode, owner, name, desc);
+ }
+ }
/**
* Visits a method instruction. A method instruction is an instruction that
* invokes a method.
*
- * @param opcode the opcode of the type instruction to be visited. This
- * opcode is either INVOKEVIRTUAL, INVOKESPECIAL, INVOKESTATIC,
- * INVOKEINTERFACE or INVOKEDYNAMIC.
- * @param owner the internal name of the method's owner class (see {@link
- * Type#getInternalName() getInternalName})
- * or {@link org.eclipse.persistence.internal.libraries.asm.Opcodes#INVOKEDYNAMIC_OWNER}.
- * @param name the method's name.
- * @param desc the method's descriptor (see {@link Type Type}).
+ * @param opcode
+ * the opcode of the type instruction to be visited. This opcode
+ * is either INVOKEVIRTUAL, INVOKESPECIAL, INVOKESTATIC or
+ * INVOKEINTERFACE.
+ * @param owner
+ * the internal name of the method's owner class (see
+ * {@link Type#getInternalName() getInternalName}).
+ * @param name
+ * the method's name.
+ * @param desc
+ * the method's descriptor (see {@link Type Type}).
*/
- void visitMethodInsn(int opcode, String owner, String name, String desc);
+ @Deprecated
+ public void visitMethodInsn(int opcode, String owner, String name,
+ String desc) {
+ if (api >= Opcodes.ASM5) {
+ boolean itf = opcode == Opcodes.INVOKEINTERFACE;
+ visitMethodInsn(opcode, owner, name, desc, itf);
+ return;
+ }
+ if (mv != null) {
+ mv.visitMethodInsn(opcode, owner, name, desc);
+ }
+ }
+
+ /**
+ * Visits a method instruction. A method instruction is an instruction that
+ * invokes a method.
+ *
+ * @param opcode
+ * the opcode of the type instruction to be visited. This opcode
+ * is either INVOKEVIRTUAL, INVOKESPECIAL, INVOKESTATIC or
+ * INVOKEINTERFACE.
+ * @param owner
+ * the internal name of the method's owner class (see
+ * {@link Type#getInternalName() getInternalName}).
+ * @param name
+ * the method's name.
+ * @param desc
+ * the method's descriptor (see {@link Type Type}).
+ * @param itf
+ * if the method's owner class is an interface.
+ */
+ public void visitMethodInsn(int opcode, String owner, String name,
+ String desc, boolean itf) {
+ if (api < Opcodes.ASM5) {
+ if (itf != (opcode == Opcodes.INVOKEINTERFACE)) {
+ throw new IllegalArgumentException(
+ "INVOKESPECIAL/STATIC on interfaces require ASM 5");
+ }
+ visitMethodInsn(opcode, owner, name, desc);
+ return;
+ }
+ if (mv != null) {
+ mv.visitMethodInsn(opcode, owner, name, desc, itf);
+ }
+ }
+
+ /**
+ * Visits an invokedynamic instruction.
+ *
+ * @param name
+ * the method's name.
+ * @param desc
+ * the method's descriptor (see {@link Type Type}).
+ * @param bsm
+ * the bootstrap method.
+ * @param bsmArgs
+ * the bootstrap method constant arguments. Each argument must be
+ * an {@link Integer}, {@link Float}, {@link Long},
+ * {@link Double}, {@link String}, {@link Type} or {@link Handle}
+ * value. This method is allowed to modify the content of the
+ * array so a caller should expect that this array may change.
+ */
+ public void visitInvokeDynamicInsn(String name, String desc, Handle bsm,
+ Object... bsmArgs) {
+ if (mv != null) {
+ mv.visitInvokeDynamicInsn(name, desc, bsm, bsmArgs);
+ }
+ }
/**
* Visits a jump instruction. A jump instruction is an instruction that may
* jump to another instruction.
*
- * @param opcode the opcode of the type instruction to be visited. This
- * opcode is either IFEQ, IFNE, IFLT, IFGE, IFGT, IFLE, IF_ICMPEQ,
- * IF_ICMPNE, IF_ICMPLT, IF_ICMPGE, IF_ICMPGT, IF_ICMPLE, IF_ACMPEQ,
- * IF_ACMPNE, GOTO, JSR, IFNULL or IFNONNULL.
- * @param label the operand of the instruction to be visited. This operand
- * is a label that designates the instruction to which the jump
- * instruction may jump.
+ * @param opcode
+ * the opcode of the type instruction to be visited. This opcode
+ * is either IFEQ, IFNE, IFLT, IFGE, IFGT, IFLE, IF_ICMPEQ,
+ * IF_ICMPNE, IF_ICMPLT, IF_ICMPGE, IF_ICMPGT, IF_ICMPLE,
+ * IF_ACMPEQ, IF_ACMPNE, GOTO, JSR, IFNULL or IFNONNULL.
+ * @param label
+ * the operand of the instruction to be visited. This operand is
+ * a label that designates the instruction to which the jump
+ * instruction may jump.
*/
- void visitJumpInsn(int opcode, Label label);
+ public void visitJumpInsn(int opcode, Label label) {
+ if (mv != null) {
+ mv.visitJumpInsn(opcode, label);
+ }
+ }
/**
* Visits a label. A label designates the instruction that will be visited
* just after it.
*
- * @param label a {@link Label Label} object.
+ * @param label
+ * a {@link Label Label} object.
*/
- void visitLabel(Label label);
+ public void visitLabel(Label label) {
+ if (mv != null) {
+ mv.visitLabel(label);
+ }
+ }
// -------------------------------------------------------------------------
// Special instructions
// -------------------------------------------------------------------------
/**
- * Visits a LDC instruction.
+ * Visits a LDC instruction. Note that new constant types may be added in
+ * future versions of the Java Virtual Machine. To easily detect new
+ * constant types, implementations of this method should check for
+ * unexpected constant types, like this:
+ *
+ * <pre>
+ * if (cst instanceof Integer) {
+ * // ...
+ * } else if (cst instanceof Float) {
+ * // ...
+ * } else if (cst instanceof Long) {
+ * // ...
+ * } else if (cst instanceof Double) {
+ * // ...
+ * } else if (cst instanceof String) {
+ * // ...
+ * } else if (cst instanceof Type) {
+ * int sort = ((Type) cst).getSort();
+ * if (sort == Type.OBJECT) {
+ * // ...
+ * } else if (sort == Type.ARRAY) {
+ * // ...
+ * } else if (sort == Type.METHOD) {
+ * // ...
+ * } else {
+ * // throw an exception
+ * }
+ * } else if (cst instanceof Handle) {
+ * // ...
+ * } else {
+ * // throw an exception
+ * }
+ * </pre>
*
- * @param cst the constant to be loaded on the stack. This parameter must be
- * a non null {@link Integer}, a {@link Float}, a {@link Long}, a
- * {@link Double} a {@link String} (or a {@link Type} for
- * <tt>.class</tt> constants, for classes whose version is 49.0 or
- * more).
+ * @param cst
+ * the constant to be loaded on the stack. This parameter must be
+ * a non null {@link Integer}, a {@link Float}, a {@link Long}, a
+ * {@link Double}, a {@link String}, a {@link Type} of OBJECT or
+ * ARRAY sort for <tt>.class</tt> constants, for classes whose
+ * version is 49.0, a {@link Type} of METHOD sort or a
+ * {@link Handle} for MethodType and MethodHandle constants, for
+ * classes whose version is 51.0.
*/
- void visitLdcInsn(Object cst);
+ public void visitLdcInsn(Object cst) {
+ if (mv != null) {
+ mv.visitLdcInsn(cst);
+ }
+ }
/**
* Visits an IINC instruction.
*
- * @param var index of the local variable to be incremented.
- * @param increment amount to increment the local variable by.
+ * @param var
+ * index of the local variable to be incremented.
+ * @param increment
+ * amount to increment the local variable by.
*/
- void visitIincInsn(int var, int increment);
+ public void visitIincInsn(int var, int increment) {
+ if (mv != null) {
+ mv.visitIincInsn(var, increment);
+ }
+ }
/**
* Visits a TABLESWITCH instruction.
*
- * @param min the minimum key value.
- * @param max the maximum key value.
- * @param dflt beginning of the default handler block.
- * @param labels beginnings of the handler blocks. <tt>labels[i]</tt> is
- * the beginning of the handler block for the <tt>min + i</tt> key.
+ * @param min
+ * the minimum key value.
+ * @param max
+ * the maximum key value.
+ * @param dflt
+ * beginning of the default handler block.
+ * @param labels
+ * beginnings of the handler blocks. <tt>labels[i]</tt> is the
+ * beginning of the handler block for the <tt>min + i</tt> key.
*/
- void visitTableSwitchInsn(int min, int max, Label dflt, Label[] labels);
+ public void visitTableSwitchInsn(int min, int max, Label dflt,
+ Label... labels) {
+ if (mv != null) {
+ mv.visitTableSwitchInsn(min, max, dflt, labels);
+ }
+ }
/**
* Visits a LOOKUPSWITCH instruction.
*
- * @param dflt beginning of the default handler block.
- * @param keys the values of the keys.
- * @param labels beginnings of the handler blocks. <tt>labels[i]</tt> is
- * the beginning of the handler block for the <tt>keys[i]</tt> key.
+ * @param dflt
+ * beginning of the default handler block.
+ * @param keys
+ * the values of the keys.
+ * @param labels
+ * beginnings of the handler blocks. <tt>labels[i]</tt> is the
+ * beginning of the handler block for the <tt>keys[i]</tt> key.
*/
- void visitLookupSwitchInsn(Label dflt, int[] keys, Label[] labels);
+ public void visitLookupSwitchInsn(Label dflt, int[] keys, Label[] labels) {
+ if (mv != null) {
+ mv.visitLookupSwitchInsn(dflt, keys, labels);
+ }
+ }
/**
* Visits a MULTIANEWARRAY instruction.
*
- * @param desc an array type descriptor (see {@link Type Type}).
- * @param dims number of dimensions of the array to allocate.
+ * @param desc
+ * an array type descriptor (see {@link Type Type}).
+ * @param dims
+ * number of dimensions of the array to allocate.
+ */
+ public void visitMultiANewArrayInsn(String desc, int dims) {
+ if (mv != null) {
+ mv.visitMultiANewArrayInsn(desc, dims);
+ }
+ }
+
+ /**
+ * Visits an annotation on an instruction. This method must be called just
+ * <i>after</i> the annotated instruction. It can be called several times
+ * for the same instruction.
+ *
+ * @param typeRef
+ * a reference to the annotated type. The sort of this type
+ * reference must be {@link TypeReference#INSTANCEOF INSTANCEOF},
+ * {@link TypeReference#NEW NEW},
+ * {@link TypeReference#CONSTRUCTOR_REFERENCE
+ * CONSTRUCTOR_REFERENCE}, {@link TypeReference#METHOD_REFERENCE
+ * METHOD_REFERENCE}, {@link TypeReference#CAST CAST},
+ * {@link TypeReference#CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT
+ * CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT},
+ * {@link TypeReference#METHOD_INVOCATION_TYPE_ARGUMENT
+ * METHOD_INVOCATION_TYPE_ARGUMENT},
+ * {@link TypeReference#CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT
+ * CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT}, or
+ * {@link TypeReference#METHOD_REFERENCE_TYPE_ARGUMENT
+ * METHOD_REFERENCE_TYPE_ARGUMENT}. See {@link TypeReference}.
+ * @param typePath
+ * the path to the annotated type argument, wildcard bound, array
+ * element type, or static inner type within 'typeRef'. May be
+ * <tt>null</tt> if the annotation targets 'typeRef' as a whole.
+ * @param desc
+ * the class descriptor of the annotation class.
+ * @param visible
+ * <tt>true</tt> if the annotation is visible at runtime.
+ * @return a visitor to visit the annotation values, or <tt>null</tt> if
+ * this visitor is not interested in visiting this annotation.
*/
- void visitMultiANewArrayInsn(String desc, int dims);
+ public AnnotationVisitor visitInsnAnnotation(int typeRef,
+ TypePath typePath, String desc, boolean visible) {
+ if (api < Opcodes.ASM5) {
+ throw new RuntimeException();
+ }
+ if (mv != null) {
+ return mv.visitInsnAnnotation(typeRef, typePath, desc, visible);
+ }
+ return null;
+ }
// -------------------------------------------------------------------------
// Exceptions table entries, debug information, max stack and max locals
@@ -332,68 +710,172 @@ public interface MethodVisitor {
/**
* Visits a try catch block.
*
- * @param start beginning of the exception handler's scope (inclusive).
- * @param end end of the exception handler's scope (exclusive).
- * @param handler beginning of the exception handler's code.
- * @param type internal name of the type of exceptions handled by the
- * handler, or <tt>null</tt> to catch any exceptions (for "finally"
- * blocks).
- * @throws IllegalArgumentException if one of the labels has already been
- * visited by this visitor (by the {@link #visitLabel visitLabel}
- * method).
+ * @param start
+ * beginning of the exception handler's scope (inclusive).
+ * @param end
+ * end of the exception handler's scope (exclusive).
+ * @param handler
+ * beginning of the exception handler's code.
+ * @param type
+ * internal name of the type of exceptions handled by the
+ * handler, or <tt>null</tt> to catch any exceptions (for
+ * "finally" blocks).
+ * @throws IllegalArgumentException
+ * if one of the labels has already been visited by this visitor
+ * (by the {@link #visitLabel visitLabel} method).
+ */
+ public void visitTryCatchBlock(Label start, Label end, Label handler,
+ String type) {
+ if (mv != null) {
+ mv.visitTryCatchBlock(start, end, handler, type);
+ }
+ }
+
+ /**
+ * Visits an annotation on an exception handler type. This method must be
+ * called <i>after</i> the {@link #visitTryCatchBlock} for the annotated
+ * exception handler. It can be called several times for the same exception
+ * handler.
+ *
+ * @param typeRef
+ * a reference to the annotated type. The sort of this type
+ * reference must be {@link TypeReference#EXCEPTION_PARAMETER
+ * EXCEPTION_PARAMETER}. See {@link TypeReference}.
+ * @param typePath
+ * the path to the annotated type argument, wildcard bound, array
+ * element type, or static inner type within 'typeRef'. May be
+ * <tt>null</tt> if the annotation targets 'typeRef' as a whole.
+ * @param desc
+ * the class descriptor of the annotation class.
+ * @param visible
+ * <tt>true</tt> if the annotation is visible at runtime.
+ * @return a visitor to visit the annotation values, or <tt>null</tt> if
+ * this visitor is not interested in visiting this annotation.
*/
- void visitTryCatchBlock(Label start, Label end, Label handler, String type);
+ public AnnotationVisitor visitTryCatchAnnotation(int typeRef,
+ TypePath typePath, String desc, boolean visible) {
+ if (api < Opcodes.ASM5) {
+ throw new RuntimeException();
+ }
+ if (mv != null) {
+ return mv.visitTryCatchAnnotation(typeRef, typePath, desc, visible);
+ }
+ return null;
+ }
/**
* Visits a local variable declaration.
*
- * @param name the name of a local variable.
- * @param desc the type descriptor of this local variable.
- * @param signature the type signature of this local variable. May be
- * <tt>null</tt> if the local variable type does not use generic
- * types.
- * @param start the first instruction corresponding to the scope of this
- * local variable (inclusive).
- * @param end the last instruction corresponding to the scope of this local
- * variable (exclusive).
- * @param index the local variable's index.
- * @throws IllegalArgumentException if one of the labels has not already
- * been visited by this visitor (by the
- * {@link #visitLabel visitLabel} method).
- */
- void visitLocalVariable(
- String name,
- String desc,
- String signature,
- Label start,
- Label end,
- int index);
+ * @param name
+ * the name of a local variable.
+ * @param desc
+ * the type descriptor of this local variable.
+ * @param signature
+ * the type signature of this local variable. May be
+ * <tt>null</tt> if the local variable type does not use generic
+ * types.
+ * @param start
+ * the first instruction corresponding to the scope of this local
+ * variable (inclusive).
+ * @param end
+ * the last instruction corresponding to the scope of this local
+ * variable (exclusive).
+ * @param index
+ * the local variable's index.
+ * @throws IllegalArgumentException
+ * if one of the labels has not already been visited by this
+ * visitor (by the {@link #visitLabel visitLabel} method).
+ */
+ public void visitLocalVariable(String name, String desc, String signature,
+ Label start, Label end, int index) {
+ if (mv != null) {
+ mv.visitLocalVariable(name, desc, signature, start, end, index);
+ }
+ }
+
+ /**
+ * Visits an annotation on a local variable type.
+ *
+ * @param typeRef
+ * a reference to the annotated type. The sort of this type
+ * reference must be {@link TypeReference#LOCAL_VARIABLE
+ * LOCAL_VARIABLE} or {@link TypeReference#RESOURCE_VARIABLE
+ * RESOURCE_VARIABLE}. See {@link TypeReference}.
+ * @param typePath
+ * the path to the annotated type argument, wildcard bound, array
+ * element type, or static inner type within 'typeRef'. May be
+ * <tt>null</tt> if the annotation targets 'typeRef' as a whole.
+ * @param start
+ * the fist instructions corresponding to the continuous ranges
+ * that make the scope of this local variable (inclusive).
+ * @param end
+ * the last instructions corresponding to the continuous ranges
+ * that make the scope of this local variable (exclusive). This
+ * array must have the same size as the 'start' array.
+ * @param index
+ * the local variable's index in each range. This array must have
+ * the same size as the 'start' array.
+ * @param desc
+ * the class descriptor of the annotation class.
+ * @param visible
+ * <tt>true</tt> if the annotation is visible at runtime.
+ * @return a visitor to visit the annotation values, or <tt>null</tt> if
+ * this visitor is not interested in visiting this annotation.
+ */
+ public AnnotationVisitor visitLocalVariableAnnotation(int typeRef,
+ TypePath typePath, Label[] start, Label[] end, int[] index,
+ String desc, boolean visible) {
+ if (api < Opcodes.ASM5) {
+ throw new RuntimeException();
+ }
+ if (mv != null) {
+ return mv.visitLocalVariableAnnotation(typeRef, typePath, start,
+ end, index, desc, visible);
+ }
+ return null;
+ }
/**
* Visits a line number declaration.
*
- * @param line a line number. This number refers to the source file from
- * which the class was compiled.
- * @param start the first instruction corresponding to this line number.
- * @throws IllegalArgumentException if <tt>start</tt> has not already been
- * visited by this visitor (by the {@link #visitLabel visitLabel}
- * method).
+ * @param line
+ * a line number. This number refers to the source file from
+ * which the class was compiled.
+ * @param start
+ * the first instruction corresponding to this line number.
+ * @throws IllegalArgumentException
+ * if <tt>start</tt> has not already been visited by this
+ * visitor (by the {@link #visitLabel visitLabel} method).
*/
- void visitLineNumber(int line, Label start);
+ public void visitLineNumber(int line, Label start) {
+ if (mv != null) {
+ mv.visitLineNumber(line, start);
+ }
+ }
/**
* Visits the maximum stack size and the maximum number of local variables
* of the method.
*
- * @param maxStack maximum stack size of the method.
- * @param maxLocals maximum number of local variables for the method.
+ * @param maxStack
+ * maximum stack size of the method.
+ * @param maxLocals
+ * maximum number of local variables for the method.
*/
- void visitMaxs(int maxStack, int maxLocals);
+ public void visitMaxs(int maxStack, int maxLocals) {
+ if (mv != null) {
+ mv.visitMaxs(maxStack, maxLocals);
+ }
+ }
/**
* Visits the end of the method. This method, which is the last one to be
* called, is used to inform the visitor that all the annotations and
* attributes of the method have been visited.
*/
- void visitEnd();
+ public void visitEnd() {
+ if (mv != null) {
+ mv.visitEnd();
+ }
+ }
}
diff --git a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/MethodWriter.java b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/MethodWriter.java
index e6bcd79..9cd47ec 100644
--- a/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/MethodWriter.java
+++ b/plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/MethodWriter.java
@@ -1,6 +1,6 @@
/***
* ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2007 INRIA, France Telecom
+ * Copyright (c) 2000-2011 INRIA, France Telecom
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,6 +29,7 @@
*/
package org.eclipse.persistence.internal.libraries.asm;
+
/**
* A {@link MethodVisitor} that generates methods in bytecode form. Each visit
* method of this class appends the bytecode corresponding to the visited
@@ -37,12 +38,12 @@ package org.eclipse.persistence.internal.libraries.asm;
* @author Eric Bruneton
* @author Eugene Kuleshov
*/
-class MethodWriter implements MethodVisitor {
+class MethodWriter extends MethodVisitor {
/**
* Pseudo access flag used to denote constructors.
*/
- static final int ACC_CONSTRUCTOR = 262144;
+ static final int ACC_CONSTRUCTOR = 0x80000;
/**
* Frame has exactly the same locals as the previous stack map frame and
@@ -117,11 +118,6 @@ class MethodWriter implements MethodVisitor {
private static final int NOTHING = 2;
/**
- * Next method writer (see {@link ClassWriter#firstMethod firstMethod}).
- */
- MethodWriter next;
-
- /**
* The class writer to which this method must be added.
*/
final ClassWriter cw;
@@ -197,6 +193,18 @@ class MethodWriter implements MethodVisitor {
private AnnotationWriter ianns;
/**
+ * The runtime visible type annotations of this method. May be <tt>null</tt>
+ * .
+ */
+ private AnnotationWriter tanns;
+
+ /**
+ * The runtime invisible type annotations of this method. May be
+ * <tt>null</tt>.
+ */
+ private AnnotationWriter itanns;
+
+ /**
* The runtime visible parameter annotations of this method. May be
* <tt>null</tt>.
*/
@@ -234,6 +242,11 @@ class MethodWriter implements MethodVisitor {
private int maxLocals;
/**
+ * Number of local variables in the current stack map frame.
+ */
+ private int currentLocals;
+
+ /**
* Number of stack map frames in the StackMapTable attribute.
*/
private int frameCount;
@@ -257,11 +270,6 @@ class MethodWriter implements MethodVisitor {
private int[] previousFrame;
/**
- * Index of the next element to be added in {@link #frame}.
- */
- private int frameIndex;
-
- /**
* The current stack map frame. The first element contains the offset of the
* instruction to which the frame corresponds, the second element is the
* number of locals and the third one is the number of stack elements. The
@@ -288,6 +296,16 @@ class MethodWriter implements MethodVisitor {
private Handler lastHandler;
/**
+ * Number of entries in the MethodParameters attribute.
+ */
+ private int methodParametersCount;
+
+ /**
+ * The MethodParameters attribute.
+ */
+ private ByteVector methodParameters;
+
+ /**
* Number of entries in the LocalVariableTable attribute.
*/
private int localVarCount;
@@ -318,6 +336,21 @@ class MethodWriter implements MethodVisitor {
private ByteVector lineNumber;
/**
+ * The start offset of the last visited instruction.
+ */
+ private int lastCodeOffset;
+
+ /**
+ * The runtime visible type annotations of the code. May be <tt>null</tt>.
+ */
+ private AnnotationWriter ctanns;
+
+ /**
+ * The runtime invisible type annotations of the code. May be <tt>null</tt>.
+ */
+ private AnnotationWriter ictanns;
+
+ /**
* The non standard attributes of the method's code.
*/
private Attribute cattrs;
@@ -357,7 +390,8 @@ class MethodWriter implements MethodVisitor {
* A list of labels. This list is the list of basic blocks in the method,
* i.e. a list of Label objects linked to each other by their
* {@link Label#successor} field, in the order they are visited by
- * {@link MethodVisitor#visitLabel}, and starting with the first basic block.
+ * {@link MethodVisitor#visitLabel}, and starting with the first basic
+ * block.
*/
private Label labels;
@@ -396,36 +430,42 @@ class MethodWriter implements MethodVisitor {
/**
* Constructs a new {@link MethodWriter}.
*
- * @param cw the class writer in which the method must be added.
- * @param access the method's access flags (see {@link Opcodes}).
- * @param name the method's name.
- * @param desc the method's descriptor (see {@link Type}).
- * @param signature the method's signature. May be <tt>null</tt>.
- * @param exceptions the internal names of the method's exceptions. May be
- * <tt>null</tt>.
- * @param computeMaxs <tt>true</tt> if the maximum stack size and number
- * of local variables must be automatically computed.
- * @param computeFrames <tt>true</tt> if the stack map tables must be
- * recomputed from scratch.
- */
- MethodWriter(
- final ClassWriter cw,
- final int access,
- final String name,
- final String desc,
- final String signature,
- final String[] exceptions,
- final boolean computeMaxs,
- final boolean computeFrames)
- {
+ * @param cw
+ * the class writer in which the method must be added.
+ * @param access
+ * the method's access flags (see {@link Opcodes}).
+ * @param name
+ * the method's name.
+ * @param desc
+ * the method's descriptor (see {@link Type}).
+ * @param signature
+ * the method's signature. May be <tt>null</tt>.
+ * @param exceptions
+ * the internal names of the method's exceptions. May be
+ * <tt>null</tt>.
+ * @param computeMaxs
+ * <tt>true</tt> if the maximum stack size and number of local
+ * variables must be automatically computed.
+ * @param computeFrames
+ * <tt>true</tt> if the stack map tables must be recomputed from
+ * scratch.
+ */
+ MethodWriter(final ClassWriter cw, final int access, final String name,
+ final String desc, final String signature,
+ final String[] exceptions, final boolean computeMaxs,
+ final boolean computeFrames) {
+ super(Opcodes.ASM5);
if (cw.firstMethod == null) {
cw.firstMethod = this;
} else {
- cw.lastMethod.next = this;
+ cw.lastMethod.mv = this;
}
cw.lastMethod = this;
this.cw = cw;
this.access = access;
+ if ("<init>".equals(name)) {
+ this.access |= ACC_CONSTRUCTOR;
+ }
this.name = cw.newUTF8(name);
this.desc = cw.newUTF8(desc);
this.descriptor = desc;
@@ -441,15 +481,13 @@ class MethodWriter implements MethodVisitor {
}
this.compute = computeFrames ? FRAMES : (computeMaxs ? MAXS : NOTHING);
if (computeMaxs || computeFrames) {
- if (computeFrames && "<init>".equals(name)) {
- this.access |= ACC_CONSTRUCTOR;
- }
// updates maxLocals
int size = Type.getArgumentsAndReturnSizes(descriptor) >> 2;
if ((access & Opcodes.ACC_STATIC) != 0) {
--size;
}
maxLocals = size;
+ currentLocals = size;
// creates and visits the label for the first basic block
labels = new Label();
labels.status |= Label.PUSHED;
@@ -458,9 +496,20 @@ class MethodWriter implements MethodVisitor {
}
// ------------------------------------------------------------------------
- // Implementation of the MethodVisitor interface
+ // Implementation of the MethodVisitor abstract class
// ------------------------------------------------------------------------
+ @Override
+ public void visitParameter(String name, int access) {
+ if (methodParameters == null) {
+ methodParameters = new ByteVector();
+ }
+ ++methodParametersCount;
+ methodParameters.putShort((name == null) ? 0 : cw.newUTF8(name))
+ .putShort(access);
+ }
+
+ @Override
public AnnotationVisitor visitAnnotationDefault() {
if (!ClassReader.ANNOTATIONS) {
return null;
@@ -469,10 +518,9 @@ class MethodWriter implements MethodVisitor {
return new AnnotationWriter(cw, false, annd, null, 0);
}
- public AnnotationVisitor visitAnnotation(
- final String desc,
- final boolean visible)
- {
+ @Override
+ public AnnotationVisitor visitAnnotation(final String desc,
+ final boolean visible) {
if (!ClassReader.ANNOTATIONS) {
return null;
}
@@ -490,11 +538,32 @@ class MethodWriter implements MethodVisitor {
return aw;
}
- public AnnotationVisitor visitParameterAnnotation(
- final int parameter,
- final String desc,
- final boolean visible)
- {
+ @Override
+ public AnnotationVisitor visitTypeAnnotation(final int typeRef,
+ final TypePath typePath, final String desc, final boolean visible) {
+ if (!ClassReader.ANNOTATIONS) {
+ return null;
+ }
+ ByteVector bv = new ByteVector();
+ // write target_type and target_info
+ AnnotationWriter.putTarget(typeRef, typePath, bv);
+ // write type, and reserve space for values count
+ bv.putShort(cw.newUTF8(desc)).putShort(0);
+ AnnotationWriter aw = new AnnotationWriter(cw, true, bv, bv,
+ bv.length - 2);
+ if (visible) {
+ aw.next = tanns;
+ tanns = aw;
+ } else {
+ aw.next = itanns;
+ itanns = aw;
+ }
+ return aw;
+ }
+
+ @Override
+ public AnnotationVisitor visitParameterAnnotation(final int parameter,
+ final String desc, final boolean visible) {
if (!ClassReader.ANNOTATIONS) {
return null;
}
@@ -524,6 +593,7 @@ class MethodWriter implements MethodVisitor {
return aw;
}
+ @Override
public void visitAttribute(final Attribute attr) {
if (attr.isCodeAttribute()) {
attr.next = cattrs;
@@ -534,22 +604,23 @@ class MethodWriter implements MethodVisitor {
}
}
+ @Override
public void visitCode() {
}
- public void visitFrame(
- final int type,
- final int nLocal,
- final Object[] local,
- final int nStack,
- final Object[] stack)
- {
+ @Override
+ public void visitFrame(final int type, final int nLocal,
+ final Object[] local, final int nStack, final Object[] stack) {
if (!ClassReader.FRAMES || compute == FRAMES) {
return;
}
if (type == Opcodes.F_NEW) {
- startFrame(code.length, nLocal, nStack);