{"record":{"id":"edd917e300cc51a4","repo":"pinpoint-apm/pinpoint","slug":"toapplicationnames-and-toservicetypecodes-must-hav","errorCode":null,"errorMessage":"toApplicationNames and toServiceTypeCodes must have the same number of elements","messagePattern":"toApplicationNames and toServiceTypeCodes must have the same number of elements","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"web/src/main/java/com/navercorp/pinpoint/web/applicationmap/controller/MapHistogramController.java","lineNumber":179,"sourceCode":"            List<String> fromApplicationNames,\n            @RequestParam(value = \"fromServiceTypeCodes\", defaultValue = \"\", required = false)\n            List<Short> fromServiceTypeCodes,\n            @RequestParam(value = \"toApplicationNames\", defaultValue = \"\", required = false)\n            List<String> toApplicationNames,\n            @RequestParam(value = \"toServiceTypeCodes\", defaultValue = \"\", required = false)\n            List<Short> toServiceTypeCodes,\n            @RequestParam(value = \"useStatisticsAgentState\", defaultValue = \"true\", required = false)\n            boolean useStatisticsAgentState\n    ) {\n        final Range range = toRange(rangeForm);\n        TimeWindow timeWindow = new TimeWindow(range);\n\n        if (fromApplicationNames.size() != fromServiceTypeCodes.size()) {\n            throw new IllegalArgumentException(\n                    \"fromApplicationNames and fromServiceTypeCodes must have the same number of elements\");\n        }\n        if (toApplicationNames.size() != toServiceTypeCodes.size()) {\n            throw new IllegalArgumentException(\n                    \"toApplicationNames and toServiceTypeCodes must have the same number of elements\");\n        }\n\n        final Application application = getApplication(appForm);\n\n        final List<Application> fromApplications = toApplications(fromApplicationNames, fromServiceTypeCodes);\n        final List<Application> toApplications = toApplications(toApplicationNames, toServiceTypeCodes);\n        final ResponseTimeHistogramServiceOption option = new ResponseTimeHistogramServiceOption\n                .Builder(application, timeWindow, fromApplications, toApplications)\n                .setUseStatisticsAgentState(useStatisticsAgentState)\n                .build();\n\n        final NodeHistogramSummary nodeHistogramSummary = responseTimeHistogramService.selectNodeHistogramData(option);\n\n        ServerGroupList serverGroupList = nodeHistogramSummary.getServerGroupList();\n        ServerGroupListView serverGroupListView = new ServerGroupListView(serverGroupList, hyperLinkFactory);\n        return new NodeHistogramSummaryView(nodeHistogramSummary, timeWindow, serverGroupListView, TimeHistogramView.ResponseTime);\n    }","sourceCodeStart":161,"sourceCodeEnd":197,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/web/src/main/java/com/navercorp/pinpoint/web/applicationmap/controller/MapHistogramController.java#L161-L197","documentation":"MapHistogramController.getResponseTimeHistogramDataV2 pairs toApplicationNames with toServiceTypeCodes element-by-element. A size mismatch means the controller cannot construct the target Application list, so it throws IllegalArgumentException at line 179.","triggerScenarios":"Calling the V2 response-time histogram endpoint where toApplicationNames and toServiceTypeCodes request parameters contain different numbers of comma-separated values.","commonSituations":"Copy-paste errors in query strings, generated clients that omit the last type code, filters edited by hand adding a target app without its type code.","solutions":["Make toApplicationNames and toServiceTypeCodes the same length, ordered by index","Validate lengths before sending the request","Remove any orphan name without its corresponding type code"],"exampleFix":"// before\n?toApplicationNames=api,db&toServiceTypeCodes=1010\n// after\n?toApplicationNames=api,db&toServiceTypeCodes=1010,2100","handlingStrategy":"validation","validationCode":"if (toApplicationNames.size() != toServiceTypeCodes.size()) {\n    throw new IllegalArgumentException(\"toApplicationNames/toServiceTypeCodes length mismatch\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    return api.getV2ResponseTimeHistogram(names, toNames, toCodes);\n} catch (IllegalArgumentException e) {\n    logger.warn(\"Bad request: {}\", e.getMessage());\n    return Collections.emptyList();\n}","preventionTips":["Pair names and codes together in one data structure before serialization","Validate request params in a client interceptor","Add smoke tests that call the endpoint with the real query builder"],"tags":["validation","illegal-argument","controller"],"backgroundTag":"invalid-argument-value","analyzedSha":"744c3d3075e595656abb1ae331ad2c0e4c9eb996","analyzedAt":"2026-09-07T18:48:45.289Z","contentChangedAt":"2026-09-07T18:48:45.289Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}