Source:
<code>protected String dotOutputFileName(UnderlyingAST ast) { StringBuilder srcLoc = new StringBuilder(); StringBuilder outFile = new StringBuilder(outDir); outFile.append("/"); if (ast.getKind() == UnderlyingAST.Kind.ARBITRARY_CODE) { CFGStatement cfgStatement = (CFGStatement) ast; String clsName = cfgStatement.getClassTree().getSimpleName().toString(); outFile.append(clsName); outFile.append("-initializer-"); outFile.append(ast.hashCode()); srcLoc.append("<"); srcLoc.append(clsName); srcLoc.append("::initializer::"); srcLoc.append(((JCTree) cfgStatement.getCode()).pos); srcLoc.append(">"); } else if (ast.getKind() == UnderlyingAST.Kind.METHOD) { CFGMethod cfgMethod = (CFGMethod) ast; String clsName = cfgMethod.getClassTree().getSimpleName().toString(); String methodName = cfgMethod.getMethod().getName().toString(); outFile.append(clsName); outFile.append("-"); outFile.append(methodName); srcLoc.append("<"); srcLoc.append(clsName); srcLoc.append("::"); srcLoc.append(methodName); srcLoc.append("("); srcLoc.append(cfgMethod.getMethod().getParameters()); srcLoc.append(")::"); srcLoc.append(((JCTree) cfgMethod.getMethod()).pos); srcLoc.append(">"); } else { throw new BugInCF("Unexpected AST kind: " + ast.getKind() + " value: " + ast); } <START> if (!checkerName.isEmpty()) { <END> outFile.append('-'); outFile.append(checkerName); } outFile.append(".dot"); String outFileName = outFile.toString().replace("<", "_").replace(">", ""); generated.put(srcLoc.toString(), outFileName); return outFileName; }</code><technical_language>improve error handling? I add a null check field nullable. configuration map key is ok. In contrast, field outDir non-null configuration provided. add a check for non-null in constructor</technical_language>

Target:
protected String dotOutputFileName(UnderlyingAST ast) { StringBuilder srcLoc = new StringBuilder(); StringBuilder outFile = new StringBuilder(outDir); outFile.append("/"); if (ast.getKind() == UnderlyingAST.Kind.ARBITRARY_CODE) { CFGStatement cfgStatement = (CFGStatement) ast; String clsName = cfgStatement.getClassTree().getSimpleName().toString(); outFile.append(clsName); outFile.append("-initializer-"); outFile.append(ast.hashCode()); srcLoc.append("<"); srcLoc.append(clsName); srcLoc.append("::initializer::"); srcLoc.append(((JCTree) cfgStatement.getCode()).pos); srcLoc.append(">"); } else if (ast.getKind() == UnderlyingAST.Kind.METHOD) { CFGMethod cfgMethod = (CFGMethod) ast; String clsName = cfgMethod.getClassTree().getSimpleName().toString(); String methodName = cfgMethod.getMethod().getName().toString(); outFile.append(clsName); outFile.append("-"); outFile.append(methodName); srcLoc.append("<"); srcLoc.append(clsName); srcLoc.append("::"); srcLoc.append(methodName); srcLoc.append("("); srcLoc.append(cfgMethod.getMethod().getParameters()); srcLoc.append(")::"); srcLoc.append(((JCTree) cfgMethod.getMethod()).pos); srcLoc.append(">"); } else { throw new BugInCF("Unexpected AST kind: " + ast.getKind() + " value: " + ast); } if (checkerName != null && !checkerName.isEmpty()) { outFile.append('-'); outFile.append(checkerName); } outFile.append(".dot"); String outFileName = outFile.toString().replace("<", "_").replace(">", ""); generated.put(srcLoc.toString(), outFileName); return outFileName; }