├── .asf.yaml ├── .github ├── GH-ROBOTS.txt ├── dependabot.yml ├── pull_request_template.md └── workflows │ ├── codeql-analysis.yml │ ├── dependency-review.yml │ ├── maven.yml │ └── scorecards-analysis.yml ├── .gitignore ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE.txt ├── NOTICE.txt ├── README.md ├── RELEASE-NOTES.txt ├── SECURITY.md ├── TODO.JustIce ├── docs ├── classfile.mdl ├── eps │ ├── classfile.fig │ ├── classgen.fig │ ├── classloader.fig │ ├── constantpool.fig │ ├── diagram.fig │ ├── il.fig │ ├── instructions.fig │ ├── javaclass.fig │ └── jvm.fig ├── generic.mdl ├── manual.bib └── verifier │ ├── GNUmakefile │ ├── GUI1.eps │ ├── GUI2.eps │ ├── JustIce.lyx │ ├── V_API_SD.eps │ ├── VennDiag.eps │ ├── VerificationAPI.bmp │ ├── VerificationAPI.eps │ ├── chap1.bmp │ ├── chap1.eps │ ├── classfile.eps │ ├── conventcfg.bmp │ ├── conventcfg.eps │ ├── exframe.bmp │ ├── exframe.eps │ ├── justicecfg.bmp │ └── justicecfg.eps ├── pom.xml └── src ├── assembly ├── bin.xml └── src.xml ├── changes ├── changes.xml └── release-notes.vm ├── conf ├── checkstyle │ ├── checkstyle-header.txt │ ├── checkstyle-suppressions.xml │ └── checkstyle.xml ├── pmd-ruleset.xml └── spotbugs-exclude-filter.xml ├── examples ├── ClassDumper.java ├── HelloWorldBuilder.java ├── Helloify.java ├── Id.java ├── JasminVisitor.java ├── ListClass.java ├── MaxStack.java ├── Mini │ ├── ASCII_CharStream.java │ ├── ASTExpr.java │ ├── ASTFactor.java │ ├── ASTFunAppl.java │ ├── ASTFunDecl.java │ ├── ASTIdent.java │ ├── ASTIfExpr.java │ ├── ASTInteger.java │ ├── ASTLetExpr.java │ ├── ASTProgram.java │ ├── ASTTerm.java │ ├── EnvEntry.java │ ├── Environment.java │ ├── Function.java │ ├── JJTMiniParserState.java │ ├── Mini.bnf │ ├── Mini.jj │ ├── Mini.jjt │ ├── MiniC.java │ ├── MiniParser$JJCalls │ ├── MiniParser.java │ ├── MiniParserConstants.java │ ├── MiniParserTokenManager.java │ ├── MiniParserTreeConstants.java │ ├── Node.java │ ├── ParseException.java │ ├── README │ ├── SimpleNode.java │ ├── Token.java │ ├── TokenMgrError.java │ ├── Variable.java │ ├── fac.mini │ ├── fib.mini │ └── max.mini ├── Package.java ├── PatchClass.java ├── Peephole.java ├── ProxyCreator.java └── TransitiveHull.java ├── main └── java │ └── org │ └── apache │ └── bcel │ ├── Const.java │ ├── Constants.java │ ├── ExceptionConst.java │ ├── ExceptionConstants.java │ ├── Repository.java │ ├── classfile │ ├── AccessFlags.java │ ├── AnnotationDefault.java │ ├── AnnotationElementValue.java │ ├── AnnotationEntry.java │ ├── Annotations.java │ ├── ArrayElementValue.java │ ├── Attribute.java │ ├── AttributeReader.java │ ├── BootstrapMethod.java │ ├── BootstrapMethods.java │ ├── ClassElementValue.java │ ├── ClassFormatException.java │ ├── ClassParser.java │ ├── Code.java │ ├── CodeException.java │ ├── Constant.java │ ├── ConstantCP.java │ ├── ConstantClass.java │ ├── ConstantDouble.java │ ├── ConstantDynamic.java │ ├── ConstantFieldref.java │ ├── ConstantFloat.java │ ├── ConstantInteger.java │ ├── ConstantInterfaceMethodref.java │ ├── ConstantInvokeDynamic.java │ ├── ConstantLong.java │ ├── ConstantMethodHandle.java │ ├── ConstantMethodType.java │ ├── ConstantMethodref.java │ ├── ConstantModule.java │ ├── ConstantNameAndType.java │ ├── ConstantObject.java │ ├── ConstantPackage.java │ ├── ConstantPool.java │ ├── ConstantString.java │ ├── ConstantUtf8.java │ ├── ConstantValue.java │ ├── Deprecated.java │ ├── DescendingVisitor.java │ ├── ElementValue.java │ ├── ElementValuePair.java │ ├── EmptyVisitor.java │ ├── EnclosingMethod.java │ ├── EnumElementValue.java │ ├── ExceptionTable.java │ ├── Field.java │ ├── FieldOrMethod.java │ ├── InnerClass.java │ ├── InnerClasses.java │ ├── InvalidMethodSignatureException.java │ ├── JavaClass.java │ ├── LineNumber.java │ ├── LineNumberTable.java │ ├── LocalVariable.java │ ├── LocalVariableTable.java │ ├── LocalVariableTypeTable.java │ ├── Method.java │ ├── MethodParameter.java │ ├── MethodParameters.java │ ├── Module.java │ ├── ModuleExports.java │ ├── ModuleMainClass.java │ ├── ModuleOpens.java │ ├── ModulePackages.java │ ├── ModuleProvides.java │ ├── ModuleRequires.java │ ├── NestHost.java │ ├── NestMembers.java │ ├── Node.java │ ├── PMGClass.java │ ├── ParameterAnnotationEntry.java │ ├── ParameterAnnotations.java │ ├── Record.java │ ├── RecordComponentInfo.java │ ├── RuntimeInvisibleAnnotations.java │ ├── RuntimeInvisibleParameterAnnotations.java │ ├── RuntimeVisibleAnnotations.java │ ├── RuntimeVisibleParameterAnnotations.java │ ├── Signature.java │ ├── SimpleElementValue.java │ ├── SourceFile.java │ ├── StackMap.java │ ├── StackMapEntry.java │ ├── StackMapType.java │ ├── Synthetic.java │ ├── Unknown.java │ ├── UnknownAttributeReader.java │ ├── Utility.java │ ├── Visitor.java │ └── package-info.java │ ├── generic │ ├── AALOAD.java │ ├── AASTORE.java │ ├── ACONST_NULL.java │ ├── ALOAD.java │ ├── ANEWARRAY.java │ ├── ARETURN.java │ ├── ARRAYLENGTH.java │ ├── ASTORE.java │ ├── ATHROW.java │ ├── AllocationInstruction.java │ ├── AnnotationElementValueGen.java │ ├── AnnotationEntryGen.java │ ├── ArithmeticInstruction.java │ ├── ArrayElementValueGen.java │ ├── ArrayInstruction.java │ ├── ArrayType.java │ ├── BALOAD.java │ ├── BASTORE.java │ ├── BIPUSH.java │ ├── BREAKPOINT.java │ ├── BasicType.java │ ├── BranchHandle.java │ ├── BranchInstruction.java │ ├── CALOAD.java │ ├── CASTORE.java │ ├── CHECKCAST.java │ ├── CPInstruction.java │ ├── ClassElementValueGen.java │ ├── ClassGen.java │ ├── ClassGenException.java │ ├── ClassObserver.java │ ├── CodeExceptionGen.java │ ├── CompoundInstruction.java │ ├── ConstantPoolGen.java │ ├── ConstantPushInstruction.java │ ├── ConversionInstruction.java │ ├── D2F.java │ ├── D2I.java │ ├── D2L.java │ ├── DADD.java │ ├── DALOAD.java │ ├── DASTORE.java │ ├── DCMPG.java │ ├── DCMPL.java │ ├── DCONST.java │ ├── DDIV.java │ ├── DLOAD.java │ ├── DMUL.java │ ├── DNEG.java │ ├── DREM.java │ ├── DRETURN.java │ ├── DSTORE.java │ ├── DSUB.java │ ├── DUP.java │ ├── DUP2.java │ ├── DUP2_X1.java │ ├── DUP2_X2.java │ ├── DUP_X1.java │ ├── DUP_X2.java │ ├── ElementValueGen.java │ ├── ElementValuePairGen.java │ ├── EmptyVisitor.java │ ├── EnumElementValueGen.java │ ├── ExceptionThrower.java │ ├── F2D.java │ ├── F2I.java │ ├── F2L.java │ ├── FADD.java │ ├── FALOAD.java │ ├── FASTORE.java │ ├── FCMPG.java │ ├── FCMPL.java │ ├── FCONST.java │ ├── FDIV.java │ ├── FLOAD.java │ ├── FMUL.java │ ├── FNEG.java │ ├── FREM.java │ ├── FRETURN.java │ ├── FSTORE.java │ ├── FSUB.java │ ├── FieldGen.java │ ├── FieldGenOrMethodGen.java │ ├── FieldInstruction.java │ ├── FieldObserver.java │ ├── FieldOrMethod.java │ ├── GETFIELD.java │ ├── GETSTATIC.java │ ├── GOTO.java │ ├── GOTO_W.java │ ├── GotoInstruction.java │ ├── I2B.java │ ├── I2C.java │ ├── I2D.java │ ├── I2F.java │ ├── I2L.java │ ├── I2S.java │ ├── IADD.java │ ├── IALOAD.java │ ├── IAND.java │ ├── IASTORE.java │ ├── ICONST.java │ ├── IDIV.java │ ├── IFEQ.java │ ├── IFGE.java │ ├── IFGT.java │ ├── IFLE.java │ ├── IFLT.java │ ├── IFNE.java │ ├── IFNONNULL.java │ ├── IFNULL.java │ ├── IF_ACMPEQ.java │ ├── IF_ACMPNE.java │ ├── IF_ICMPEQ.java │ ├── IF_ICMPGE.java │ ├── IF_ICMPGT.java │ ├── IF_ICMPLE.java │ ├── IF_ICMPLT.java │ ├── IF_ICMPNE.java │ ├── IINC.java │ ├── ILOAD.java │ ├── IMPDEP1.java │ ├── IMPDEP2.java │ ├── IMUL.java │ ├── INEG.java │ ├── INSTANCEOF.java │ ├── INVOKEDYNAMIC.java │ ├── INVOKEINTERFACE.java │ ├── INVOKESPECIAL.java │ ├── INVOKESTATIC.java │ ├── INVOKEVIRTUAL.java │ ├── IOR.java │ ├── IREM.java │ ├── IRETURN.java │ ├── ISHL.java │ ├── ISHR.java │ ├── ISTORE.java │ ├── ISUB.java │ ├── IUSHR.java │ ├── IXOR.java │ ├── IfInstruction.java │ ├── IndexedInstruction.java │ ├── Instruction.java │ ├── InstructionComparator.java │ ├── InstructionConst.java │ ├── InstructionConstants.java │ ├── InstructionFactory.java │ ├── InstructionHandle.java │ ├── InstructionList.java │ ├── InstructionListObserver.java │ ├── InstructionTargeter.java │ ├── InvokeInstruction.java │ ├── JSR.java │ ├── JSR_W.java │ ├── JsrInstruction.java │ ├── L2D.java │ ├── L2F.java │ ├── L2I.java │ ├── LADD.java │ ├── LALOAD.java │ ├── LAND.java │ ├── LASTORE.java │ ├── LCMP.java │ ├── LCONST.java │ ├── LDC.java │ ├── LDC2_W.java │ ├── LDC_W.java │ ├── LDIV.java │ ├── LLOAD.java │ ├── LMUL.java │ ├── LNEG.java │ ├── LOOKUPSWITCH.java │ ├── LOR.java │ ├── LREM.java │ ├── LRETURN.java │ ├── LSHL.java │ ├── LSHR.java │ ├── LSTORE.java │ ├── LSUB.java │ ├── LUSHR.java │ ├── LXOR.java │ ├── LineNumberGen.java │ ├── LoadClass.java │ ├── LoadInstruction.java │ ├── LocalVariableGen.java │ ├── LocalVariableInstruction.java │ ├── MONITORENTER.java │ ├── MONITOREXIT.java │ ├── MULTIANEWARRAY.java │ ├── MethodGen.java │ ├── MethodObserver.java │ ├── NEW.java │ ├── NEWARRAY.java │ ├── NOP.java │ ├── NameSignatureInstruction.java │ ├── NamedAndTyped.java │ ├── ObjectType.java │ ├── POP.java │ ├── POP2.java │ ├── PUSH.java │ ├── PUTFIELD.java │ ├── PUTSTATIC.java │ ├── PopInstruction.java │ ├── PushInstruction.java │ ├── RET.java │ ├── RETURN.java │ ├── ReferenceType.java │ ├── ReturnInstruction.java │ ├── ReturnaddressType.java │ ├── SALOAD.java │ ├── SASTORE.java │ ├── SIPUSH.java │ ├── SWAP.java │ ├── SWITCH.java │ ├── Select.java │ ├── SimpleElementValueGen.java │ ├── StackConsumer.java │ ├── StackInstruction.java │ ├── StackProducer.java │ ├── StoreInstruction.java │ ├── TABLESWITCH.java │ ├── TargetLostException.java │ ├── Type.java │ ├── TypedInstruction.java │ ├── UnconditionalBranch.java │ ├── VariableLengthInstruction.java │ ├── Visitor.java │ └── package-info.java │ ├── package-info.java │ ├── util │ ├── AbstractClassPathRepository.java │ ├── Args.java │ ├── AttributeHTML.java │ ├── BCELComparator.java │ ├── BCELFactory.java │ ├── BCELifier.java │ ├── ByteSequence.java │ ├── Class2HTML.java │ ├── ClassLoader.java │ ├── ClassLoaderRepository.java │ ├── ClassPath.java │ ├── ClassPathRepository.java │ ├── ClassQueue.java │ ├── ClassSet.java │ ├── ClassStack.java │ ├── ClassVector.java │ ├── CodeHTML.java │ ├── ConstantHTML.java │ ├── InstructionFinder.java │ ├── JavaWrapper.java │ ├── LruCacheClassPathRepository.java │ ├── MemorySensitiveClassPathRepository.java │ ├── MethodHTML.java │ ├── ModularRuntimeImage.java │ ├── Repository.java │ ├── SyntheticRepository.java │ └── package-info.java │ └── verifier │ ├── GraphicalVerifier.java │ ├── NativeVerifier.java │ ├── PassVerifier.java │ ├── TransitiveHull.java │ ├── VerificationResult.java │ ├── Verifier.java │ ├── VerifierAppFrame.java │ ├── VerifierFactory.java │ ├── VerifierFactoryListModel.java │ ├── VerifierFactoryObserver.java │ ├── VerifyDialog.java │ ├── exc │ ├── AssertionViolatedException.java │ ├── ClassConstraintException.java │ ├── CodeConstraintException.java │ ├── InvalidMethodException.java │ ├── LinkingConstraintException.java │ ├── LoadingException.java │ ├── LocalVariableInfoInconsistentException.java │ ├── StaticCodeConstraintException.java │ ├── StaticCodeInstructionConstraintException.java │ ├── StaticCodeInstructionOperandConstraintException.java │ ├── StructuralCodeConstraintException.java │ ├── Utility.java │ ├── VerificationException.java │ ├── VerifierConstraintViolatedException.java │ └── package-info.java │ ├── package-info.java │ ├── statics │ ├── DOUBLE_Upper.java │ ├── IntList.java │ ├── LONG_Upper.java │ ├── LocalVariableInfo.java │ ├── LocalVariablesInfo.java │ ├── Pass1Verifier.java │ ├── Pass2Verifier.java │ ├── Pass3aVerifier.java │ ├── StringRepresentation.java │ └── package-info.java │ └── structurals │ ├── ControlFlowGraph.java │ ├── ExceptionHandler.java │ ├── ExceptionHandlers.java │ ├── ExecutionVisitor.java │ ├── Frame.java │ ├── GenericArray.java │ ├── InstConstraintVisitor.java │ ├── InstructionContext.java │ ├── LocalVariables.java │ ├── OperandStack.java │ ├── Pass3bVerifier.java │ ├── Subroutine.java │ ├── Subroutines.java │ ├── UninitializedObjectType.java │ └── package-info.java ├── site ├── resources │ ├── bcel5-bcel6-clirr-report.html │ ├── download_bcel.cgi │ ├── images │ │ ├── bcel-logo.gif │ │ ├── classfile.gif │ │ ├── classgen.gif │ │ ├── classloader.gif │ │ ├── constantpool.gif │ │ ├── il.gif │ │ ├── instructions.gif │ │ ├── javaclass.gif │ │ ├── jvm.gif │ │ └── logo.png │ └── profile.jacoco ├── site.xml └── xdoc │ ├── download_bcel.xml │ ├── faq.xml │ ├── index.xml │ ├── issue-tracking.xml │ ├── mail-lists.xml │ ├── manual │ ├── appendix.xml │ ├── application-areas.xml │ ├── bcel-api.xml │ ├── introduction.xml │ ├── jvm.xml │ └── manual.xml │ ├── projects.xml │ └── security.xml └── test ├── java └── org │ └── apache │ └── bcel │ ├── AbstractCounterVisitorTestCase.java │ ├── AbstractTestCase.java │ ├── AnnotationAccessFlagTestCase.java │ ├── AnnotationDefaultAttributeTestCase.java │ ├── AnnotationEntryTest.java │ ├── AnonymousClassTestCase.java │ ├── BCELBenchmark.java │ ├── ConstTest.java │ ├── CounterVisitorTestCase.java │ ├── ElementValueGenTestCase.java │ ├── EnclosingMethodAttributeTestCase.java │ ├── EnumAccessFlagTestCase.java │ ├── HandleTestCase.java │ ├── HelloWorldCreator.java │ ├── InstructionFinderTestCase.java │ ├── LocalVariableTypeTableTestCase.java │ ├── NanoTimer.java │ ├── OssFuzzTestCase.java │ ├── PLSETestCase.java │ ├── PerformanceTest.java │ ├── classfile │ ├── CodeExceptionTestCase.java │ ├── ConstantPoolModuleAccessTestCase.java │ ├── ConstantPoolModuleToStringTestCase.java │ ├── ConstantPoolTestCase.java │ ├── ConstantTest.java │ ├── FieldTest.java │ ├── InvalidMethodSigantureTestCase.java │ ├── JDKClassDumpTestCase.java │ ├── LocalVariableTestCase.java │ ├── RecordTestCase.java │ ├── SignatureTestCase.java │ ├── StackMapTest.java │ ├── TestJira368.java │ └── UtilityTestCase.java │ ├── data │ ├── AnnotatedFields.java │ ├── AnnotatedWithCombinedAnnotation.java │ ├── AnnotatedWithEnumClass.java │ ├── AnnotationEnumElement.java │ ├── AnonymousClassTest.java │ ├── AttributeTestClassEM01.java │ ├── AttributeTestClassEM02.java │ ├── CombinedAnnotation.java │ ├── ComplexAnnotatedClass.java │ ├── ComplexAnnotation.java │ ├── ConstantPoolX.java │ ├── EmptyClass.java │ ├── LargeMethod.java │ ├── MarkedType.java │ ├── MarkerAnnotation.java │ ├── MarkerAnnotationInvisible.java │ ├── PLSETestClass.java │ ├── PLSETestClass2.java │ ├── PLSETestEnum.java │ ├── SWAP.java │ ├── SimpleAnnotatedClass.java │ ├── SimpleAnnotation.java │ ├── SimpleClass.java │ ├── SimpleClassHasMethodIncludeGenericArgument.java │ ├── SimpleClassWithDefaultConstructor.java │ └── SimpleEnum.java │ ├── generic │ ├── AnnotationGenTestCase.java │ ├── ArrayTypeTest.java │ ├── BREAKPOINTTestCase.java │ ├── BasicTypeTest.java │ ├── BinaryOpCreator.java │ ├── BranchHandleTestCase.java │ ├── ClassGenTest.java │ ├── CountingVisitor.java │ ├── D2FTestCase.java │ ├── D2ITestCase.java │ ├── D2LTestCase.java │ ├── DADDTestCase.java │ ├── DDIVTestCase.java │ ├── DMULTestCase.java │ ├── DNEGTestCase.java │ ├── DREMTestCase.java │ ├── DSUBTestCase.java │ ├── EmptyStaticInit.java │ ├── EmptyVisitorTestCase.java │ ├── F2DTestCase.java │ ├── F2ITestCase.java │ ├── F2LTestCase.java │ ├── FADDTestCase.java │ ├── FDIVTestCase.java │ ├── FMULTestCase.java │ ├── FNEGTestCase.java │ ├── FREMTestCase.java │ ├── FSUBTestCase.java │ ├── FieldAnnotationsTestCase.java │ ├── FieldGenTest.java │ ├── GETFIELDTestCase.java │ ├── GeneratingAnnotatedClassesTestCase.java │ ├── I2BTestCase.java │ ├── I2CTestCase.java │ ├── I2DTestCase.java │ ├── I2FTestCase.java │ ├── I2LTestCase.java │ ├── I2STestCase.java │ ├── IADDTestCase.java │ ├── IANDTestCase.java │ ├── IDIVTestCase.java │ ├── IMPDEP1TestCase.java │ ├── IMPDEP2TestCase.java │ ├── IMULTestCase.java │ ├── INEGTestCase.java │ ├── IORTestCase.java │ ├── IREMTestCase.java │ ├── ISHLTestCase.java │ ├── ISHRTestCase.java │ ├── ISUBTestCase.java │ ├── IXORTestCase.java │ ├── InstructionFactoryTestCase.java │ ├── InstructionHandleTestCase.java │ ├── JavaHome.java │ ├── JdkGenericDumpTestCase.java │ ├── JiraBcel362TestCase.java │ ├── L2DTestCase.java │ ├── L2FTestCase.java │ ├── L2ITestCase.java │ ├── LADDTestCase.java │ ├── LANDTestCase.java │ ├── LCMPTestCase.java │ ├── LDIVTestCase.java │ ├── LMULTestCase.java │ ├── LNEGTestCase.java │ ├── LORTestCase.java │ ├── LREMTestCase.java │ ├── LSHLTestCase.java │ ├── LSHRTestCase.java │ ├── LSUBTestCase.java │ ├── LXORTestCase.java │ ├── LargeJump.java │ ├── MethodGenTestCase.java │ ├── ObjectTypeTest.java │ ├── PUTFIELDTestCase.java │ ├── PUTSTATICTestCase.java │ └── TypeTestCase.java │ ├── util │ ├── BCELifierTestCase.java │ ├── Class2HTMLTestCase.java │ ├── ClassPathRepositoryTestCase.java │ ├── ClassPathTestCase.java │ ├── InstructionFinderTest.java │ ├── LruCacheClassPathRepositoryTestCase.java │ └── ModularRuntimeImageTestCase.java │ ├── verifier │ ├── AbstractVerifierTestCase.java │ ├── JiraBcel291TestCase.java │ ├── JiraBcel369TestCase.java │ ├── JiraBcel369TestFixture.java │ ├── JiraBcel370TestCase.java │ ├── VerifierArrayAccessTestCase.java │ ├── VerifierInvokeTestCase.java │ ├── VerifierMainTestCase.java │ ├── VerifierReturnTestCase.java │ ├── VerifierTestCase.java │ ├── VerifierThrowTestCase.java │ ├── VerifyBadClassesTestCase.java │ ├── VerifyJavaHomesTestCase.java │ ├── VerifyJavaMathTestCase.java │ ├── VerifyJavaUtilTestCase.java │ ├── input │ │ ├── FieldVerifierChildClass.java │ │ ├── FieldVerifierSuperClass.java │ │ ├── StaticFieldVerifierChildClass.java │ │ └── StaticFieldVerifierSuperClass.java │ ├── statics │ │ ├── Pass2VerifierTestCase.java │ │ └── Pass3aVerifierTestCase.java │ ├── structurals │ │ ├── InstConstraintVisitorTestCase.java │ │ └── UninitializedObjectTypeTestCase.java │ └── tests │ │ ├── JiraBcel291TestFixture.java │ │ ├── JvmOpCodes.java │ │ ├── TestArray01.java │ │ ├── TestArrayAccess01.java │ │ ├── TestArrayAccess02Creator.java │ │ ├── TestArrayAccess03Creator.java │ │ ├── TestArrayAccess04Creator.java │ │ ├── TestArrayAccess04DoubleCreator.java │ │ ├── TestArrayAccess04FloatCreator.java │ │ ├── TestArrayAccess04IntCreator.java │ │ ├── TestArrayAccess04LongCreator.java │ │ ├── TestArrayAccess04ShortCreator.java │ │ ├── TestArrayAccess04UnknownCreator.java │ │ ├── TestCreator.java │ │ ├── TestLegalInvokeInterface01.java │ │ ├── TestLegalInvokeSpecial01.java │ │ ├── TestLegalInvokeSpecial02.java │ │ ├── TestLegalInvokeStatic01.java │ │ ├── TestLegalInvokeVirtual01.java │ │ ├── TestLegalInvokeVirtual02.java │ │ ├── TestReturn01Creator.java │ │ ├── TestReturn02.java │ │ ├── TestReturn03BooleanCreator.java │ │ ├── TestReturn03ByteCreator.java │ │ ├── TestReturn03Creator.java │ │ ├── TestReturn03DoubleCreator.java │ │ ├── TestReturn03FloatCreator.java │ │ ├── TestReturn03IntCreator.java │ │ ├── TestReturn03LongCreator.java │ │ ├── TestReturn03ObjectCreator.java │ │ ├── TestReturn03ShortCreator.java │ │ ├── TestReturn03UnknownCreator.java │ │ └── TestThrow01Creator.java │ └── visitors │ └── CountingVisitor.java └── resources ├── Java4Example.class ├── Java4Example.java ├── Java8Example.class ├── Java8Example.java ├── Java8Example2.class ├── Java8Example2.java ├── StackMapExample.class ├── StackMapExample.java ├── StackMapExample2.class ├── StackMapExample2.java ├── com ├── foo │ └── Foo.class └── puppycrawl │ └── tools │ └── checkstyle │ └── grammar │ └── java │ └── JavaLanguageParser$ClassBlockContext.class ├── issue303 └── example │ └── A.classx ├── issue307 └── example │ └── A.classx ├── issue308 └── Hello.classx ├── issue309 └── Hello.classx ├── issue310 └── Hello.classx ├── issue311 └── Hello.classx ├── issue312 └── Hello.classx ├── issue313 └── Hello.classx ├── issue337 └── example │ └── A.classx ├── issue362 ├── Bcel362.class └── Bcel362.java ├── issue369 └── Test.class ├── jira368 └── Test.class ├── jpms ├── java11 │ └── commons-io │ │ └── module-info.class ├── java17 │ └── commons-io │ │ └── module-info.class ├── java18 │ └── commons-io │ │ └── module-info.class └── java19-ea │ └── commons-io │ └── module-info.class ├── kotlin └── test$method name with () in it$1.class ├── ossfuzz ├── issue51980 │ └── Test.classx ├── issue51989 │ └── Test.classx ├── issue52168 │ └── Test.classx ├── issue53543 │ └── Test.classx ├── issue53544a │ └── Test.classx ├── issue53620 │ └── Test.classx ├── issue53676 │ └── Test.classx ├── issue54119 │ └── Test.classx ├── issue54254 │ └── Test.classx └── readme.txt └── record ├── SimpleRecord.class └── SimpleRecord.java /.asf.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # https://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | github: 17 | description: "Apache Commons BCEL" 18 | homepage: https://commons.apache.org/bcel/ 19 | 20 | notifications: 21 | commits: commits@commons.apache.org 22 | issues: issues@commons.apache.org 23 | pullrequests: issues@commons.apache.org 24 | jira_options: link label 25 | jobs: notifications@commons.apache.org 26 | issues_bot_dependabot: notifications@commons.apache.org 27 | pullrequests_bot_dependabot: notifications@commons.apache.org 28 | issues_bot_codecov-commenter: notifications@commons.apache.org 29 | pullrequests_bot_codecov-commenter: notifications@commons.apache.org 30 | -------------------------------------------------------------------------------- /.github/GH-ROBOTS.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # https://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | # Keeps on creating FUD PRs in test code 17 | # Does not follow Apache disclosure policies 18 | User-agent: JLLeitschuh/security-research 19 | Disallow: * 20 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # https://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | version: 2 17 | updates: 18 | - package-ecosystem: "maven" 19 | directory: "/" 20 | schedule: 21 | interval: "weekly" 22 | day: "friday" 23 | - package-ecosystem: "github-actions" 24 | directory: "/" 25 | schedule: 26 | interval: "weekly" 27 | day: "friday" 28 | -------------------------------------------------------------------------------- /.github/workflows/dependency-review.yml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # https://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | name: 'Dependency Review' 19 | on: [pull_request] 20 | 21 | permissions: 22 | contents: read 23 | 24 | jobs: 25 | dependency-review: 26 | runs-on: ubuntu-latest 27 | steps: 28 | - name: 'Checkout Repository' 29 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 30 | - name: 'Dependency Review PR' 31 | uses: actions/dependency-review-action@da24556b548a50705dd671f47852072ea4c105d9 # v4.7.1 32 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /.externalToolBuilders/ 2 | /.settings/ 3 | /bin/ 4 | /target/ 5 | /.classpath 6 | /.project 7 | /maven-eclipse.xml 8 | .idea 9 | *.iml 10 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | 17 | The Apache code of conduct page is [https://www.apache.org/foundation/policies/conduct.html](https://www.apache.org/foundation/policies/conduct.html). 18 | -------------------------------------------------------------------------------- /NOTICE.txt: -------------------------------------------------------------------------------- 1 | Apache Commons BCEL 2 | Copyright 2004-2025 The Apache Software Foundation 3 | 4 | This product includes software developed at 5 | The Apache Software Foundation (https://www.apache.org/). 6 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | 17 | The Apache Commons security page is [https://commons.apache.org/security.html](https://commons.apache.org/security.html). 18 | -------------------------------------------------------------------------------- /docs/eps/classloader.fig: -------------------------------------------------------------------------------- 1 | #FIG 3.2 2 | Portrait 3 | Center 4 | Metric 5 | A4 6 | 100.00 7 | Single 8 | -2 9 | 1200 2 10 | 6 900 450 3150 1125 11 | 2 4 0 1 0 7 100 0 -1 0.000 0 0 7 0 0 5 12 | 3150 1125 3150 450 900 450 900 1125 3150 1125 13 | 4 0 0 100 0 16 14 0.0000 4 165 1380 1350 900 Java class file\001 14 | -6 15 | 6 3600 450 5850 1125 16 | 2 2 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 5 17 | 3600 450 5850 450 5850 1125 3600 1125 3600 450 18 | 4 0 0 100 0 16 14 0.0000 4 165 1215 4140 855 Class loader\001 19 | -6 20 | 6 6750 450 9000 1125 21 | 2 2 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 5 22 | 6750 450 9000 450 9000 1125 6750 1125 6750 450 23 | 4 0 0 100 0 16 14 0.0000 4 210 1665 7020 855 Byte code verifier\001 24 | -6 25 | 6 9450 450 11700 1125 26 | 2 2 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 5 27 | 9450 450 11700 450 11700 1125 9450 1125 9450 450 28 | 4 0 0 100 0 16 14 0.0000 4 210 1410 9900 900 Interpreter/JIT\001 29 | -6 30 | 6 4950 1575 7875 2700 31 | 2 2 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 5 32 | 4950 1575 7875 1575 7875 2700 4950 2700 4950 1575 33 | 4 0 0 100 0 16 14 0.0000 4 210 2505 5175 2475 Byte code transformations\001 34 | 4 0 0 100 0 14 14 0.0000 4 150 1215 5850 2025 JavaClass\001 35 | -6 36 | 2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 1 0 2 37 | 1 1 1.00 60.00 120.00 38 | 3150 765 3600 765 39 | 2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 1 0 2 40 | 1 1 1.00 60.00 120.00 41 | 9000 765 9450 765 42 | 2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 1 0 3 43 | 1 1 1.00 60.00 120.00 44 | 5850 765 6075 765 6075 1575 45 | 2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 1 0 3 46 | 1 1 1.00 60.00 120.00 47 | 6525 1575 6525 765 6750 765 48 | -------------------------------------------------------------------------------- /docs/verifier/GNUmakefile: -------------------------------------------------------------------------------- 1 | # JustIce, the class file verifier for use with BCEL was written 2 | # in 2001 by Enver Haase; (c) 2001 Enver Haase. 3 | # 4 | # Licensed to the Apache Software Foundation (ASF) under one or more 5 | # contributor license agreements. See the NOTICE file distributed with 6 | # this work for additional information regarding copyright ownership. 7 | # The ASF licenses this file to You under the Apache License, Version 2.0 8 | # (the "License"); you may not use this file except in compliance with 9 | # the License. You may obtain a copy of the License at 10 | # 11 | # https://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | # 19 | 20 | RM := rm 21 | 22 | all: psgz 23 | 24 | distclean: clean 25 | $(RM) -rf *~ 26 | 27 | ps: 28 | lyx -e ps JustIce.lyx 29 | 30 | pdf: ps 31 | ps2pdf JustIce.ps JustIce.pdf 32 | 33 | psgz: ps 34 | gzip JustIce.ps 35 | 36 | clean: 37 | $(RM) -rf JustIce.ps JustIce.pdf JustIce.ps.gz 38 | -------------------------------------------------------------------------------- /docs/verifier/VennDiag.eps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/docs/verifier/VennDiag.eps -------------------------------------------------------------------------------- /docs/verifier/VerificationAPI.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/docs/verifier/VerificationAPI.bmp -------------------------------------------------------------------------------- /docs/verifier/chap1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/docs/verifier/chap1.bmp -------------------------------------------------------------------------------- /docs/verifier/conventcfg.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/docs/verifier/conventcfg.bmp -------------------------------------------------------------------------------- /docs/verifier/exframe.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/docs/verifier/exframe.bmp -------------------------------------------------------------------------------- /docs/verifier/justicecfg.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/docs/verifier/justicecfg.bmp -------------------------------------------------------------------------------- /src/conf/checkstyle/checkstyle-header.txt: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | -------------------------------------------------------------------------------- /src/examples/Mini/EnvEntry.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package Mini; 20 | 21 | /** 22 | * Entry in environment. 23 | */ 24 | public interface EnvEntry { 25 | int getColumn(); 26 | 27 | String getHashKey(); 28 | 29 | int getLine(); 30 | } 31 | -------------------------------------------------------------------------------- /src/examples/Mini/Mini.bnf: -------------------------------------------------------------------------------- 1 | Program: 2 | (FunDecl)* 3 | 4 | FunDecl: 5 | "FUN" Ident "=" Expr 6 | 7 | Expr: 8 | "(" Expr ")" 9 | | 10 | Expr AddOp Expr 11 | | 12 | Expr MultOp Expr 13 | | 14 | Expr CmpOp Expr 15 | | 16 | Ident 17 | | 18 | Number 19 | | 20 | FunAppl 21 | | 22 | UnOp Expr 23 | | 24 | IfExpr 25 | 26 | IfExpr: 27 | "IF" Expr "THEN" Expr ["ELSE" Expr] "FI" 28 | 29 | FunAppl: 30 | Ident "(" [Expr ("," Expr)*] ")" 31 | 32 | AddOp: 33 | ("+" | "-" | "OR") 34 | 35 | MultOp: 36 | ("*" | "/" | "%" | "AND") 37 | 38 | CmpOp: 39 | ("==" | "!=" | "<=" | ">=" | ">" | "<"") 40 | 41 | UnOp: 42 | ("-" | "!") 43 | 44 | Ident: 45 | LETTER (LETTER|DIGIT)* 46 | 47 | Number: 48 | DIGIT+ 49 | 50 | LETTER: 51 | [a-zA-Z] 52 | 53 | DIGIT: 54 | [0-9] 55 | 56 | --------------------------------------------------------- 57 | Expr: 58 | Term [AddOp Term] 59 | | 60 | UnOp Expr 61 | | 62 | FunAppl 63 | 64 | Term: 65 | Factor [MultOp Factor] 66 | 67 | Factor: 68 | Element [CmpOp Element] 69 | 70 | Element: 71 | Ident 72 | | 73 | Number 74 | | 75 | "(" Expr ")" 76 | -------------------------------------------------------------------------------- /src/examples/Mini/MiniParser$JJCalls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/examples/Mini/MiniParser$JJCalls -------------------------------------------------------------------------------- /src/examples/Mini/MiniParserTreeConstants.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | /* Generated By:JJTree: Do not edit this line. MiniParserTreeConstants.java */ 20 | 21 | package Mini; 22 | 23 | public interface MiniParserTreeConstants { 24 | int JJTPROGRAM = 0; 25 | int JJTFUNDECL = 1; 26 | int JJTEXPR = 2; 27 | int JJTIFEXPR = 3; 28 | int JJTLETEXPR = 4; 29 | int JJTFUNAPPL = 5; 30 | int JJTTERM = 6; 31 | int JJTFACTOR = 7; 32 | int JJTVOID = 8; 33 | int JJTINTEGER = 9; 34 | int JJTIDENT = 10; 35 | 36 | String[] jjtNodeName = {"Program", "FunDecl", "Expr", "IfExpr", "LetExpr", "FunAppl", "Term", "Factor", "void", "Integer", "Ident",}; 37 | } 38 | -------------------------------------------------------------------------------- /src/examples/Mini/fac.mini: -------------------------------------------------------------------------------- 1 | -- Compute factorial 2 | 3 | FUN fac (n) = IF n == 0 THEN 1 4 | ELSE n * fac(n - 1) 5 | FI 6 | 7 | FUN main() = LET 8 | n = READ() 9 | IN 10 | WRITE(fac(n)) 11 | -------------------------------------------------------------------------------- /src/examples/Mini/fib.mini: -------------------------------------------------------------------------------- 1 | -- Compute fibonacci numbers 2 | 3 | FUN fib(n) = 4 | IF n == 0 THEN 0 5 | ELSE IF n == 1 THEN 1 6 | ELSE fib(n - 1) + fib(n - 2) FI FI 7 | 8 | FUN main() = 9 | LET n = READ() 10 | IN 11 | WRITE(fib(n)) 12 | -------------------------------------------------------------------------------- /src/examples/Mini/max.mini: -------------------------------------------------------------------------------- 1 | FUN max(a, b) = IF a > b THEN a ELSE b FI 2 | 3 | -- n anzahl schleifendurchlaeufe 4 | -- m bisheriges maximum 5 | FUN LOOP(n, m) = IF n > 0 THEN 6 | LET 7 | x = READ() 8 | IN 9 | LOOP(n - 1, max(m, x)) 10 | ELSE 11 | m 12 | FI 13 | 14 | FUN abs(n) = IF n > 0 THEN n ELSE -n FI 15 | 16 | FUN main() = 17 | LET a = READ() 18 | -- b = READ() 19 | IN 20 | --WRITE(max(a, b)) 21 | WRITE(LOOP(abs(a), -47110815)) 22 | -------------------------------------------------------------------------------- /src/main/java/org/apache/bcel/classfile/ConstantObject.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.classfile; 20 | 21 | /** 22 | * This interface denotes those constants that have a "natural" value, such as ConstantLong, ConstantString, and so on. 23 | * 24 | * @see Constant 25 | */ 26 | public interface ConstantObject { 27 | 28 | /** 29 | * Gets the object representing the constant, for example, Long for ConstantLong. 30 | * 31 | * @param constantPool the constant. 32 | * @return object representing the constant, for example, Long for ConstantLong. 33 | */ 34 | Object getConstantValue(ConstantPool constantPool); 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/org/apache/bcel/classfile/Node.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.classfile; 20 | 21 | /** 22 | * Denote class to have an accept method(); 23 | */ 24 | public interface Node { 25 | 26 | void accept(Visitor visitor); 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/org/apache/bcel/classfile/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | /** 21 | * Classes that describe the structure of a Java class file and a class file parser. 22 | */ 23 | package org.apache.bcel.classfile; 24 | -------------------------------------------------------------------------------- /src/main/java/org/apache/bcel/generic/AllocationInstruction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.generic; 20 | 21 | /** 22 | * Denote family of instructions that allocates space in the heap. 23 | */ 24 | public interface AllocationInstruction { 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/org/apache/bcel/generic/BREAKPOINT.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.generic; 20 | 21 | /** 22 | * BREAKPOINT, JVM dependent, ignored by default 23 | */ 24 | public class BREAKPOINT extends Instruction { 25 | 26 | public BREAKPOINT() { 27 | super(org.apache.bcel.Const.BREAKPOINT, (short) 1); 28 | } 29 | 30 | /** 31 | * Call corresponding visitor method(s). The order is: Call visitor methods of implemented interfaces first, then call 32 | * methods according to the class hierarchy in descending order, i.e., the most specific visitXXX() call comes last. 33 | * 34 | * @param v Visitor object 35 | */ 36 | @Override 37 | public void accept(final Visitor v) { 38 | v.visitBREAKPOINT(this); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/org/apache/bcel/generic/ClassGenException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.generic; 20 | 21 | /** 22 | * Thrown on internal exceptions. 23 | */ 24 | public class ClassGenException extends RuntimeException { 25 | 26 | private static final long serialVersionUID = 7247369755051242791L; 27 | 28 | public ClassGenException() { 29 | } 30 | 31 | public ClassGenException(final String s) { 32 | super(s); 33 | } 34 | 35 | public ClassGenException(final String s, final Throwable initCause) { 36 | super(s, initCause); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/org/apache/bcel/generic/ClassObserver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.generic; 20 | 21 | /** 22 | * Implement this interface if you're interested in changes to a ClassGen object and register yourself with 23 | * addObserver(). 24 | */ 25 | public interface ClassObserver { 26 | 27 | void notify(ClassGen clazz); 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/org/apache/bcel/generic/CompoundInstruction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.generic; 20 | 21 | /** 22 | * Wrapper class for 'compound' operations, virtual instructions that don't exist as byte code, but give a useful 23 | * meaning. For example, the (virtual) PUSH instruction takes an arbitrary argument and produces the appropriate code at 24 | * dump time (ICONST, LDC, BIPUSH, ...). Also you can use the SWITCH instruction as a useful template for either 25 | * LOOKUPSWITCH or TABLESWITCH. 26 | * 27 | * The interface provides the possibility for the user to write 'templates' or 'macros' for such reusable code patterns. 28 | * 29 | * @see PUSH 30 | * @see SWITCH 31 | */ 32 | public interface CompoundInstruction { 33 | 34 | InstructionList getInstructionList(); 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/org/apache/bcel/generic/ConstantPushInstruction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.generic; 20 | 21 | /** 22 | * Denotes a push instruction that produces a literal on the stack such as SIPUSH, BIPUSH, ICONST, etc. 23 | * 24 | * 25 | * @see ICONST 26 | * @see SIPUSH 27 | */ 28 | public interface ConstantPushInstruction extends PushInstruction, TypedInstruction { 29 | 30 | Number getValue(); 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/org/apache/bcel/generic/FieldObserver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.generic; 20 | 21 | /** 22 | * Imnplement this interface if you're interested in changes to a FieldGen object and register yourself with 23 | * addObserver(). 24 | */ 25 | public interface FieldObserver { 26 | 27 | void notify(FieldGen field); 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/org/apache/bcel/generic/GotoInstruction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.generic; 20 | 21 | /** 22 | * Super class for GOTO 23 | */ 24 | public abstract class GotoInstruction extends BranchInstruction implements UnconditionalBranch { 25 | 26 | /** 27 | * Empty constructor needed for Instruction.readInstruction. Not to be used otherwise. 28 | */ 29 | GotoInstruction() { 30 | } 31 | 32 | GotoInstruction(final short opcode, final InstructionHandle target) { 33 | super(opcode, target); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/org/apache/bcel/generic/IMPDEP1.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.generic; 20 | 21 | /** 22 | * IMPDEP1 - Implementation dependent 23 | */ 24 | public class IMPDEP1 extends Instruction { 25 | 26 | public IMPDEP1() { 27 | super(org.apache.bcel.Const.IMPDEP1, (short) 1); 28 | } 29 | 30 | /** 31 | * Call corresponding visitor method(s). The order is: Call visitor methods of implemented interfaces first, then call 32 | * methods according to the class hierarchy in descending order, i.e., the most specific visitXXX() call comes last. 33 | * 34 | * @param v Visitor object 35 | */ 36 | @Override 37 | public void accept(final Visitor v) { 38 | v.visitIMPDEP1(this); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/org/apache/bcel/generic/IMPDEP2.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.generic; 20 | 21 | /** 22 | * IMPDEP2 - Implementation dependent 23 | */ 24 | public class IMPDEP2 extends Instruction { 25 | 26 | public IMPDEP2() { 27 | super(org.apache.bcel.Const.IMPDEP2, (short) 1); 28 | } 29 | 30 | /** 31 | * Call corresponding visitor method(s). The order is: Call visitor methods of implemented interfaces first, then call 32 | * methods according to the class hierarchy in descending order, i.e., the most specific visitXXX() call comes last. 33 | * 34 | * @param v Visitor object 35 | */ 36 | @Override 37 | public void accept(final Visitor v) { 38 | v.visitIMPDEP2(this); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/org/apache/bcel/generic/IndexedInstruction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.generic; 20 | 21 | /** 22 | * Denote entity that refers to an index, for example local variable instructions, RET, CPInstruction, etc. 23 | */ 24 | public interface IndexedInstruction { 25 | 26 | int getIndex(); 27 | 28 | void setIndex(int index); 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/org/apache/bcel/generic/InstructionListObserver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.generic; 20 | 21 | /** 22 | * Implement this interface if you're interested in changes to an InstructionList object and register yourself with 23 | * addObserver(). 24 | */ 25 | public interface InstructionListObserver { 26 | 27 | void notify(InstructionList list); 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/org/apache/bcel/generic/MethodObserver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.generic; 20 | 21 | /** 22 | * Implement this interface if you're interested in changes to a MethodGen object and register yourself with 23 | * addObserver(). 24 | */ 25 | public interface MethodObserver { 26 | 27 | void notify(MethodGen method); 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/org/apache/bcel/generic/NOP.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.generic; 20 | 21 | /** 22 | * NOP - Do nothing 23 | */ 24 | public class NOP extends Instruction { 25 | 26 | public NOP() { 27 | super(org.apache.bcel.Const.NOP, (short) 1); 28 | } 29 | 30 | /** 31 | * Call corresponding visitor method(s). The order is: Call visitor methods of implemented interfaces first, then call 32 | * methods according to the class hierarchy in descending order, i.e., the most specific visitXXX() call comes last. 33 | * 34 | * @param v Visitor object 35 | */ 36 | @Override 37 | public void accept(final Visitor v) { 38 | v.visitNOP(this); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/org/apache/bcel/generic/NamedAndTyped.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.generic; 20 | 21 | /** 22 | * Denote entity that has both name and type. This is true for local variables, methods and fields. 23 | */ 24 | public interface NamedAndTyped { 25 | 26 | String getName(); 27 | 28 | Type getType(); 29 | 30 | void setName(String name); 31 | 32 | void setType(Type type); 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/org/apache/bcel/generic/PopInstruction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.generic; 20 | 21 | /** 22 | * Denotes an unparameterized instruction to pop a value on top from the stack, such as ISTORE, POP, PUTSTATIC. 23 | * 24 | * @see ISTORE 25 | * @see POP 26 | */ 27 | public interface PopInstruction extends StackConsumer { 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/org/apache/bcel/generic/PushInstruction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.generic; 20 | 21 | /** 22 | * Denotes an unparameterized instruction to produce a value on top of the stack, such as ILOAD, LDC, SIPUSH, DUP, 23 | * ICONST, etc. 24 | * 25 | * 26 | * @see ILOAD 27 | * @see ICONST 28 | * @see LDC 29 | * @see DUP 30 | * @see SIPUSH 31 | * @see GETSTATIC 32 | */ 33 | public interface PushInstruction extends StackProducer { 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/org/apache/bcel/generic/StackConsumer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.generic; 20 | 21 | /** 22 | * Denote an instruction that may consume a value from the stack. 23 | */ 24 | public interface StackConsumer { 25 | 26 | /** 27 | * @return how many words are consumed from stack 28 | */ 29 | int consumeStack(ConstantPoolGen cpg); 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/org/apache/bcel/generic/StackInstruction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.generic; 20 | 21 | /** 22 | * Super class for stack operations like DUP and POP. 23 | */ 24 | public abstract class StackInstruction extends Instruction { 25 | 26 | /** 27 | * Empty constructor needed for Instruction.readInstruction. Not to be used otherwise. 28 | */ 29 | StackInstruction() { 30 | } 31 | 32 | /** 33 | * @param opcode instruction opcode 34 | */ 35 | protected StackInstruction(final short opcode) { 36 | super(opcode, (short) 1); 37 | } 38 | 39 | /** 40 | * @return Type.UNKNOWN 41 | */ 42 | public Type getType(final ConstantPoolGen cp) { 43 | return Type.UNKNOWN; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/org/apache/bcel/generic/StackProducer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.generic; 20 | 21 | /** 22 | * Denotes an instruction that may produce a value on top of the stack (this excludes DUP_X1, for example) 23 | */ 24 | public interface StackProducer { 25 | 26 | /** 27 | * @return how many words are produced on stack 28 | */ 29 | int produceStack(ConstantPoolGen cpg); 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/org/apache/bcel/generic/TypedInstruction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.generic; 20 | 21 | /** 22 | * Gets the type associated with an instruction, int for ILOAD, or the type of the field of a PUTFIELD instruction. 23 | */ 24 | public interface TypedInstruction { 25 | 26 | Type getType(ConstantPoolGen cpg); 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/org/apache/bcel/generic/UnconditionalBranch.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.generic; 20 | 21 | /** 22 | * Denotes an instruction to perform an unconditional branch, i.e., GOTO, JSR. 23 | * 24 | * @see GOTO 25 | * @see JSR 26 | */ 27 | public interface UnconditionalBranch { 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/org/apache/bcel/generic/VariableLengthInstruction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.generic; 20 | 21 | /** 22 | * Denotes an instruction to be a variable length instruction, such as GOTO, JSR, LOOKUPSWITCH and TABLESWITCH. 23 | * 24 | * 25 | * @see GOTO 26 | * @see JSR 27 | * @see LOOKUPSWITCH 28 | * @see TABLESWITCH 29 | */ 30 | public interface VariableLengthInstruction { 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/org/apache/bcel/generic/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | /** 21 | * Generic part of the Apache Byte Code Engineering Library (BCEL), classes to dynamically modify class objects 22 | * and byte code instructions. 23 | */ 24 | package org.apache.bcel.generic; 25 | -------------------------------------------------------------------------------- /src/main/java/org/apache/bcel/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | /** 21 | * Basic classes for the Apache Byte Code Engineering Library (BCEL) and constants defined by the 22 | * JVM specification. 23 | */ 24 | package org.apache.bcel; 25 | -------------------------------------------------------------------------------- /src/main/java/org/apache/bcel/util/ClassStack.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.util; 20 | 21 | import java.util.Stack; 22 | 23 | import org.apache.bcel.classfile.JavaClass; 24 | 25 | /** 26 | * Utility class implementing a (typesafe) stack of JavaClass objects. 27 | * 28 | * @see Stack 29 | */ 30 | public class ClassStack { 31 | 32 | private final Stack stack = new Stack<>(); 33 | 34 | public boolean empty() { 35 | return stack.empty(); 36 | } 37 | 38 | public JavaClass pop() { 39 | return stack.pop(); 40 | } 41 | 42 | public void push(final JavaClass clazz) { 43 | stack.push(clazz); 44 | } 45 | 46 | public JavaClass top() { 47 | return stack.peek(); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/org/apache/bcel/util/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | /** 21 | * Utility classes for the Apache Byte Code Engineering Library (BCEL), namely: 22 | * 29 | */ 30 | package org.apache.bcel.util; 31 | -------------------------------------------------------------------------------- /src/main/java/org/apache/bcel/verifier/VerifierFactoryObserver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.verifier; 20 | 21 | /** 22 | * VerifierFactoryObserver instances are notified when new Verifier instances are created. 23 | * 24 | * 25 | * @see VerifierFactory#getVerifier(String) 26 | * @see VerifierFactory#getVerifiers() 27 | * @see VerifierFactory#attach(VerifierFactoryObserver) 28 | * @see VerifierFactory#detach(VerifierFactoryObserver) 29 | */ 30 | public interface VerifierFactoryObserver { 31 | 32 | /** 33 | * VerifierFactoryObserver instances are notified invoking this method. The String argument is the fully qualified class 34 | * name of a class a new Verifier instance created by the VerifierFactory operates on. 35 | */ 36 | void update(String s); 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/org/apache/bcel/verifier/exc/InvalidMethodException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.verifier.exc; 20 | 21 | /** 22 | * Instances of this class are thrown by BCEL's class file verifier "JustIce" when the verification of a method is 23 | * requested that does not exist. 24 | */ 25 | public class InvalidMethodException extends RuntimeException { 26 | 27 | private static final long serialVersionUID = -7060302743724808051L; 28 | 29 | /** Constructs an InvalidMethodException with the specified detail message. */ 30 | public InvalidMethodException(final String message) { 31 | super(message); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/org/apache/bcel/verifier/exc/Utility.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.verifier.exc; 20 | 21 | import java.io.PrintWriter; 22 | import java.io.StringWriter; 23 | 24 | /** 25 | * A utility class providing convenience methods concerning Throwable instances. 26 | * 27 | * @see Throwable 28 | */ 29 | public final class Utility { 30 | /** This method returns the stack trace of a Throwable instance as a String. */ 31 | public static String getStackTrace(final Throwable t) { 32 | final StringWriter sw = new StringWriter(); 33 | final PrintWriter pw = new PrintWriter(sw); 34 | t.printStackTrace(pw); 35 | return sw.toString(); 36 | } 37 | 38 | /** This class is not instantiable. */ 39 | private Utility() { 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/org/apache/bcel/verifier/exc/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | /** 21 | * Exception classes used by JustIce, mostly used internally. You don't need to bother with them. 22 | *

