{"record":{"id":"147859075c3e7bca","repo":"pinpoint-apm/pinpoint","slug":"invalid-null-pair-parametertype","errorCode":null,"errorMessage":"invalid null pair parameterType:","messagePattern":"invalid null pair parameterType:","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"warning","filePath":"agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/util/ApiUtils.java","lineNumber":57,"sourceCode":"            }\n            if (parameterType.length == 0) {\n                return EMPTY_ARRAY;\n            }\n            StringBuilder sb = new StringBuilder(64);\n            sb.append('(');\n            int end = parameterType.length - 1;\n            for (int i = 0; i < parameterType.length; i++) {\n                sb.append(parameterType[i]);\n                sb.append(' ');\n                sb.append(variableName[i]);\n                if (i < end) {\n                    sb.append(\", \");\n                }\n            }\n            sb.append(')');\n            return sb.toString();\n        }\n        throw new IllegalArgumentException(\"invalid null pair parameterType:\" + Arrays.toString(parameterType) + \", variableName:\" + Arrays.toString(variableName));\n    }\n\n    public static String mergeApiDescriptor(String className, String methodName, String parameterDescriptor) {\n        StringBuilder buffer = new StringBuilder(256);\n        buffer.append(className);\n        buffer.append('.');\n        buffer.append(methodName);\n        buffer.append(parameterDescriptor);\n        return buffer.toString();\n    }\n}\n","sourceCodeStart":39,"sourceCodeEnd":69,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/util/ApiUtils.java#L39-L69","documentation":"mergeParameterVariableNameDescription requires BOTH arrays to be non-null (a valid pair) or BOTH null. If exactly one is null (or one is null while the other is not), the method cannot merge them and throws IllegalArgumentException listing both arrays.","triggerScenarios":"Calling mergeParameterVariableNameDescription with one array null and the other non-null, e.g. types parsed from a descriptor but variable names unavailable (or vice versa) passed as null instead of an empty array with matching semantics.","commonSituations":"Plugins that pass null variableName when debug info is absent while still supplying parameterType; inconsistent metadata providers returning null instead of empty arrays.","solutions":["Pass both arrays non-null with equal lengths, or both null","When variable names are unavailable, pass null for BOTH arguments or build a types-only descriptor via another API","Normalize metadata providers to return empty arrays instead of null"],"exampleFix":"// before\nApiUtils.mergeParameterVariableNameDescription(parameterTypes, null); // throws when parameterTypes != null\n// after\nString[] variableNames = (parameterTypes == null) ? null : new String[parameterTypes.length];\nApiUtils.mergeParameterVariableNameDescription(parameterTypes, variableNames);","handlingStrategy":"validation","validationCode":"if ((parameterType == null) != (variableName == null)) { throw new IllegalStateException(\"both or neither must be null\"); }","typeGuard":null,"tryCatchPattern":"try { desc = ApiUtils.mergeParameterVariableNameDescription(types, names); } catch (IllegalArgumentException e) { desc = buildTypesOnlyDescriptor(types); }","preventionTips":["Normalize metadata providers to return empty arrays, not null","Pass null for both arguments when no variable names are available","Add a pair-nullness check in the calling code"],"tags":["java","null-check","api-metadata"],"backgroundTag":"null-argument","analyzedSha":"744c3d3075e595656abb1ae331ad2c0e4c9eb996","analyzedAt":"2026-09-07T18:48:45.289Z","contentChangedAt":"2026-09-07T18:48:45.289Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}