{"record":{"id":"b28c4c15afcab17a","repo":"openzipkin/zipkin","slug":"keys-null-b28c4c","errorCode":null,"errorMessage":"keys == null","messagePattern":"keys == null","errorType":"validation","errorClass":"NullPointerException","httpStatus":null,"severity":"error","filePath":"zipkin-storage/mysql-v1/src/main/java/zipkin2/storage/mysql/v1/MySQLStorage.java","lineNumber":53,"sourceCode":"    boolean strictTraceId = true, searchEnabled = true;\n    private DataSource datasource;\n    private Settings settings = new Settings().withRenderSchema(false);\n    private ExecuteListenerProvider listenerProvider;\n    private Executor executor;\n    List<String> autocompleteKeys = new ArrayList<>();\n\n    @Override public Builder strictTraceId(boolean strictTraceId) {\n      this.strictTraceId = strictTraceId;\n      return this;\n    }\n\n    @Override public Builder searchEnabled(boolean searchEnabled) {\n      this.searchEnabled = searchEnabled;\n      return this;\n    }\n\n    @Override public Builder autocompleteKeys(List<String> keys) {\n      if (keys == null) throw new NullPointerException(\"keys == null\");\n      this.autocompleteKeys = keys;\n      return this;\n    }\n\n    public Builder datasource(DataSource datasource) {\n      if (datasource == null) throw new NullPointerException(\"datasource == null\");\n      this.datasource = datasource;\n      return this;\n    }\n\n    public Builder settings(Settings settings) {\n      if (settings == null) throw new NullPointerException(\"settings == null\");\n      this.settings = settings;\n      return this;\n    }\n\n    public Builder listenerProvider(@Nullable ExecuteListenerProvider listenerProvider) {\n      this.listenerProvider = listenerProvider;","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/openzipkin/zipkin/blob/878ce2a1fad54ca941d17fdcf2e1d924b148eb1f/zipkin-storage/mysql-v1/src/main/java/zipkin2/storage/mysql/v1/MySQLStorage.java#L35-L71","documentation":"MySQLStorage.Builder.autocompleteKeys throws NullPointerException when passed a null list. The builder deliberately fails fast on null instead of storing it, because autocompleteKey tagging is optional but must be a well-formed list. Passing null is treated as a programming error, not an empty configuration.","triggerScenarios":"Calling builder.autocompleteKeys(null), or wiring the value from config/environment that resolves to null (e.g. a missing property mapped with @Value or a Map.get that returned null).","commonSituations":"Property-driven configuration where zipkin.storage.mysql.autocomplete-keys is absent, so the binding produces null; refactoring that removes the list initialization; copying from another storage module whose builder tolerated null.","solutions":["Pass an empty list (List.of()) when no autocomplete keys are needed.","Default the config value before it reaches the builder, e.g. keys != null ? keys : List.of().","Fix the property source so the mapped value is never null (provide a default in application.yaml or the environment)."],"exampleFix":"// before\nbuilder.autocompleteKeys(null);\n\n// after\nbuilder.autocompleteKeys(keys == null ? List.of() : keys);","handlingStrategy":"validation","validationCode":"builder.autocompleteKeys(keys == null ? List.of() : keys);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Normalize null lists to empty lists at the config-binding layer","Treat builder NPEs in zipkin as configuration bugs: fail loudly in one bootstrap method"],"tags":["mysql","storage","builder","null-pointer","configuration"],"backgroundTag":null,"analyzedSha":"878ce2a1fad54ca941d17fdcf2e1d924b148eb1f","analyzedAt":"2026-08-14T15:17:09.895Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}