{"record":{"id":"7e5a12627534e0fb","repo":"openzipkin/zipkin","slug":"child-null","errorCode":null,"errorMessage":"child == null","messagePattern":"child == null","errorType":"exception","errorClass":"NullPointerException","httpStatus":null,"severity":"error","filePath":"zipkin/src/main/java/zipkin2/DependencyLink.java","lineNumber":75,"sourceCode":"    }\n\n    Builder(DependencyLink source) {\n      this.parent = source.parent;\n      this.child = source.child;\n      this.callCount = source.callCount;\n      this.errorCount = source.errorCount;\n    }\n\n    /** @see #parent() */\n    public Builder parent(String parent) {\n      if (parent == null) throw new NullPointerException(\"parent == null\");\n      this.parent = parent.toLowerCase(Locale.ROOT);\n      return this;\n    }\n\n    /** @see #child() */\n    public Builder child(String child) {\n      if (child == null) throw new NullPointerException(\"child == null\");\n      this.child = child.toLowerCase(Locale.ROOT);\n      return this;\n    }\n\n    /** @see #callCount() */\n    public Builder callCount(long callCount) {\n      this.callCount = callCount;\n      return this;\n    }\n\n    /** @see #errorCount() */\n    public Builder errorCount(long errorCount) {\n      this.errorCount = errorCount;\n      return this;\n    }\n\n    public DependencyLink build() {\n      String missing = \"\";","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/openzipkin/zipkin/blob/878ce2a1fad54ca941d17fdcf2e1d924b148eb1f/zipkin/src/main/java/zipkin2/DependencyLink.java#L57-L93","documentation":"DependencyLink.Builder.child throws NullPointerException when the child service name is null. Symmetric with parent(): the child endpoint of the dependency edge is mandatory, and the builder fails fast rather than producing a half-built link that build() would reject anyway with 'Missing : child'.","triggerScenarios":"Calling DependencyLink.newBuilder().child(null), e.g. from Span-based link aggregation where the client span's serviceName is absent.","commonSituations":"Instrumentation that omits localEndpoint on the child side; parsing third-party trace data with missing endpoint names; copy-paste where parent is set twice instead of parent+child.","solutions":["Skip the link when the child name cannot be determined.","Ensure both parent and child names are extracted before building: if (parent != null && child != null) buildLink(...).","Fix span ingestion so localEndpoint.serviceName is populated on spans you aggregate links from."],"exampleFix":"// before\nbuilder.parent(\"frontend\").child(null);\n\n// after\nbuilder.parent(\"frontend\").child(\"backend\");","handlingStrategy":"validation","validationCode":"if (parentName == null || childName == null) return;\nbuilder.parent(parentName).child(childName);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate both sides of the edge at the data source","Skip unresolvable links and log them rather than building partial ones"],"tags":["core","dependency-link","null-pointer","builder","validation"],"backgroundTag":null,"analyzedSha":"878ce2a1fad54ca941d17fdcf2e1d924b148eb1f","analyzedAt":"2026-08-14T15:17:09.895Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}