{"record":{"id":"79a5443a7eac1895","repo":"pinpoint-apm/pinpoint","slug":"annotationkey-name-must-not-be-empty","errorCode":null,"errorMessage":"annotationKey name must not be empty","messagePattern":"annotationKey name must not be empty","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"agent-module/plugins-loader/src/main/java/com/navercorp/pinpoint/loader/plugins/trace/yaml/ParsedAnnotationKey.java","lineNumber":62,"sourceCode":"    }\n\n    public void setName(String name) {\n        this.name = name;\n    }\n\n    public ParsedAnnotationKeyProperty getProperty() {\n        return property;\n    }\n\n    public void setProperty(ParsedAnnotationKeyProperty property) {\n        this.property = property;\n    }\n\n    AnnotationKey toAnnotationKey() {\n        Objects.requireNonNull(code, \"code\");\n\n        if (StringUtils.isEmpty(name)) {\n            throw new IllegalArgumentException(\"annotationKey name must not be empty\");\n        }\n        AnnotationKeyBuilder builder = new AnnotationKeyBuilder(code, name);\n        if (property != null) {\n            builder.viewInRecordSet(property.isViewInRecordSet());\n        }\n        return builder.build();\n    }\n}\n","sourceCodeStart":44,"sourceCodeEnd":71,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/agent-module/plugins-loader/src/main/java/com/navercorp/pinpoint/loader/plugins/trace/yaml/ParsedAnnotationKey.java#L44-L71","documentation":"Thrown by ParsedAnnotationKey.toAnnotationKey when the YAML type-provider definition has an annotationKey entry whose 'name' field is empty or missing (the 'code' being already null-checked). A valid AnnotationKey requires both a numeric code and a non-empty name.","triggerScenarios":"Loading a plugin's yaml type provider where an annotationKey declares a code but no name, or name: '' (empty string).","commonSituations":"Hand-edited plugin annotationKey yaml with a forgotten name field; copy-pasted entry with only code; template yaml left partially filled in.","solutions":["Add a non-empty name to the annotationKey entry in the plugin's yaml file","Remove the incomplete annotationKey entry if it is not needed","Validate the yaml against existing working plugin definitions as a reference","Check the exception's originating yaml file in the plugin jar that failed to load"],"exampleFix":"// before (plugin yaml)\nannotationKey:\n  - code: 900\n    # name missing\n// after\nannotationKey:\n  - code: 900\n    name: my.plugin.key","handlingStrategy":"validation","validationCode":"// pre-validate plugin yaml before packaging\nannotationKeys.forEach(k -> {\n  if (k.getCode() == null) throw new IllegalStateException(\"annotationKey missing code\");\n  if (k.getName() == null || k.getName().isEmpty()) throw new IllegalStateException(\"annotationKey missing name\");\n});","typeGuard":null,"tryCatchPattern":"try { AnnotationKey key = parsed.toAnnotationKey(); } catch (IllegalArgumentException e) { log.error(\"bad annotationKey in plugin yaml: {}\", e.getMessage()); throw e; }","preventionTips":["Keep name and code together when copying yaml entries","Lint plugin yamls in CI before packaging the plugin jar","Compare entries against existing working plugin definitions"],"tags":["java","yaml","plugin","validation"],"backgroundTag":"empty-required-field","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"}