diff --git a/sootup.core/src/main/java/sootup/core/IdentifierFactory.java b/sootup.core/src/main/java/sootup/core/IdentifierFactory.java index 2c094925636..cd747f44586 100644 --- a/sootup.core/src/main/java/sootup/core/IdentifierFactory.java +++ b/sootup.core/src/main/java/sootup/core/IdentifierFactory.java @@ -26,7 +26,6 @@ import java.util.List; import java.util.Optional; import javax.annotation.Nonnull; -import sootup.core.model.SootClass; import sootup.core.signatures.FieldSignature; import sootup.core.signatures.FieldSubSignature; import sootup.core.signatures.MethodSignature; @@ -54,15 +53,15 @@ public interface IdentifierFactory { /** * Gets the method signature. * - * @param methodName the method name * @param fullyQualifiedNameDeclClass the fully qualified name decl class + * @param methodName the method name * @param fqReturnType the fq return type * @param parameters the parameters * @return the method signature */ MethodSignature getMethodSignature( - String methodName, String fullyQualifiedNameDeclClass, + String methodName, String fqReturnType, List parameters); @@ -96,17 +95,6 @@ MethodSignature getMethodSignature( Type fqReturnType, List parameters); - /** - * Gets the method signature. - * - * @param declaringClass the declaring class - * @param subSignature the sub signature - * @return the method signature - */ - @Nonnull - MethodSignature getMethodSignature( - @Nonnull SootClass declaringClass, @Nonnull MethodSubSignature subSignature); - /** * Gets the method signature. * diff --git a/sootup.java.bytecode/src/test/java/sootup/java/bytecode/inputlocation/PathBasedAnalysisInputLocationTest.java b/sootup.java.bytecode/src/test/java/sootup/java/bytecode/inputlocation/PathBasedAnalysisInputLocationTest.java index b60892e6002..80ff26614ac 100644 --- a/sootup.java.bytecode/src/test/java/sootup/java/bytecode/inputlocation/PathBasedAnalysisInputLocationTest.java +++ b/sootup.java.bytecode/src/test/java/sootup/java/bytecode/inputlocation/PathBasedAnalysisInputLocationTest.java @@ -380,7 +380,7 @@ public Object resolveAnnotationsDefaultValue() { public MethodSignature getSignature() { return JavaIdentifierFactory.getInstance() .getMethodSignature( - utilsClass, optionalToStreamMethodSubSignature); + utilsClass.getType(), optionalToStreamMethodSubSignature); } }) .withSignature( diff --git a/sootup.java.bytecode/src/test/java/sootup/java/bytecode/interceptors/AggregatorTest.java b/sootup.java.bytecode/src/test/java/sootup/java/bytecode/interceptors/AggregatorTest.java index ca6666af81c..4d3f8635f0c 100644 --- a/sootup.java.bytecode/src/test/java/sootup/java/bytecode/interceptors/AggregatorTest.java +++ b/sootup.java.bytecode/src/test/java/sootup/java/bytecode/interceptors/AggregatorTest.java @@ -88,7 +88,7 @@ private static Body.BodyBuilder createBodyBuilder(boolean withAggregation) { builder.setStartingStmt(intToA); builder.setMethodSignature( JavaIdentifierFactory.getInstance() - .getMethodSignature("test", "ab.c", "void", Collections.emptyList())); + .getMethodSignature("ab.c", "test", "void", Collections.emptyList())); builder.addFlow(intToA, intToB); builder.addFlow(intToB, ret); diff --git a/sootup.java.bytecode/src/test/java/sootup/java/bytecode/interceptors/CastAndReturnInlinerTest.java b/sootup.java.bytecode/src/test/java/sootup/java/bytecode/interceptors/CastAndReturnInlinerTest.java index cf5541c65cf..65cf0a8d025 100644 --- a/sootup.java.bytecode/src/test/java/sootup/java/bytecode/interceptors/CastAndReturnInlinerTest.java +++ b/sootup.java.bytecode/src/test/java/sootup/java/bytecode/interceptors/CastAndReturnInlinerTest.java @@ -66,7 +66,7 @@ public void testModification() { bodyBuilder.setMethodSignature( JavaIdentifierFactory.getInstance() - .getMethodSignature("test", "ab.c", "void", Collections.emptyList())); + .getMethodSignature("ab.c", "test", "void", Collections.emptyList())); Body testBody = bodyBuilder.build(); new CastAndReturnInliner().interceptBody(bodyBuilder, null); @@ -119,7 +119,7 @@ public void testNoModification() { bodyBuilder.addFlow(bToA, ret); bodyBuilder.setMethodSignature( JavaIdentifierFactory.getInstance() - .getMethodSignature("test", "ab.c", "void", Collections.emptyList())); + .getMethodSignature("ab.c", "test", "void", Collections.emptyList())); Body testBody = bodyBuilder.build(); new CastAndReturnInliner().interceptBody(bodyBuilder, null); diff --git a/sootup.java.bytecode/src/test/java/sootup/java/bytecode/interceptors/ConditionalBranchFolderTest.java b/sootup.java.bytecode/src/test/java/sootup/java/bytecode/interceptors/ConditionalBranchFolderTest.java index 8666144261e..a512b1d72a7 100644 --- a/sootup.java.bytecode/src/test/java/sootup/java/bytecode/interceptors/ConditionalBranchFolderTest.java +++ b/sootup.java.bytecode/src/test/java/sootup/java/bytecode/interceptors/ConditionalBranchFolderTest.java @@ -111,7 +111,7 @@ private static Body.BodyBuilder createBodyBuilder(int constantCondition) { final MethodSignature methodSignature = JavaIdentifierFactory.getInstance() .getMethodSignature( - "toString", "java.lang.Object", "String", Collections.emptyList()); + "java.lang.Object", "toString", "String", Collections.emptyList()); Local base = new Local( "someObjectThatHasSomethingToString", @@ -140,7 +140,7 @@ private static Body.BodyBuilder createBodyBuilder(int constantCondition) { bodyBuilder.addFlow(ifStmt, retb); bodyBuilder.setMethodSignature( JavaIdentifierFactory.getInstance() - .getMethodSignature("test", "ab.c", "void", Collections.emptyList())); + .getMethodSignature("ab.c", "test", "void", Collections.emptyList())); return bodyBuilder; } } diff --git a/sootup.java.bytecode/src/test/java/sootup/java/bytecode/interceptors/ConstantPropagatorAndFolderTest.java b/sootup.java.bytecode/src/test/java/sootup/java/bytecode/interceptors/ConstantPropagatorAndFolderTest.java index e6e4ad668af..ddc7872b716 100644 --- a/sootup.java.bytecode/src/test/java/sootup/java/bytecode/interceptors/ConstantPropagatorAndFolderTest.java +++ b/sootup.java.bytecode/src/test/java/sootup/java/bytecode/interceptors/ConstantPropagatorAndFolderTest.java @@ -99,7 +99,7 @@ private static Body.BodyBuilder createBody(boolean constantFolding) { builder.setStartingStmt(assignA); builder.setMethodSignature( JavaIdentifierFactory.getInstance() - .getMethodSignature("test", "ab.c", "void", Collections.emptyList())); + .getMethodSignature("ab.c", "test", "void", Collections.emptyList())); builder.addFlow(assignA, assignB); builder.addFlow(assignB, assignC); diff --git a/sootup.java.bytecode/src/test/java/sootup/java/bytecode/interceptors/DeadAssignmentEliminatorTest.java b/sootup.java.bytecode/src/test/java/sootup/java/bytecode/interceptors/DeadAssignmentEliminatorTest.java index 51125d4d4de..dc1772c3a57 100644 --- a/sootup.java.bytecode/src/test/java/sootup/java/bytecode/interceptors/DeadAssignmentEliminatorTest.java +++ b/sootup.java.bytecode/src/test/java/sootup/java/bytecode/interceptors/DeadAssignmentEliminatorTest.java @@ -63,7 +63,7 @@ private static Body.BodyBuilder createBody(boolean essentialOption) { builder.setStartingStmt(strToA); builder.setMethodSignature( JavaIdentifierFactory.getInstance() - .getMethodSignature("test", "ab.c", "void", Collections.emptyList())); + .getMethodSignature("ab.c", "test", "void", Collections.emptyList())); if (essentialOption) { Stmt newToB = JavaJimple.newAssignStmt(b, JavaJimple.newNewExpr(objectType), noPositionInfo); diff --git a/sootup.java.bytecode/src/test/java/sootup/java/bytecode/interceptors/NopEliminatorTest.java b/sootup.java.bytecode/src/test/java/sootup/java/bytecode/interceptors/NopEliminatorTest.java index 06ba6e2aa86..71b633cc385 100644 --- a/sootup.java.bytecode/src/test/java/sootup/java/bytecode/interceptors/NopEliminatorTest.java +++ b/sootup.java.bytecode/src/test/java/sootup/java/bytecode/interceptors/NopEliminatorTest.java @@ -91,7 +91,7 @@ private static Body.BodyBuilder createBody(boolean withNop) { builder.setStartingStmt(strToA); builder.setMethodSignature( JavaIdentifierFactory.getInstance() - .getMethodSignature("test", "ab.c", "void", Collections.emptyList())); + .getMethodSignature("ab.c", "test", "void", Collections.emptyList())); builder.addFlow(strToA, jump); builder.addFlow(jump, bToA); diff --git a/sootup.java.bytecode/src/test/java/sootup/java/bytecode/interceptors/UnusedLocalEliminatorTest.java b/sootup.java.bytecode/src/test/java/sootup/java/bytecode/interceptors/UnusedLocalEliminatorTest.java index 50d82a9c1d9..a058cd0c069 100644 --- a/sootup.java.bytecode/src/test/java/sootup/java/bytecode/interceptors/UnusedLocalEliminatorTest.java +++ b/sootup.java.bytecode/src/test/java/sootup/java/bytecode/interceptors/UnusedLocalEliminatorTest.java @@ -83,7 +83,7 @@ private static Body.BodyBuilder createBody(boolean unusedLocals) { builder.setMethodSignature( JavaIdentifierFactory.getInstance() - .getMethodSignature("test", "a.b.c", "void", Collections.emptyList())); + .getMethodSignature("a.b.c", "test", "void", Collections.emptyList())); return builder; } } diff --git a/sootup.java.core/src/main/java/sootup/java/core/JavaIdentifierFactory.java b/sootup.java.core/src/main/java/sootup/java/core/JavaIdentifierFactory.java index 963179dfd0d..6384ef1ff8b 100644 --- a/sootup.java.core/src/main/java/sootup/java/core/JavaIdentifierFactory.java +++ b/sootup.java.core/src/main/java/sootup/java/core/JavaIdentifierFactory.java @@ -34,7 +34,6 @@ import org.apache.commons.io.FilenameUtils; import org.apache.commons.lang3.ClassUtils; import sootup.core.IdentifierFactory; -import sootup.core.model.SootClass; import sootup.core.signatures.FieldSignature; import sootup.core.signatures.FieldSubSignature; import sootup.core.signatures.MethodSignature; @@ -264,16 +263,16 @@ public PackageName getPackageName(@Nonnull final String packageName) { /** * Always creates a new MethodSignature AND a new ClassSignature. * - * @param methodName the method's name * @param fullyQualifiedNameDeclClass the fully-qualified name of the declaring class - * @param parameters the methods parameters fully-qualified name or a primitive's name + * @param methodName the method's name * @param fqReturnType the fully-qualified name of the return type or a primitive's name + * @param parameters the methods parameters fully-qualified name or a primitive's name * @return a MethodSignature */ @Override public MethodSignature getMethodSignature( - final String methodName, final String fullyQualifiedNameDeclClass, + final String methodName, final String fqReturnType, final List parameters) { JavaClassType declaringClass = getClassType(fullyQualifiedNameDeclClass); @@ -321,13 +320,6 @@ public MethodSignature getMethodSignature( return new MethodSignature(declaringClassSignature, methodName, parameters, fqReturnType); } - @Override - @Nonnull - public MethodSignature getMethodSignature( - @Nonnull SootClass declaringClass, @Nonnull MethodSubSignature subSignature) { - return getMethodSignature(declaringClass.getType(), subSignature); - } - @Override @Nonnull public MethodSignature getMethodSignature( @@ -425,7 +417,7 @@ public MethodSignature parseMethodSignature(@Nonnull String methodSignature) { }) .collect(Collectors.toList()); - return getMethodSignature(methodName, className, returnName, argsList); + return getMethodSignature(className, methodName, returnName, argsList); } @Nonnull diff --git a/sootup.java.core/src/main/java/sootup/java/core/JavaModuleIdentifierFactory.java b/sootup.java.core/src/main/java/sootup/java/core/JavaModuleIdentifierFactory.java index 2f504ac914f..0a24d88ac3f 100644 --- a/sootup.java.core/src/main/java/sootup/java/core/JavaModuleIdentifierFactory.java +++ b/sootup.java.core/src/main/java/sootup/java/core/JavaModuleIdentifierFactory.java @@ -206,12 +206,12 @@ public ModuleJavaClassType getClassType(String fullyQualifiedClassName) { @Override public MethodSignature getMethodSignature( - String methodName, String fullyQualifiedNameDeclClass, + String methodName, String fqReturnType, List parameters) { return super.getMethodSignature( - methodName, fullyQualifiedNameDeclClass, fqReturnType, parameters); + fullyQualifiedNameDeclClass, methodName, fqReturnType, parameters); } } } diff --git a/sootup.java.core/src/test/java/sootup/java/core/jimple/common/stmt/JInvokeStmtTest.java b/sootup.java.core/src/test/java/sootup/java/core/jimple/common/stmt/JInvokeStmtTest.java index dba62305329..6bb00884cfb 100644 --- a/sootup.java.core/src/test/java/sootup/java/core/jimple/common/stmt/JInvokeStmtTest.java +++ b/sootup.java.core/src/test/java/sootup/java/core/jimple/common/stmt/JInvokeStmtTest.java @@ -93,7 +93,7 @@ public void test() { // JStaticInvokeExpr MethodSignature statMethodSig = dif.getMethodSignature( - "print", "java.system.Out", "void", Collections.singletonList("String")); + "java.system.Out", "print", "void", Collections.singletonList("String")); Stmt staticInvokeStmt = new JInvokeStmt( new JStaticInvokeExpr( @@ -112,7 +112,7 @@ public void test() { // JSpecialInvoke MethodSignature smethodSig = - dif.getMethodSignature("", "java.lang.Object", "void", Collections.emptyList()); + dif.getMethodSignature("java.lang.Object", "", "void", Collections.emptyList()); Stmt specialInvokeStmt = new JInvokeStmt( new JSpecialInvokeExpr( @@ -129,7 +129,7 @@ public void test() { // JInterfaceInvoke MethodSignature imethodSig = - dif.getMethodSignature("remove", "java.util.Iterator", "void", Collections.emptyList()); + dif.getMethodSignature("java.util.Iterator", "remove", "void", Collections.emptyList()); Stmt interfaceInvokeStmt = new JInvokeStmt( new JInterfaceInvokeExpr( @@ -147,12 +147,12 @@ public void test() { // JDynamicInvoke MethodSignature dmethodSig = dif.getMethodSignature( - "mylambda", JDynamicInvokeExpr.INVOKEDYNAMIC_DUMMY_CLASS_NAME, + "mylambda", "void", Collections.emptyList()); MethodSignature bootstrapMethodSig = - dif.getMethodSignature("run", "Runnable", "void", Collections.emptyList()); + dif.getMethodSignature("Runnable", "run", "void", Collections.emptyList()); List bootstrapArgs = Collections.emptyList(); List methodArgs = Collections.emptyList(); diff --git a/sootup.java.core/src/test/java/sootup/java/core/model/SootMethodTest.java b/sootup.java.core/src/test/java/sootup/java/core/model/SootMethodTest.java index 3d031009c1b..6efbcc3d058 100644 --- a/sootup.java.core/src/test/java/sootup/java/core/model/SootMethodTest.java +++ b/sootup.java.core/src/test/java/sootup/java/core/model/SootMethodTest.java @@ -50,7 +50,7 @@ public void testCreateMethod() { LocalGenerator generator = new LocalGenerator(new HashSet<>()); MethodSignature methodSignature = view.getIdentifierFactory() - .getMethodSignature("main", "dummyMain", "void", Collections.emptyList()); + .getMethodSignature("dummyMain", "main", "void", Collections.emptyList()); Body.BodyBuilder bodyBuilder = Body.builder(); final JIdentityStmt firstStmt = diff --git a/sootup.java.core/src/test/java/sootup/java/core/printer/JimplePrinterTest.java b/sootup.java.core/src/test/java/sootup/java/core/printer/JimplePrinterTest.java index 6938330d8eb..b2be615cb61 100644 --- a/sootup.java.core/src/test/java/sootup/java/core/printer/JimplePrinterTest.java +++ b/sootup.java.core/src/test/java/sootup/java/core/printer/JimplePrinterTest.java @@ -63,7 +63,7 @@ private SootClass buildClass() { String className = "some.package.SomeClass"; MethodSignature methodSignatureOne = view.getIdentifierFactory() - .getMethodSignature("main", className, "void", Collections.emptyList()); + .getMethodSignature(className, "main", "void", Collections.emptyList()); StmtPositionInfo noPosInfo = StmtPositionInfo.createNoStmtPositionInfo(); final JReturnVoidStmt returnVoidStmt = new JReturnVoidStmt(noPosInfo); @@ -87,7 +87,7 @@ private SootClass buildClass() { MethodSignature methodSignatureTwo = view.getIdentifierFactory() - .getMethodSignature("otherMethod", className, "int", Collections.emptyList()); + .getMethodSignature(className, "otherMethod", "int", Collections.emptyList()); bodyBuilder .setMethodSignature(methodSignatureTwo) .setPosition(NoPositionInformation.getInstance()); diff --git a/sootup.java.core/src/test/java/sootup/java/core/printer/LegacyJimplePrinterTest.java b/sootup.java.core/src/test/java/sootup/java/core/printer/LegacyJimplePrinterTest.java index d3c8c45bc76..d53c06192af 100644 --- a/sootup.java.core/src/test/java/sootup/java/core/printer/LegacyJimplePrinterTest.java +++ b/sootup.java.core/src/test/java/sootup/java/core/printer/LegacyJimplePrinterTest.java @@ -36,7 +36,7 @@ SootClass buildClass(Body.BodyBuilder builder) { MethodSignature methodSignature = view.getIdentifierFactory() - .getMethodSignature("main", "dummyMain", "void", Collections.emptyList()); + .getMethodSignature("dummyMain", "main", "void", Collections.emptyList()); Body body = builder .setMethodSignature(methodSignature) diff --git a/sootup.java.core/src/test/java/sootup/java/core/signatures/JavaIdentifierFactoryTest.java b/sootup.java.core/src/test/java/sootup/java/core/signatures/JavaIdentifierFactoryTest.java index a5fcf27b61d..c3cc1cf74d4 100644 --- a/sootup.java.core/src/test/java/sootup/java/core/signatures/JavaIdentifierFactoryTest.java +++ b/sootup.java.core/src/test/java/sootup/java/core/signatures/JavaIdentifierFactoryTest.java @@ -189,7 +189,7 @@ public void getMethodSignature() { List parameters = Collections.singletonList("java.lang.Class"); MethodSignature methodSignature = - identifierFactory.getMethodSignature("foo", "java.lang.System", "java.lang.A", parameters); + identifierFactory.getMethodSignature("java.lang.System", "foo", "java.lang.A", parameters); assertEquals(declClass, methodSignature.getDeclClassType()); assertEquals(returnType, methodSignature.getType()); assertEquals(parameter, methodSignature.getParameterTypes().get(0)); @@ -203,7 +203,7 @@ public void getMethodSignatureString() { List parameters = Collections.singletonList("java.lang.Class"); MethodSignature methodSignature = - identifierFactory.getMethodSignature("foo", "java.lang.System", "java.lang.A", parameters); + identifierFactory.getMethodSignature("java.lang.System", "foo", "java.lang.A", parameters); assertEquals( "", methodSignature.toString()); } @@ -215,7 +215,7 @@ public void getMethodSignatureString2() { List parameters = Collections.singletonList("java.lang.Class"); MethodSignature methodSignature = - identifierFactory.getMethodSignature("foo", "java.lang.System", "void", parameters); + identifierFactory.getMethodSignature("java.lang.System", "foo", "void", parameters); assertEquals("", methodSignature.toString()); } @@ -226,7 +226,7 @@ public void getMethodSignatureString3() { List parameters = Collections.emptyList(); MethodSignature methodSignature = - identifierFactory.getMethodSignature("foo", "java.lang.System", "void", parameters); + identifierFactory.getMethodSignature("java.lang.System", "foo", "void", parameters); assertEquals("", methodSignature.toString()); } @@ -258,10 +258,10 @@ public void compMethodSignature2() { List parameters = new ArrayList<>(); MethodSignature methodSignature = - identifierFactory.getMethodSignature("foo", "java.lang.System", "void", parameters); + identifierFactory.getMethodSignature("java.lang.System", "foo", "void", parameters); parameters.add("boolean"); MethodSignature methodSignature2 = - identifierFactory.getMethodSignature("foo", "java.lang.System", "void", parameters); + identifierFactory.getMethodSignature("java.lang.System", "foo", "void", parameters); assertNotEquals(methodSignature, methodSignature2); assertNotEquals(methodSignature.hashCode(), methodSignature2.hashCode()); @@ -274,9 +274,9 @@ public void compMethodSignature1() { List parameters = Collections.emptyList(); MethodSignature methodSignature = - identifierFactory.getMethodSignature("foo", "java.lang.System", "void", parameters); + identifierFactory.getMethodSignature("java.lang.System", "foo", "void", parameters); MethodSignature methodSignature2 = - identifierFactory.getMethodSignature("foo", "java.lang.System", "void", parameters); + identifierFactory.getMethodSignature("java.lang.System", "foo", "void", parameters); assertEquals(methodSignature, methodSignature2); assertEquals(methodSignature.hashCode(), methodSignature2.hashCode()); diff --git a/sootup.java.sourcecode/src/main/java/sootup/java/sourcecode/frontend/InstructionConverter.java b/sootup.java.sourcecode/src/main/java/sootup/java/sourcecode/frontend/InstructionConverter.java index 37606aac35d..737a7c92145 100644 --- a/sootup.java.sourcecode/src/main/java/sootup/java/sourcecode/frontend/InstructionConverter.java +++ b/sootup.java.sourcecode/src/main/java/sootup/java/sourcecode/frontend/InstructionConverter.java @@ -379,7 +379,7 @@ private List convertAssertInstruction( stmts.add(newAssignStmt); MethodSignature methodSig = identifierFactory.getMethodSignature( - "", "java.lang.AssertionError", "void", Collections.emptyList()); + "java.lang.AssertionError", "", "void", Collections.emptyList()); JSpecialInvokeExpr invoke = Jimple.newSpecialInvokeExpr(failureLocal, methodSig); JInvokeStmt invokeStmt = Jimple.newInvokeStmt( @@ -795,7 +795,7 @@ private Stmt convertInvokeInstruction(AstJavaInvokeInstruction invokeInst) { MethodSignature methodSig = identifierFactory.getMethodSignature( - target.getName().toString(), declaringClassSignature, returnType, parameters); + declaringClassSignature, target.getName().toString(), returnType, parameters); if (!callee.isStatic()) { int receiver = invokeInst.getReceiver(); @@ -940,8 +940,8 @@ private List convertStringAddition( MethodSignature initMethod = identifierFactory.getMethodSignature( - "", sbType.getFullyQualifiedName(), + "", VoidType.getInstance().toString(), Collections.singletonList(type.toString())); CAstSourcePositionMap.Position[] pos1 = new CAstSourcePositionMap.Position[2]; @@ -957,8 +957,8 @@ private List convertStringAddition( MethodSignature appendMethod = identifierFactory.getMethodSignature( - "append", sbType.getFullyQualifiedName(), + "append", sbType.toString(), Collections.singletonList(type.toString())); Local strBuilderLocal2 = localGenerator.generateLocal(sbType); @@ -976,7 +976,7 @@ private List convertStringAddition( MethodSignature toStringMethod = identifierFactory.getMethodSignature( - "toString", sbType.getFullyQualifiedName(), sbType.toString(), Collections.emptyList()); + sbType.getFullyQualifiedName(), "toString", sbType.toString(), Collections.emptyList()); Stmt toStringStmt = Jimple.newAssignStmt( diff --git a/sootup.tests/src/test/java/sootup/tests/MutableSootClientTest.java b/sootup.tests/src/test/java/sootup/tests/MutableSootClientTest.java index cccf19b9a7d..68198d20df5 100644 --- a/sootup.tests/src/test/java/sootup/tests/MutableSootClientTest.java +++ b/sootup.tests/src/test/java/sootup/tests/MutableSootClientTest.java @@ -129,7 +129,7 @@ public void methodRemovalTest() { public void methodAdditionTest() { MethodSignature methodSignature = p.getIdentifierFactory() - .getMethodSignature("addedMethod", "utils.Operations", "void", Collections.emptyList()); + .getMethodSignature("utils.Operations", "addedMethod", "void", Collections.emptyList()); Body.BodyBuilder bodyBuilder = Body.builder(); Body body = bodyBuilder.setMethodSignature(methodSignature).build(); JavaSootMethod newMethod =