{"record":{"id":"7c5fdc84f6d7c4fc","repo":"pinpoint-apm/pinpoint","slug":"classname-already-have-method-methodname","errorCode":null,"errorMessage":"${className} already have method(${methodName}).","messagePattern":"(.+?) already have method\\((.+?)\\)\\.","errorType":"exception","errorClass":"InstrumentException","httpStatus":null,"severity":"error","filePath":"agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/instrument/ASMClass.java","lineNumber":244,"sourceCode":"        final ClassLoader classLoader = classNode.getClassLoader();\n        final ProtectionDomain protectionDomain = classNode.getProtectionDomain();\n        final ASMClassNodeAdapter adviceClassNode = ASMClassNodeAdapter.get(this.pluginContext, classLoader, protectionDomain, classInternalName);\n        if (adviceClassNode == null) {\n            throw new NotFoundInstrumentException(adviceClassName + \" not found.\");\n        }\n\n        final ASMAspectWeaver aspectWeaver = new ASMAspectWeaver();\n        aspectWeaver.weaving(this.classNode, adviceClassNode);\n        setModified(true);\n    }\n\n    @Override\n    public InstrumentMethod addDelegatorMethod(final String methodName, final String... paramTypes) throws InstrumentException {\n        Objects.requireNonNull(methodName, \"methodName\");\n\n        // check duplicated method.\n        if (getDeclaredMethod(methodName, paramTypes) != null) {\n            throw new InstrumentException(getName() + \" already have method(\" + methodName + \").\");\n        }\n\n        final ASMClassNodeAdapter superClassNode = ASMClassNodeAdapter.get(this.pluginContext, classNode.getClassLoader(), classNode.getProtectionDomain(), this.classNode.getSuperClassInternalName());\n        if (superClassNode == null) {\n            throw new NotFoundInstrumentException(getName() + \" not found super class(\" + this.classNode.getSuperClassInternalName() + \")\");\n        }\n\n        final String desc = JavaAssistUtils.javaTypeToJvmSignature(paramTypes);\n        final ASMMethodNodeAdapter superMethodNode = superClassNode.getDeclaredMethod(methodName, desc);\n        if (superMethodNode == null) {\n            throw new NotFoundInstrumentException(methodName + desc + \" is not found in \" + superClassNode.getInternalName());\n        }\n\n        final ASMMethodNodeAdapter methodNode = this.classNode.addDelegatorMethod(superMethodNode);\n        setModified(true);\n        return new ASMMethod(this.engineComponent, this.pluginContext, this, methodNode);\n    }\n","sourceCodeStart":226,"sourceCodeEnd":262,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/instrument/ASMClass.java#L226-L262","documentation":"Thrown by ASMClass.addDelegatorMethod: the target class already declares a method with the same name and parameter types as the delegator method to be added, so adding it would create a duplicate declaration.","triggerScenarios":"Thrown at agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/instrument/ASMClass.java:244 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Choose a different delegator method name or parameters","Skip delegation when getDeclaredMethod already finds the method","Fix the plugin transformer that requests a duplicate delegator on this class"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"744c3d3075e595656abb1ae331ad2c0e4c9eb996","analyzedAt":"2026-09-07T18:48:45.289Z","contentChangedAt":"2026-09-07T18:48:45.289Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}