{"record":{"id":"10b9332bc4b99aee","repo":"pinpoint-apm/pinpoint","slug":"different-return-type-return-fieldtype-field","errorCode":null,"errorMessage":"different return type. return=${fieldType}, field=${fieldJavaType}","messagePattern":"different return type\\. return=(.+?), field=(.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/instrument/ASMClass.java","lineNumber":306,"sourceCode":"        } catch (Exception e) {\n            throw new InstrumentException(\"Failed to add field with accessor [\" + accessorClass.getName() + \"]. Cause:\" + e.getMessage(), e);\n        }\n    }\n\n    @Override\n    public void addGetter(Class<?> getterClass, String fieldName) throws InstrumentException {\n        Objects.requireNonNull(getterClass, \"getterClass\");\n        Objects.requireNonNull(fieldName, \"fieldName\");\n\n        try {\n            final GetterAnalyzer.GetterDetails getterDetails = GetterAnalyzer.instance().analyze(getterClass);\n            final ASMFieldNodeAdapter fieldNode = this.classNode.getField(fieldName, null);\n            if (fieldNode == null) {\n                throw new IllegalArgumentException(\"Not found field. name=\" + fieldName);\n            }\n            Type fieldType = getterDetails.getFieldType();\n            if (!fieldNode.getJavaType().equals(fieldType)) {\n                throw new IllegalArgumentException(\"different return type. return=\" + fieldType + \", field=\" + fieldNode.getJavaType());\n            }\n\n            boolean modified = this.classNode.addGetterMethod(getterDetails.getGetter().getName(), fieldNode);\n            modified |= this.classNode.addInterface(getterClass.getName());\n            if (modified) {\n                setModified(true);\n            } else if (logger.isDebugEnabled()) {\n                logger.debug(\"Skip addGetter, getter already declared. class={}, getter={}\", getName(), getterClass.getName());\n            }\n        } catch (Exception e) {\n            throw new InstrumentException(\"Failed to add getter: \" + getterClass.getName(), e);\n        }\n    }\n\n    @Override\n    public void addSetter(Class<?> setterClass, String fieldName) throws InstrumentException {\n        this.addSetter(setterClass, fieldName, false);\n    }","sourceCodeStart":288,"sourceCodeEnd":324,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/instrument/ASMClass.java#L288-L324","documentation":"Thrown inside ASMClass.addGetter: the field exists but its type differs from the getter method's analyzed return type (GetterAnalyzer), so generating the getter would produce a type-inconsistent accessor.","triggerScenarios":"Thrown at agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/instrument/ASMClass.java:306 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Make the getter interface's return type exactly match the target field's type","Check for autoboxing/primitive mismatches between getter and field","Correct the getter class used in the plugin configuration"],"exampleFix":null,"handlingStrategy":"type-guard","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"}