Package Specification

23 | *

24 | * Contained in this package are Exception classes for use with the JustIce verifier. 25 | *

26 | */ 27 | package org.apache.bcel.verifier.exc; 28 | -------------------------------------------------------------------------------- /src/main/java/org/apache/bcel/verifier/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | /** 21 | * BCEL's verifier JustIce is there to help you dump correct Java class files created or modified with BCEL. 22 | *

Package Specification

23 | *

24 | * This is the top-level package of the JustIce verifier. To actually use it, have a look at the VerifierFactory and Verifier classes. 25 | *

26 | */ 27 | package org.apache.bcel.verifier; 28 | -------------------------------------------------------------------------------- /src/main/java/org/apache/bcel/verifier/statics/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | /** 21 | * PassVerifier classes used internally by JustIce. You don't need to bother with them. 22 | *

Package Specification

23 | *

24 | * Contained in this package are PassVerifier classes for use with the JustIce verifier. Only the passes performing what Sun calls 'static constraints' have 25 | * PassVerifier classes here. 26 | *

27 | */ 28 | package org.apache.bcel.verifier.statics; 29 | -------------------------------------------------------------------------------- /src/main/java/org/apache/bcel/verifier/structurals/GenericArray.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.verifier.structurals; 20 | 21 | import java.io.Serializable; 22 | 23 | /** 24 | * A placeholder class that can be used to create an ObjectType of which has some of the properties arrays have. They 25 | * implement {@link Cloneable} and {@link Serializable} and they extend {@link Object}. 26 | */ 27 | public class GenericArray implements Cloneable, Serializable { 28 | 29 | private static final long serialVersionUID = 1991183963515237894L; 30 | 31 | @Override 32 | protected Object clone() throws CloneNotSupportedException { 33 | return super.clone(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/org/apache/bcel/verifier/structurals/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | /** 21 | * A PassVerifier class mostly used internally by JustIce, yielding a control flow graph for public use as a nice side effect. 22 | *

Package Specification

23 | *

24 | * This package contains a PassVerifier class for use with the JustIce verifier and its utility classes. Only the pass performing what Sun calls "Structural 25 | * Constraints on Java Virtual Machine Code" has a PassVerifier class here. JustIce calls this pass "Pass 3b". 26 | *

27 | */ 28 | package org.apache.bcel.verifier.structurals; 29 | -------------------------------------------------------------------------------- /src/site/resources/download_bcel.cgi: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Just call the standard mirrors.cgi script. It will use download.html 3 | # as the input template. 4 | exec /www/www.apache.org/dyn/mirrors/mirrors.cgi $* -------------------------------------------------------------------------------- /src/site/resources/images/bcel-logo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/site/resources/images/bcel-logo.gif -------------------------------------------------------------------------------- /src/site/resources/images/classfile.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/site/resources/images/classfile.gif -------------------------------------------------------------------------------- /src/site/resources/images/classgen.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/site/resources/images/classgen.gif -------------------------------------------------------------------------------- /src/site/resources/images/classloader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/site/resources/images/classloader.gif -------------------------------------------------------------------------------- /src/site/resources/images/constantpool.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/site/resources/images/constantpool.gif -------------------------------------------------------------------------------- /src/site/resources/images/il.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/site/resources/images/il.gif -------------------------------------------------------------------------------- /src/site/resources/images/instructions.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/site/resources/images/instructions.gif -------------------------------------------------------------------------------- /src/site/resources/images/javaclass.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/site/resources/images/javaclass.gif -------------------------------------------------------------------------------- /src/site/resources/images/jvm.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/site/resources/images/jvm.gif -------------------------------------------------------------------------------- /src/site/resources/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/site/resources/images/logo.png -------------------------------------------------------------------------------- /src/site/resources/profile.jacoco: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // https://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/NanoTimer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.apache.bcel; 21 | 22 | public class NanoTimer { 23 | 24 | private long timeNanos; 25 | 26 | public void reset() { 27 | timeNanos = 0; 28 | } 29 | 30 | public NanoTimer start() { 31 | timeNanos -= System.nanoTime(); 32 | return this; 33 | } 34 | 35 | public void stop() { 36 | timeNanos += System.nanoTime(); 37 | } 38 | 39 | public void subtract(final NanoTimer o) { 40 | timeNanos -= o.timeNanos; 41 | } 42 | 43 | /** 44 | * May ony be called after stop has been called as many times as start. 45 | */ 46 | @Override 47 | public String toString() { 48 | return (double) timeNanos / 1000000000 + " s"; 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/classfile/CodeExceptionTestCase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.classfile; 20 | 21 | import org.apache.bcel.Constants; 22 | import org.junit.jupiter.api.Test; 23 | 24 | public class CodeExceptionTestCase { 25 | 26 | /** 27 | * Tests that we do not break binary compatibility with BCEL-330. 28 | */ 29 | @Test 30 | public void testReferenceToConstant() { 31 | @SuppressWarnings("unused") 32 | final short referenceToConstant = Constants.AALOAD; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/classfile/ConstantTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.apache.bcel.classfile; 21 | 22 | import static org.junit.jupiter.api.Assertions.assertFalse; 23 | import static org.junit.jupiter.api.Assertions.assertTrue; 24 | 25 | import org.junit.jupiter.api.Test; 26 | 27 | /** 28 | * Tests {@link Constant}. 29 | */ 30 | public class ConstantTest { 31 | 32 | @Test 33 | public void testBCELComparator() throws Exception { 34 | final Constant obj = new ConstantClass(1); 35 | assertTrue(Constant.getComparator().equals(null, null)); 36 | assertTrue(Constant.getComparator().equals(obj, obj)); 37 | assertFalse(Constant.getComparator().equals(obj, null)); 38 | assertFalse(Constant.getComparator().equals(null, obj)); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/classfile/FieldTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.apache.bcel.classfile; 21 | 22 | import static org.junit.jupiter.api.Assertions.assertFalse; 23 | import static org.junit.jupiter.api.Assertions.assertTrue; 24 | 25 | import org.junit.jupiter.api.Test; 26 | 27 | /** 28 | * Tests {@link Field}. 29 | */ 30 | public class FieldTest { 31 | 32 | @Test 33 | public void testBCELComparator() throws Exception { 34 | final Field obj = new Field(1, 1, 1, null, null); 35 | assertTrue(Field.getComparator().equals(null, null)); 36 | assertTrue(Field.getComparator().equals(obj, obj)); 37 | assertFalse(Field.getComparator().equals(obj, null)); 38 | assertFalse(Field.getComparator().equals(null, obj)); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/classfile/LocalVariableTestCase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.classfile; 20 | 21 | import org.apache.bcel.Constants; 22 | import org.junit.jupiter.api.Test; 23 | 24 | public class LocalVariableTestCase { 25 | 26 | /** 27 | * Tests that we do not break binary compatibility with BCEL-330. 28 | */ 29 | @Test 30 | public void testReferenceToConstant() { 31 | @SuppressWarnings("unused") 32 | final short referenceToConstant = Constants.AALOAD; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/classfile/StackMapTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.apache.bcel.classfile; 21 | 22 | import static org.junit.jupiter.api.Assertions.assertArrayEquals; 23 | 24 | import org.junit.jupiter.api.Test; 25 | 26 | /** 27 | * Tests {@link StackMap}. 28 | */ 29 | public class StackMapTest { 30 | 31 | @Test 32 | public void testSetStackMap() { 33 | final StackMap stackMap = new StackMap(0, 0, StackMapEntry.EMPTY_ARRAY, new ConstantPool(new Constant[] { new ConstantLong(0) })); 34 | // No NPE 35 | stackMap.setStackMap(null); 36 | assertArrayEquals(StackMapEntry.EMPTY_ARRAY, stackMap.getStackMap()); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/data/AnnotatedFields.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.apache.bcel.data; 21 | 22 | public class AnnotatedFields { 23 | @SimpleAnnotation(id = 1) 24 | int i; 25 | 26 | @SimpleAnnotation(id = 2) 27 | String s; 28 | } 29 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/data/AnnotatedWithCombinedAnnotation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.apache.bcel.data; 21 | 22 | @CombinedAnnotation({@SimpleAnnotation(id = 4)}) 23 | public class AnnotatedWithCombinedAnnotation { 24 | public AnnotatedWithCombinedAnnotation(final int param1, @SimpleAnnotation(id = 42) final int param2) { 25 | } 26 | 27 | @CombinedAnnotation({@SimpleAnnotation(id = 1, fruit = "apples"), @SimpleAnnotation(id = 2, fruit = "oranges")}) 28 | public void methodWithArrayOfTwoAnnotations() { 29 | } 30 | 31 | @CombinedAnnotation({}) 32 | public void methodWithArrayOfZeroAnnotations() { 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/data/AnnotatedWithEnumClass.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.apache.bcel.data; 21 | 22 | @AnnotationEnumElement(enumval = SimpleEnum.Red) 23 | public class AnnotatedWithEnumClass { 24 | } 25 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/data/AnnotationEnumElement.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.apache.bcel.data; 21 | 22 | import java.lang.annotation.Retention; 23 | import java.lang.annotation.RetentionPolicy; 24 | 25 | @Retention(RetentionPolicy.RUNTIME) 26 | public @interface AnnotationEnumElement { 27 | SimpleEnum enumval(); 28 | } 29 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/data/AnonymousClassTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.apache.bcel.data; 21 | 22 | public class AnonymousClassTest { 23 | final class X { 24 | } 25 | 26 | static class Y { 27 | } 28 | 29 | public void foo() { 30 | new Runnable() { 31 | @Override 32 | public void run() { 33 | } 34 | }.run(); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/data/AttributeTestClassEM01.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.apache.bcel.data; 21 | 22 | public class AttributeTestClassEM01 { 23 | public static void main(final String[] argv) { 24 | @SuppressWarnings("unused") 25 | final class S { 26 | public void sayhello() { 27 | System.err.println("hello"); 28 | } 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/data/AttributeTestClassEM02.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.apache.bcel.data; 21 | 22 | public class AttributeTestClassEM02 { 23 | public static void main(final String[] argv) { 24 | } 25 | 26 | Runnable r = new Runnable() { 27 | @Override 28 | public void run() { 29 | System.err.println("hello"); 30 | } 31 | }; 32 | } 33 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/data/CombinedAnnotation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.apache.bcel.data; 21 | 22 | import java.lang.annotation.Retention; 23 | import java.lang.annotation.RetentionPolicy; 24 | 25 | @Retention(RetentionPolicy.RUNTIME) 26 | public @interface CombinedAnnotation { 27 | SimpleAnnotation[] value(); 28 | } 29 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/data/ComplexAnnotatedClass.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.apache.bcel.data; 21 | 22 | @ComplexAnnotation(ival = 4, bval = 2, cval = '5', fval = 3.0f, dval = 33.4, zval = false, jval = 56, sval = 99) 23 | public class ComplexAnnotatedClass { 24 | } 25 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/data/ComplexAnnotation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.apache.bcel.data; 21 | 22 | import java.lang.annotation.Retention; 23 | import java.lang.annotation.RetentionPolicy; 24 | 25 | @Retention(RetentionPolicy.RUNTIME) 26 | public @interface ComplexAnnotation { 27 | byte bval(); 28 | 29 | char cval(); 30 | 31 | double dval(); 32 | 33 | float fval(); 34 | 35 | int ival(); 36 | 37 | long jval(); 38 | 39 | short sval(); 40 | 41 | boolean zval(); 42 | } 43 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/data/EmptyClass.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.apache.bcel.data; 21 | 22 | public class EmptyClass { 23 | } 24 | 25 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/data/MarkedType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.apache.bcel.data; 21 | 22 | @MarkerAnnotationInvisible 23 | @MarkerAnnotation 24 | public class MarkedType { 25 | } 26 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/data/MarkerAnnotation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.apache.bcel.data; 21 | 22 | import java.lang.annotation.Retention; 23 | import java.lang.annotation.RetentionPolicy; 24 | 25 | @Retention(RetentionPolicy.RUNTIME) 26 | public @interface MarkerAnnotation { 27 | } 28 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/data/MarkerAnnotationInvisible.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.apache.bcel.data; 21 | 22 | import java.lang.annotation.Retention; 23 | import java.lang.annotation.RetentionPolicy; 24 | 25 | @Retention(RetentionPolicy.CLASS) 26 | public @interface MarkerAnnotationInvisible { 27 | } 28 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/data/PLSETestClass.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.apache.bcel.data; 21 | 22 | import java.util.ArrayList; 23 | 24 | public class PLSETestClass { 25 | public void meth1(final int arg1) { 26 | @SuppressWarnings("unused") 27 | final int local1 = arg1; 28 | } 29 | 30 | public void meth2(final int arg1, final ArrayList arg2, final int arg3) { 31 | @SuppressWarnings("unused") 32 | final int local1 = arg1; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/data/PLSETestClass2.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.apache.bcel.data; 21 | 22 | public class PLSETestClass2 { 23 | public static void main(final String[] args) { 24 | @SuppressWarnings("unused") 25 | int t = 0; 26 | 27 | for (int i = 0; i < 100; i++) { 28 | t += i; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/data/PLSETestEnum.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.apache.bcel.data; 21 | 22 | public enum PLSETestEnum { 23 | TEST_VALUE 24 | } 25 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/data/SimpleAnnotatedClass.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.apache.bcel.data; 21 | 22 | @SimpleAnnotation(id = 4) 23 | public class SimpleAnnotatedClass { 24 | } 25 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/data/SimpleAnnotation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.apache.bcel.data; 21 | 22 | import java.lang.annotation.Retention; 23 | import java.lang.annotation.RetentionPolicy; 24 | 25 | @Retention(RetentionPolicy.RUNTIME) 26 | public @interface SimpleAnnotation { 27 | String fruit() default "bananas"; 28 | 29 | int id(); 30 | } 31 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/data/SimpleClass.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.apache.bcel.data; 21 | 22 | public class SimpleClass { 23 | public static void main(final String[] argv) { 24 | // Nothing unusual in this class 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/data/SimpleClassHasMethodIncludeGenericArgument.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.data; 20 | 21 | import java.util.List; 22 | 23 | public class SimpleClassHasMethodIncludeGenericArgument { 24 | public static void a(final String a1, final List a2) { 25 | } 26 | 27 | public static void b(final String b1, @SuppressWarnings("rawtypes") final List b2) { 28 | } 29 | 30 | public static void c(final String c1, final String c2) { 31 | } 32 | 33 | public static void d(final List d1, final String d2) { 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/data/SimpleClassWithDefaultConstructor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.apache.bcel.data; 21 | 22 | public class SimpleClassWithDefaultConstructor { 23 | 24 | public SimpleClassWithDefaultConstructor() { 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/data/SimpleEnum.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.apache.bcel.data; 21 | 22 | public enum SimpleEnum { 23 | Red, Orange, Yellow, Green, Blue, Indigo, Violet 24 | } 25 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/generic/BREAKPOINTTestCase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.generic; 20 | 21 | import static org.junit.jupiter.api.Assertions.assertEquals; 22 | 23 | import org.junit.jupiter.api.Test; 24 | 25 | public class BREAKPOINTTestCase { 26 | @Test 27 | public void testAccept() { 28 | final CountingVisitor countVisitor = new CountingVisitor(); 29 | final BREAKPOINT breakpoint = new BREAKPOINT(); 30 | breakpoint.accept(countVisitor); 31 | final CountingVisitor expected = new CountingVisitor(); 32 | expected.setBreakpoint(1); 33 | assertEquals(expected, countVisitor); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/generic/D2FTestCase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.generic; 20 | 21 | import static org.junit.jupiter.api.Assertions.assertEquals; 22 | 23 | import org.junit.jupiter.api.Test; 24 | 25 | public class D2FTestCase { 26 | @Test 27 | public void testAccept() { 28 | final CountingVisitor countVisitor = new CountingVisitor(); 29 | final D2F d2f = new D2F(); 30 | d2f.accept(countVisitor); 31 | final CountingVisitor expected = new CountingVisitor(); 32 | expected.setTypedInstruction(1); 33 | expected.setStackProducer(1); 34 | expected.setStackConsumer(1); 35 | expected.setConversionInstruction(1); 36 | expected.setD2F(1); 37 | assertEquals(expected, countVisitor); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/generic/D2ITestCase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.generic; 20 | 21 | import static org.junit.jupiter.api.Assertions.assertEquals; 22 | 23 | import org.junit.jupiter.api.Test; 24 | 25 | public class D2ITestCase { 26 | @Test 27 | public void testAccept() { 28 | final CountingVisitor countVisitor = new CountingVisitor(); 29 | final D2I d2i = new D2I(); 30 | d2i.accept(countVisitor); 31 | final CountingVisitor expected = new CountingVisitor(); 32 | expected.setTypedInstruction(1); 33 | expected.setStackProducer(1); 34 | expected.setStackConsumer(1); 35 | expected.setConversionInstruction(1); 36 | expected.setD2I(1); 37 | assertEquals(expected, countVisitor); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/generic/D2LTestCase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.generic; 20 | 21 | import static org.junit.jupiter.api.Assertions.assertEquals; 22 | 23 | import org.junit.jupiter.api.Test; 24 | 25 | public class D2LTestCase { 26 | @Test 27 | public void testAccept() { 28 | final CountingVisitor countVisitor = new CountingVisitor(); 29 | final D2L d2l = new D2L(); 30 | d2l.accept(countVisitor); 31 | final CountingVisitor expected = new CountingVisitor(); 32 | expected.setTypedInstruction(1); 33 | expected.setStackProducer(1); 34 | expected.setStackConsumer(1); 35 | expected.setConversionInstruction(1); 36 | expected.setD2L(1); 37 | assertEquals(expected, countVisitor); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/generic/DADDTestCase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.generic; 20 | 21 | import static org.junit.jupiter.api.Assertions.assertEquals; 22 | 23 | import org.junit.jupiter.api.Test; 24 | 25 | public class DADDTestCase { 26 | @Test 27 | public void testAccept() { 28 | final CountingVisitor countVisitor = new CountingVisitor(); 29 | final DADD dadd = new DADD(); 30 | dadd.accept(countVisitor); 31 | final CountingVisitor expected = new CountingVisitor(); 32 | expected.setTypedInstruction(1); 33 | expected.setStackProducer(1); 34 | expected.setStackConsumer(1); 35 | expected.setArithmeticInstruction(1); 36 | expected.setDadd(1); 37 | assertEquals(expected, countVisitor); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/generic/DDIVTestCase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.generic; 20 | 21 | import static org.junit.jupiter.api.Assertions.assertEquals; 22 | 23 | import org.junit.jupiter.api.Test; 24 | 25 | public class DDIVTestCase { 26 | @Test 27 | public void testAccept() { 28 | final CountingVisitor countVisitor = new CountingVisitor(); 29 | final DDIV ddiv = new DDIV(); 30 | ddiv.accept(countVisitor); 31 | final CountingVisitor expected = new CountingVisitor(); 32 | expected.setTypedInstruction(1); 33 | expected.setStackProducer(1); 34 | expected.setStackConsumer(1); 35 | expected.setArithmeticInstruction(1); 36 | expected.setDdiv(1); 37 | assertEquals(expected, countVisitor); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/generic/DMULTestCase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.generic; 20 | 21 | import static org.junit.jupiter.api.Assertions.assertEquals; 22 | 23 | import org.junit.jupiter.api.Test; 24 | 25 | public class DMULTestCase { 26 | @Test 27 | public void testAccept() { 28 | final CountingVisitor countVisitor = new CountingVisitor(); 29 | final DMUL dmul = new DMUL(); 30 | dmul.accept(countVisitor); 31 | final CountingVisitor expected = new CountingVisitor(); 32 | expected.setTypedInstruction(1); 33 | expected.setStackProducer(1); 34 | expected.setStackConsumer(1); 35 | expected.setArithmeticInstruction(1); 36 | expected.setDmul(1); 37 | assertEquals(expected, countVisitor); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/generic/DNEGTestCase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.generic; 20 | 21 | import static org.junit.jupiter.api.Assertions.assertEquals; 22 | 23 | import org.junit.jupiter.api.Test; 24 | 25 | public class DNEGTestCase { 26 | @Test 27 | public void testAccept() { 28 | final CountingVisitor countVisitor = new CountingVisitor(); 29 | final DNEG dneg = new DNEG(); 30 | dneg.accept(countVisitor); 31 | final CountingVisitor expected = new CountingVisitor(); 32 | expected.setTypedInstruction(1); 33 | expected.setStackProducer(1); 34 | expected.setStackConsumer(1); 35 | expected.setArithmeticInstruction(1); 36 | expected.setDneg(1); 37 | assertEquals(expected, countVisitor); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/generic/DREMTestCase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.generic; 20 | 21 | import static org.junit.jupiter.api.Assertions.assertEquals; 22 | 23 | import org.junit.jupiter.api.Test; 24 | 25 | public class DREMTestCase { 26 | @Test 27 | public void testAccept() { 28 | final CountingVisitor countVisitor = new CountingVisitor(); 29 | final DREM drem = new DREM(); 30 | drem.accept(countVisitor); 31 | final CountingVisitor expected = new CountingVisitor(); 32 | expected.setTypedInstruction(1); 33 | expected.setStackProducer(1); 34 | expected.setStackConsumer(1); 35 | expected.setArithmeticInstruction(1); 36 | expected.setDrem(1); 37 | assertEquals(expected, countVisitor); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/generic/DSUBTestCase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.generic; 20 | 21 | import static org.junit.jupiter.api.Assertions.assertEquals; 22 | 23 | import org.junit.jupiter.api.Test; 24 | 25 | public class DSUBTestCase { 26 | @Test 27 | public void testAccept() { 28 | final CountingVisitor countVisitor = new CountingVisitor(); 29 | final DSUB dsub = new DSUB(); 30 | dsub.accept(countVisitor); 31 | final CountingVisitor expected = new CountingVisitor(); 32 | expected.setTypedInstruction(1); 33 | expected.setStackProducer(1); 34 | expected.setStackConsumer(1); 35 | expected.setArithmeticInstruction(1); 36 | expected.setDsub(1); 37 | assertEquals(expected, countVisitor); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/generic/EmptyStaticInit.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.generic; 20 | 21 | /** 22 | */ 23 | public class EmptyStaticInit { 24 | 25 | static { 26 | // empty 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/generic/F2DTestCase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.generic; 20 | 21 | import static org.junit.jupiter.api.Assertions.assertEquals; 22 | 23 | import org.junit.jupiter.api.Test; 24 | 25 | public class F2DTestCase { 26 | @Test 27 | public void testAccept() { 28 | final CountingVisitor countVisitor = new CountingVisitor(); 29 | final F2D f2d = new F2D(); 30 | f2d.accept(countVisitor); 31 | final CountingVisitor expected = new CountingVisitor(); 32 | expected.setTypedInstruction(1); 33 | expected.setStackProducer(1); 34 | expected.setStackConsumer(1); 35 | expected.setConversionInstruction(1); 36 | expected.setF2D(1); 37 | assertEquals(expected, countVisitor); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/generic/F2ITestCase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.generic; 20 | 21 | import static org.junit.jupiter.api.Assertions.assertEquals; 22 | 23 | import org.junit.jupiter.api.Test; 24 | 25 | public class F2ITestCase { 26 | @Test 27 | public void testAccept() { 28 | final CountingVisitor countVisitor = new CountingVisitor(); 29 | final F2I f2i = new F2I(); 30 | f2i.accept(countVisitor); 31 | final CountingVisitor expected = new CountingVisitor(); 32 | expected.setTypedInstruction(1); 33 | expected.setStackProducer(1); 34 | expected.setStackConsumer(1); 35 | expected.setConversionInstruction(1); 36 | expected.setF2I(1); 37 | assertEquals(expected, countVisitor); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/generic/F2LTestCase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.generic; 20 | 21 | import static org.junit.jupiter.api.Assertions.assertEquals; 22 | 23 | import org.junit.jupiter.api.Test; 24 | 25 | public class F2LTestCase { 26 | @Test 27 | public void testAccept() { 28 | final CountingVisitor countVisitor = new CountingVisitor(); 29 | final F2L f2l = new F2L(); 30 | f2l.accept(countVisitor); 31 | final CountingVisitor expected = new CountingVisitor(); 32 | expected.setTypedInstruction(1); 33 | expected.setStackProducer(1); 34 | expected.setStackConsumer(1); 35 | expected.setConversionInstruction(1); 36 | expected.setF2L(1); 37 | assertEquals(expected, countVisitor); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/generic/FADDTestCase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.generic; 20 | 21 | import static org.junit.jupiter.api.Assertions.assertEquals; 22 | 23 | import org.junit.jupiter.api.Test; 24 | 25 | public class FADDTestCase { 26 | @Test 27 | public void testAccept() { 28 | final CountingVisitor countVisitor = new CountingVisitor(); 29 | final FADD fadd = new FADD(); 30 | fadd.accept(countVisitor); 31 | final CountingVisitor expected = new CountingVisitor(); 32 | expected.setTypedInstruction(1); 33 | expected.setStackProducer(1); 34 | expected.setStackConsumer(1); 35 | expected.setArithmeticInstruction(1); 36 | expected.setFadd(1); 37 | assertEquals(expected, countVisitor); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/generic/FDIVTestCase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.generic; 20 | 21 | import static org.junit.jupiter.api.Assertions.assertEquals; 22 | 23 | import org.junit.jupiter.api.Test; 24 | 25 | public class FDIVTestCase { 26 | @Test 27 | public void testAccept() { 28 | final CountingVisitor countVisitor = new CountingVisitor(); 29 | final FDIV fdiv = new FDIV(); 30 | fdiv.accept(countVisitor); 31 | final CountingVisitor expected = new CountingVisitor(); 32 | expected.setTypedInstruction(1); 33 | expected.setStackProducer(1); 34 | expected.setStackConsumer(1); 35 | expected.setArithmeticInstruction(1); 36 | expected.setFdiv(1); 37 | assertEquals(expected, countVisitor); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/generic/I2BTestCase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.generic; 20 | 21 | import static org.junit.jupiter.api.Assertions.assertEquals; 22 | 23 | import org.junit.jupiter.api.Test; 24 | 25 | public class I2BTestCase { 26 | @Test 27 | public void testAccept() { 28 | final CountingVisitor countVisitor = new CountingVisitor(); 29 | final I2B i2b = new I2B(); 30 | i2b.accept(countVisitor); 31 | final CountingVisitor expected = new CountingVisitor(); 32 | expected.setTypedInstruction(1); 33 | expected.setStackProducer(1); 34 | expected.setStackConsumer(1); 35 | expected.setConversionInstruction(1); 36 | expected.setI2B(1); 37 | assertEquals(expected, countVisitor); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/generic/I2CTestCase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.generic; 20 | 21 | import static org.junit.jupiter.api.Assertions.assertEquals; 22 | 23 | import org.junit.jupiter.api.Test; 24 | 25 | public class I2CTestCase { 26 | @Test 27 | public void testAccept() { 28 | final CountingVisitor countVisitor = new CountingVisitor(); 29 | final I2C i2c = new I2C(); 30 | i2c.accept(countVisitor); 31 | final CountingVisitor expected = new CountingVisitor(); 32 | expected.setTypedInstruction(1); 33 | expected.setStackProducer(1); 34 | expected.setStackConsumer(1); 35 | expected.setConversionInstruction(1); 36 | expected.setI2C(1); 37 | assertEquals(expected, countVisitor); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/generic/I2DTestCase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.generic; 20 | 21 | import static org.junit.jupiter.api.Assertions.assertEquals; 22 | 23 | import org.junit.jupiter.api.Test; 24 | 25 | public class I2DTestCase { 26 | @Test 27 | public void testAccept() { 28 | final CountingVisitor countVisitor = new CountingVisitor(); 29 | final I2D i2d = new I2D(); 30 | i2d.accept(countVisitor); 31 | final CountingVisitor expected = new CountingVisitor(); 32 | expected.setTypedInstruction(1); 33 | expected.setStackProducer(1); 34 | expected.setStackConsumer(1); 35 | expected.setConversionInstruction(1); 36 | expected.setI2D(1); 37 | assertEquals(expected, countVisitor); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/generic/I2FTestCase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.generic; 20 | 21 | import static org.junit.jupiter.api.Assertions.assertEquals; 22 | 23 | import org.junit.jupiter.api.Test; 24 | 25 | public class I2FTestCase { 26 | @Test 27 | public void testAccept() { 28 | final CountingVisitor countVisitor = new CountingVisitor(); 29 | final I2F i2f = new I2F(); 30 | i2f.accept(countVisitor); 31 | final CountingVisitor expected = new CountingVisitor(); 32 | expected.setTypedInstruction(1); 33 | expected.setStackProducer(1); 34 | expected.setStackConsumer(1); 35 | expected.setConversionInstruction(1); 36 | expected.setI2F(1); 37 | assertEquals(expected, countVisitor); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/generic/I2LTestCase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.generic; 20 | 21 | import static org.junit.jupiter.api.Assertions.assertEquals; 22 | 23 | import org.junit.jupiter.api.Test; 24 | 25 | public class I2LTestCase { 26 | @Test 27 | public void testAccept() { 28 | final CountingVisitor countVisitor = new CountingVisitor(); 29 | final I2L i2l = new I2L(); 30 | i2l.accept(countVisitor); 31 | final CountingVisitor expected = new CountingVisitor(); 32 | expected.setTypedInstruction(1); 33 | expected.setStackProducer(1); 34 | expected.setStackConsumer(1); 35 | expected.setConversionInstruction(1); 36 | expected.setI2L(1); 37 | assertEquals(expected, countVisitor); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/generic/I2STestCase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.generic; 20 | 21 | import static org.junit.jupiter.api.Assertions.assertEquals; 22 | 23 | import org.junit.jupiter.api.Test; 24 | 25 | public class I2STestCase { 26 | @Test 27 | public void testAccept() { 28 | final CountingVisitor countVisitor = new CountingVisitor(); 29 | final I2S i2s = new I2S(); 30 | i2s.accept(countVisitor); 31 | final CountingVisitor expected = new CountingVisitor(); 32 | expected.setTypedInstruction(1); 33 | expected.setStackProducer(1); 34 | expected.setStackConsumer(1); 35 | expected.setConversionInstruction(1); 36 | expected.setI2S(1); 37 | assertEquals(expected, countVisitor); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/generic/IMPDEP1TestCase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.generic; 20 | 21 | import static org.junit.jupiter.api.Assertions.assertEquals; 22 | 23 | import org.junit.jupiter.api.Test; 24 | 25 | public class IMPDEP1TestCase { 26 | @Test 27 | public void testAccept() { 28 | final CountingVisitor countVisitor = new CountingVisitor(); 29 | final IMPDEP1 impdep1 = new IMPDEP1(); 30 | impdep1.accept(countVisitor); 31 | final CountingVisitor expected = new CountingVisitor(); 32 | expected.setImpdep1(1); 33 | assertEquals(expected, countVisitor); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/generic/IMPDEP2TestCase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.generic; 20 | 21 | import static org.junit.jupiter.api.Assertions.assertEquals; 22 | 23 | import org.junit.jupiter.api.Test; 24 | 25 | public class IMPDEP2TestCase { 26 | @Test 27 | public void testAccept() { 28 | final CountingVisitor countVisitor = new CountingVisitor(); 29 | final IMPDEP2 impdep2 = new IMPDEP2(); 30 | impdep2.accept(countVisitor); 31 | final CountingVisitor expected = new CountingVisitor(); 32 | expected.setImpdep2(1); 33 | assertEquals(expected, countVisitor); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/generic/IORTestCase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.generic; 20 | 21 | import static org.junit.jupiter.api.Assertions.assertEquals; 22 | 23 | import org.junit.jupiter.api.Test; 24 | 25 | public class IORTestCase { 26 | @Test 27 | public void testAccept() { 28 | final CountingVisitor countVisitor = new CountingVisitor(); 29 | final IOR ior = new IOR(); 30 | ior.accept(countVisitor); 31 | final CountingVisitor expected = new CountingVisitor(); 32 | expected.setTypedInstruction(1); 33 | expected.setStackProducer(1); 34 | expected.setStackConsumer(1); 35 | expected.setArithmeticInstruction(1); 36 | expected.setIor(1); 37 | assertEquals(expected, countVisitor); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/generic/L2DTestCase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.generic; 20 | 21 | import static org.junit.jupiter.api.Assertions.assertEquals; 22 | 23 | import org.junit.jupiter.api.Test; 24 | 25 | public class L2DTestCase { 26 | @Test 27 | public void testAccept() { 28 | final CountingVisitor countVisitor = new CountingVisitor(); 29 | final L2D l2d = new L2D(); 30 | l2d.accept(countVisitor); 31 | final CountingVisitor expected = new CountingVisitor(); 32 | expected.setTypedInstruction(1); 33 | expected.setStackProducer(1); 34 | expected.setStackConsumer(1); 35 | expected.setConversionInstruction(1); 36 | expected.setL2D(1); 37 | assertEquals(expected, countVisitor); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/generic/L2FTestCase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.generic; 20 | 21 | import static org.junit.jupiter.api.Assertions.assertEquals; 22 | 23 | import org.junit.jupiter.api.Test; 24 | 25 | public class L2FTestCase { 26 | @Test 27 | public void testAccept() { 28 | final CountingVisitor countVisitor = new CountingVisitor(); 29 | final L2F l2f = new L2F(); 30 | l2f.accept(countVisitor); 31 | final CountingVisitor expected = new CountingVisitor(); 32 | expected.setTypedInstruction(1); 33 | expected.setStackProducer(1); 34 | expected.setStackConsumer(1); 35 | expected.setConversionInstruction(1); 36 | expected.setL2F(1); 37 | assertEquals(expected, countVisitor); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/generic/L2ITestCase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.generic; 20 | 21 | import static org.junit.jupiter.api.Assertions.assertEquals; 22 | 23 | import org.junit.jupiter.api.Test; 24 | 25 | public class L2ITestCase { 26 | @Test 27 | public void testAccept() { 28 | final CountingVisitor countVisitor = new CountingVisitor(); 29 | final L2I l2i = new L2I(); 30 | l2i.accept(countVisitor); 31 | final CountingVisitor expected = new CountingVisitor(); 32 | expected.setTypedInstruction(1); 33 | expected.setStackProducer(1); 34 | expected.setStackConsumer(1); 35 | expected.setConversionInstruction(1); 36 | expected.setL2I(1); 37 | assertEquals(expected, countVisitor); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/generic/LCMPTestCase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.generic; 20 | 21 | import static org.junit.jupiter.api.Assertions.assertEquals; 22 | 23 | import org.junit.jupiter.api.Test; 24 | 25 | public class LCMPTestCase { 26 | @Test 27 | public void testAccept() { 28 | final CountingVisitor countVisitor = new CountingVisitor(); 29 | final LCMP lcmp = new LCMP(); 30 | lcmp.accept(countVisitor); 31 | final CountingVisitor expected = new CountingVisitor(); 32 | expected.setTypedInstruction(1); 33 | expected.setStackProducer(1); 34 | expected.setStackConsumer(1); 35 | expected.setLcmp(1); 36 | assertEquals(expected, countVisitor); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/generic/LORTestCase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.generic; 20 | 21 | import static org.junit.jupiter.api.Assertions.assertEquals; 22 | 23 | import org.junit.jupiter.api.Test; 24 | 25 | public class LORTestCase { 26 | @Test 27 | public void testAccept() { 28 | final CountingVisitor countVisitor = new CountingVisitor(); 29 | final LOR lor = new LOR(); 30 | lor.accept(countVisitor); 31 | final CountingVisitor expected = new CountingVisitor(); 32 | expected.setTypedInstruction(1); 33 | expected.setStackProducer(1); 34 | expected.setStackConsumer(1); 35 | expected.setArithmeticInstruction(1); 36 | expected.setLor(1); 37 | assertEquals(expected, countVisitor); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/generic/ObjectTypeTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.apache.bcel.generic; 21 | 22 | import static org.junit.jupiter.api.Assertions.assertEquals; 23 | 24 | import java.math.BigDecimal; 25 | 26 | import org.junit.jupiter.api.Test; 27 | 28 | public class ObjectTypeTest { 29 | 30 | @Test 31 | public void testGetClassName() { 32 | final String className = BigDecimal.class.getName(); 33 | final ObjectType objectType = ObjectType.getInstance(className); 34 | assertEquals(className, objectType.getClassName()); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/verifier/JiraBcel291TestCase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.apache.bcel.verifier; 21 | 22 | import org.junit.jupiter.api.Disabled; 23 | import org.junit.jupiter.api.Test; 24 | 25 | @Disabled 26 | public class JiraBcel291TestCase { 27 | 28 | @Test 29 | public void test() throws ClassNotFoundException { 30 | Verifier.verifyType("org.apache.bcel.verifier.tests.JiraBcel291TestFixture"); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/verifier/JiraBcel369TestFixture.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.verifier; 20 | 21 | final class JiraBcel369TestFixture { 22 | 23 | JiraBcel369TestFixture(int i) { 24 | try { 25 | i++; 26 | } finally { 27 | if (i == 0) { 28 | return; 29 | } 30 | int u = 7; 31 | u += 9; 32 | } 33 | i++; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/verifier/VerifierThrowTestCase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.apache.bcel.verifier; 21 | 22 | import java.io.IOException; 23 | 24 | import org.apache.bcel.verifier.tests.TestThrow01Creator; 25 | import org.junit.jupiter.api.Test; 26 | 27 | public class VerifierThrowTestCase extends AbstractVerifierTestCase { 28 | @Test 29 | public void testThrowEmptyStack() throws IOException, ClassNotFoundException { 30 | new TestThrow01Creator().create(); 31 | assertVerifyRejected("TestThrow01", "Verification of a method with ATHROW instruction on an empty stack must fail."); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/verifier/VerifyJavaMathTestCase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.apache.bcel.verifier; 21 | 22 | import static org.junit.jupiter.api.Assertions.assertTrue; 23 | 24 | import org.junit.jupiter.api.Disabled; 25 | import org.junit.jupiter.api.Test; 26 | 27 | public class VerifyJavaMathTestCase extends AbstractVerifierTestCase { 28 | 29 | @Test 30 | @Disabled 31 | //@EnabledOnJre(JRE.JAVA_8) 32 | public void testBigDecimal() throws ClassNotFoundException { 33 | assertTrue(doAllPasses("java.math.BigDecimal")); 34 | } 35 | 36 | @Disabled 37 | @Test 38 | public void testBigInteger() throws ClassNotFoundException { 39 | assertTrue(doAllPasses("java.math.BigInteger")); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/verifier/input/FieldVerifierSuperClass.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.apache.bcel.verifier.input; 21 | 22 | public class FieldVerifierSuperClass { 23 | 24 | public int publicField; 25 | private final int privateField; 26 | protected int protectedField; 27 | int packagePrivateField; 28 | 29 | public FieldVerifierSuperClass(final int publicField, final int privateField, final int protectedField, final int packagePrivateField) { 30 | this.publicField = publicField; 31 | this.privateField = privateField; 32 | this.protectedField = protectedField; 33 | this.packagePrivateField = packagePrivateField; 34 | } 35 | 36 | public int getPrivateField() { 37 | return privateField; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/verifier/statics/Pass2VerifierTestCase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.apache.bcel.verifier.statics; 21 | 22 | import org.apache.bcel.Constants; 23 | import org.junit.jupiter.api.Test; 24 | 25 | public class Pass2VerifierTestCase { 26 | 27 | /** 28 | * Tests that we do not break binary compatibility with BCEL-330. 29 | */ 30 | @Test 31 | public void testReferenceToConstant() { 32 | @SuppressWarnings("unused") 33 | final short referenceToConstant = Constants.AALOAD; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/verifier/structurals/UninitializedObjectTypeTestCase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.apache.bcel.verifier.structurals; 21 | 22 | import org.apache.bcel.Constants; 23 | import org.junit.jupiter.api.Test; 24 | 25 | public class UninitializedObjectTypeTestCase { 26 | 27 | /** 28 | * Tests that we do not break binary compatibility with BCEL-330. 29 | */ 30 | @Test 31 | public void testReferenceToConstant() { 32 | @SuppressWarnings("unused") 33 | final short referenceToConstant = Constants.AALOAD; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/verifier/tests/JiraBcel291TestFixture.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.apache.bcel.verifier.tests; 21 | 22 | public class JiraBcel291TestFixture { 23 | 24 | public static Object[] bug(final Object[] arg) { 25 | return arg.clone(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/verifier/tests/TestArrayAccess01.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.verifier.tests; 20 | 21 | public class TestArrayAccess01 extends XTestArray01 { 22 | 23 | public static void test() { 24 | final XTestArray01[] array = new TestArrayAccess01[1]; 25 | array[0] = new XTestArray01(); 26 | } 27 | 28 | } 29 | 30 | class XTestArray01 { 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/verifier/tests/TestArrayAccess04DoubleCreator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.apache.bcel.verifier.tests; 21 | 22 | import org.apache.bcel.generic.Type; 23 | 24 | public class TestArrayAccess04DoubleCreator extends TestArrayAccess04Creator { 25 | 26 | public TestArrayAccess04DoubleCreator() { 27 | super(Type.DOUBLE, "Double"); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/verifier/tests/TestArrayAccess04FloatCreator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.apache.bcel.verifier.tests; 21 | 22 | import org.apache.bcel.generic.Type; 23 | 24 | public class TestArrayAccess04FloatCreator extends TestArrayAccess04Creator { 25 | 26 | public TestArrayAccess04FloatCreator() { 27 | super(Type.FLOAT, "Float"); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/verifier/tests/TestArrayAccess04IntCreator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.apache.bcel.verifier.tests; 21 | 22 | import org.apache.bcel.generic.Type; 23 | 24 | public class TestArrayAccess04IntCreator extends TestArrayAccess04Creator { 25 | 26 | public TestArrayAccess04IntCreator() { 27 | super(Type.INT, "Int"); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/verifier/tests/TestArrayAccess04LongCreator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.apache.bcel.verifier.tests; 21 | 22 | import org.apache.bcel.generic.Type; 23 | 24 | public class TestArrayAccess04LongCreator extends TestArrayAccess04Creator { 25 | 26 | public TestArrayAccess04LongCreator() { 27 | super(Type.LONG, "Long"); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/verifier/tests/TestArrayAccess04ShortCreator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.apache.bcel.verifier.tests; 21 | 22 | import org.apache.bcel.generic.Type; 23 | 24 | public class TestArrayAccess04ShortCreator extends TestArrayAccess04Creator { 25 | 26 | public TestArrayAccess04ShortCreator() { 27 | super(Type.SHORT, "Short"); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/verifier/tests/TestArrayAccess04UnknownCreator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.apache.bcel.verifier.tests; 21 | 22 | import org.apache.bcel.generic.Type; 23 | 24 | public class TestArrayAccess04UnknownCreator extends TestArrayAccess04Creator { 25 | 26 | public TestArrayAccess04UnknownCreator() { 27 | super(Type.UNKNOWN, null); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/verifier/tests/TestLegalInvokeInterface01.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.verifier.tests; 20 | 21 | interface Interface01 extends Runnable { 22 | 23 | } 24 | 25 | public class TestLegalInvokeInterface01 { 26 | 27 | public static void test1(final Interface01 t) { 28 | t.run(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/verifier/tests/TestLegalInvokeSpecial01.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.verifier.tests; 20 | 21 | public class TestLegalInvokeSpecial01 { 22 | 23 | public static void test1() { 24 | new TestLegalInvokeSpecial01().getClass(); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/verifier/tests/TestLegalInvokeSpecial02.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.verifier.tests; 20 | 21 | public abstract class TestLegalInvokeSpecial02 implements Runnable { 22 | 23 | public static void test1(final TestLegalInvokeSpecial02 t, final int i) { 24 | if (i > 0) { 25 | t.run(); 26 | } 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/verifier/tests/TestLegalInvokeStatic01.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.verifier.tests; 20 | 21 | public class TestLegalInvokeStatic01 extends Thread { 22 | 23 | public static void test1() throws InterruptedException { 24 | Thread.sleep(0); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/verifier/tests/TestLegalInvokeVirtual01.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.verifier.tests; 20 | 21 | public class TestLegalInvokeVirtual01 { 22 | 23 | public static void test1() { 24 | new TestLegalInvokeVirtual01().toString(); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/verifier/tests/TestLegalInvokeVirtual02.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.verifier.tests; 20 | 21 | public abstract class TestLegalInvokeVirtual02 implements Runnable { 22 | 23 | public static void test1(final TestLegalInvokeVirtual02 t, final int i) { 24 | if (i > 0) { 25 | t.run(); 26 | } 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/verifier/tests/TestReturn03BooleanCreator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.verifier.tests; 20 | 21 | import org.apache.bcel.generic.Type; 22 | 23 | public class TestReturn03BooleanCreator extends TestReturn03Creator { 24 | 25 | public TestReturn03BooleanCreator() { 26 | super(Type.BOOLEAN, "Boolean"); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/verifier/tests/TestReturn03ByteCreator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.verifier.tests; 20 | 21 | import org.apache.bcel.generic.Type; 22 | 23 | public class TestReturn03ByteCreator extends TestReturn03Creator { 24 | 25 | public TestReturn03ByteCreator() { 26 | super(Type.BYTE, "Byte"); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/verifier/tests/TestReturn03DoubleCreator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.verifier.tests; 20 | 21 | import org.apache.bcel.generic.Type; 22 | 23 | public class TestReturn03DoubleCreator extends TestReturn03Creator { 24 | 25 | public TestReturn03DoubleCreator() { 26 | super(Type.DOUBLE, "Double"); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/verifier/tests/TestReturn03FloatCreator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.verifier.tests; 20 | 21 | import org.apache.bcel.generic.Type; 22 | 23 | public class TestReturn03FloatCreator extends TestReturn03Creator { 24 | 25 | public TestReturn03FloatCreator() { 26 | super(Type.FLOAT, "Float"); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/verifier/tests/TestReturn03IntCreator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.verifier.tests; 20 | 21 | import org.apache.bcel.generic.Type; 22 | 23 | public class TestReturn03IntCreator extends TestReturn03Creator { 24 | 25 | public TestReturn03IntCreator() { 26 | super(Type.INT, "Int"); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/verifier/tests/TestReturn03LongCreator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.verifier.tests; 20 | 21 | import org.apache.bcel.generic.Type; 22 | 23 | public class TestReturn03LongCreator extends TestReturn03Creator { 24 | 25 | public TestReturn03LongCreator() { 26 | super(Type.LONG, "Long"); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/verifier/tests/TestReturn03ObjectCreator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.verifier.tests; 20 | 21 | import org.apache.bcel.generic.Type; 22 | 23 | public class TestReturn03ObjectCreator extends TestReturn03Creator { 24 | 25 | public TestReturn03ObjectCreator() { 26 | super(Type.OBJECT, "Object"); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/verifier/tests/TestReturn03ShortCreator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.verifier.tests; 20 | 21 | import org.apache.bcel.generic.Type; 22 | 23 | public class TestReturn03ShortCreator extends TestReturn03Creator { 24 | 25 | public TestReturn03ShortCreator() { 26 | super(Type.SHORT, "Short"); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/test/java/org/apache/bcel/verifier/tests/TestReturn03UnknownCreator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.bcel.verifier.tests; 20 | 21 | import org.apache.bcel.generic.Type; 22 | 23 | public class TestReturn03UnknownCreator extends TestReturn03Creator { 24 | 25 | public TestReturn03UnknownCreator() { 26 | super(Type.UNKNOWN, null); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/test/resources/Java4Example.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/Java4Example.class -------------------------------------------------------------------------------- /src/test/resources/Java8Example.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/Java8Example.class -------------------------------------------------------------------------------- /src/test/resources/Java8Example.java: -------------------------------------------------------------------------------- 1 | import java.util.*; 2 | import java.util.stream.*; 3 | 4 | public interface Java8Example { 5 | 6 | default void hello() { 7 | List words = Arrays.asList("Hello", "World", "hi"); 8 | System.out.println(words); 9 | 10 | List words2 = words.stream().filter((String s) -> s.length() > 2).collect(Collectors. toList()); 11 | System.out.println(words2); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/test/resources/Java8Example2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/Java8Example2.class -------------------------------------------------------------------------------- /src/test/resources/StackMapExample.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/StackMapExample.class -------------------------------------------------------------------------------- /src/test/resources/StackMapExample.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Example to check if BCELifier generates the stack map table 3 | * so that the generated class passes the Java verifier checks. 4 | */ 5 | public abstract class StackMapExample { 6 | 7 | protected abstract void someAbstractMethod(); 8 | 9 | public static void main(final String[] args) { 10 | switch (args[0]) { 11 | case "Hello": 12 | System.out.println("Hello World"); 13 | break; 14 | default: 15 | break; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/test/resources/StackMapExample2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/StackMapExample2.class -------------------------------------------------------------------------------- /src/test/resources/StackMapExample2.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Another version of StackMapExample using 2 types of locals String and int 3 | * instead of just String. 4 | */ 5 | public class StackMapExample2 { 6 | 7 | public static void main(String[] args) { 8 | if (args.length == 1 && "Hello".equals(args[0])) { 9 | System.out.println("Hello World"); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/test/resources/com/foo/Foo.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/com/foo/Foo.class -------------------------------------------------------------------------------- /src/test/resources/com/puppycrawl/tools/checkstyle/grammar/java/JavaLanguageParser$ClassBlockContext.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/com/puppycrawl/tools/checkstyle/grammar/java/JavaLanguageParser$ClassBlockContext.class -------------------------------------------------------------------------------- /src/test/resources/issue303/example/A.classx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/issue303/example/A.classx -------------------------------------------------------------------------------- /src/test/resources/issue307/example/A.classx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/issue307/example/A.classx -------------------------------------------------------------------------------- /src/test/resources/issue308/Hello.classx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/issue308/Hello.classx -------------------------------------------------------------------------------- /src/test/resources/issue309/Hello.classx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/issue309/Hello.classx -------------------------------------------------------------------------------- /src/test/resources/issue310/Hello.classx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/issue310/Hello.classx -------------------------------------------------------------------------------- /src/test/resources/issue311/Hello.classx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/issue311/Hello.classx -------------------------------------------------------------------------------- /src/test/resources/issue312/Hello.classx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/issue312/Hello.classx -------------------------------------------------------------------------------- /src/test/resources/issue313/Hello.classx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/issue313/Hello.classx -------------------------------------------------------------------------------- /src/test/resources/issue337/example/A.classx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/issue337/example/A.classx -------------------------------------------------------------------------------- /src/test/resources/issue362/Bcel362.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/issue362/Bcel362.class -------------------------------------------------------------------------------- /src/test/resources/issue362/Bcel362.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package issue362; 21 | 22 | /** 23 | * Compile to Java 11 byte code, then instrument with JaCoCo in order to add 24 | * condy (constant dynamic) instructions 25 | */ 26 | public class Bcel362 { 27 | public static void main(String[] args) { 28 | System.out.println("Hello world!"); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/test/resources/issue369/Test.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/issue369/Test.class -------------------------------------------------------------------------------- /src/test/resources/jira368/Test.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/jira368/Test.class -------------------------------------------------------------------------------- /src/test/resources/jpms/java11/commons-io/module-info.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/jpms/java11/commons-io/module-info.class -------------------------------------------------------------------------------- /src/test/resources/jpms/java17/commons-io/module-info.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/jpms/java17/commons-io/module-info.class -------------------------------------------------------------------------------- /src/test/resources/jpms/java18/commons-io/module-info.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/jpms/java18/commons-io/module-info.class -------------------------------------------------------------------------------- /src/test/resources/jpms/java19-ea/commons-io/module-info.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/jpms/java19-ea/commons-io/module-info.class -------------------------------------------------------------------------------- /src/test/resources/kotlin/test$method name with () in it$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/kotlin/test$method name with () in it$1.class -------------------------------------------------------------------------------- /src/test/resources/ossfuzz/issue51980/Test.classx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/ossfuzz/issue51980/Test.classx -------------------------------------------------------------------------------- /src/test/resources/ossfuzz/issue51989/Test.classx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/ossfuzz/issue51989/Test.classx -------------------------------------------------------------------------------- /src/test/resources/ossfuzz/issue52168/Test.classx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/ossfuzz/issue52168/Test.classx -------------------------------------------------------------------------------- /src/test/resources/ossfuzz/issue53543/Test.classx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/ossfuzz/issue53543/Test.classx -------------------------------------------------------------------------------- /src/test/resources/ossfuzz/issue53544a/Test.classx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/ossfuzz/issue53544a/Test.classx -------------------------------------------------------------------------------- /src/test/resources/ossfuzz/issue53620/Test.classx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/ossfuzz/issue53620/Test.classx -------------------------------------------------------------------------------- /src/test/resources/ossfuzz/issue53676/Test.classx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/ossfuzz/issue53676/Test.classx -------------------------------------------------------------------------------- /src/test/resources/ossfuzz/issue54119/Test.classx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/ossfuzz/issue54119/Test.classx -------------------------------------------------------------------------------- /src/test/resources/ossfuzz/issue54254/Test.classx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/ossfuzz/issue54254/Test.classx -------------------------------------------------------------------------------- /src/test/resources/ossfuzz/readme.txt: -------------------------------------------------------------------------------- 1 | 19 | Class names here use non-".class" suffix so that Maven plugins like surefire do not try to read the file and fail the build. 20 | -------------------------------------------------------------------------------- /src/test/resources/record/SimpleRecord.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/record/SimpleRecord.class -------------------------------------------------------------------------------- /src/test/resources/record/SimpleRecord.java: -------------------------------------------------------------------------------- 1 | import javax.annotation.Nonnull; 2 | 3 | public record SimpleRecord(int aNumber,@Nonnull String aString) { 4 | 5 | } 6 | --------------------------------------------------------------------------------