{"record":{"id":"d9ae69803261479a","repo":"apache/pulsar","slug":"invalid-null-resource-group-name-resourcegroupn","errorCode":null,"errorMessage":"Invalid null resource group name: ${resourceGroupName}","messagePattern":"Invalid null resource group name: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"pulsar-broker/src/main/java/org/apache/pulsar/broker/resourcegroup/ResourceGroupService.java","lineNumber":425,"sourceCode":"                case LocalSinceLastReported:\n                    return rg.getLocalUsageStats(monClass);\n                case ReportFromTransportMgr:\n                    return rg.getLocalUsageStatsFromBrokerReports(monClass);\n            }\n        }\n\n        BytesAndMessagesCount retCount = new BytesAndMessagesCount();\n        retCount.bytes = -1;\n        retCount.messages = -1;\n        return retCount;\n    }\n\n    /**\n     * Get the RG with the given name. For internal operations only.\n     */\n    private ResourceGroup getResourceGroupInternal(String resourceGroupName) {\n        if (resourceGroupName == null) {\n            throw new IllegalArgumentException(\"Invalid null resource group name: \" + resourceGroupName);\n        }\n\n        return resourceGroupsMap.get(resourceGroupName);\n    }\n\n    private ResourceGroup checkResourceGroupExists(String rgName) throws PulsarAdminException {\n        ResourceGroup rg = this.getResourceGroupInternal(rgName);\n        if (rg == null) {\n            throw new PulsarAdminException(\"Resource group does not exist: \" + rgName);\n        }\n        return rg;\n    }\n\n    // Find the difference between the last time stats were updated for this topic, and the current\n    // time. If the difference is positive, update the stats.\n    private void updateStatsWithDiff(String topicName, String tenantString, String nsString,\n                                     long accByteCount, long accMesgCount, ResourceGroupMonitoringClass monClass) {\n        ConcurrentHashMap<String, BytesAndMessagesCount> hm;","sourceCodeStart":407,"sourceCodeEnd":443,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-broker/src/main/java/org/apache/pulsar/broker/resourcegroup/ResourceGroupService.java#L407-L443","documentation":"Defensive null-argument guard in the private getResourceGroupInternal lookup: the caller passed a null/empty resource-group name, so no map lookup is attempted. In practice reached from usage-statistics paths when a registered RG entry carries a missing name.","triggerScenarios":"Thrown at pulsar-broker/src/main/java/org/apache/pulsar/broker/resourcegroup/ResourceGroupService.java:425 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a non-empty resource group name"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"820761864ed8e2a7d2e52dd9763ad2ae117c1395","analyzedAt":"2026-09-06T00:14:20.138Z","contentChangedAt":"2026-09-06T00:14:20.138Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}