Source:
<code>private void visitScriptNode(NodeTraversal t) { Set<String> classNames = new HashSet<>(); for (Map.Entry<String, Node> entry : usages.entrySet()) { String className = entry.getKey(); Node node = entry.getValue(); String outermostClassName = getOutermostClassName(className); String nonNullClassName = outermostClassName != null ? outermostClassName : className; String parentNamespace = null; int separatorIndex = nonNullClassName.lastIndexOf('.'); if (separatorIndex > 0) { parentNamespace = nonNullClassName.substring(0, separatorIndex); } Var scopeVar = t.getScope().getVar(nonNullClassName); boolean notProvidedByConstructors = (constructors == null || (!constructors.contains(className) && !constructors.contains(outermostClassName))); boolean notProvidedByRequires = (requires == null || (!requires.containsKey(className) && !requires.containsKey(outermostClassName) && !requires.containsKey(parentNamespace))); <START> boolean notProvidedByExterns = scopeVar==null || !scopeVar.isExtern(); <END> if (notProvidedByConstructors && notProvidedByRequires && notProvidedByExterns && !classNames.contains(className)) { compiler.report(t.makeError(node, MISSING_REQUIRE_WARNING, className)); classNames.add(className); } } for (Map.Entry<String, Node> entry : requires.entrySet()) { String require = entry.getKey(); Node call = entry.getValue(); Node parent = call.getParent(); if (parent.isAssign()) { continue; } if (!usages.containsKey(require) && !weakUsages.containsKey(require)) { reportExtraRequireWarning(call, require); } } this.usages.clear(); this.weakUsages.clear(); this.requires.clear(); this.constructors.clear(); }</code><technical_language>nit: spaces ==</technical_language>

Target:
private void visitScriptNode(NodeTraversal t) { if (isModule) { return; } Set<String> classNames = new HashSet<>(); for (Map.Entry<String, Node> entry : usages.entrySet()) { String className = entry.getKey(); Node node = entry.getValue(); String outermostClassName = getOutermostClassName(className); String nonNullClassName = outermostClassName != null ? outermostClassName : className; String parentNamespace = null; int separatorIndex = nonNullClassName.lastIndexOf('.'); if (separatorIndex > 0) { parentNamespace = nonNullClassName.substring(0, separatorIndex); } Var scopeVar = t.getScope().getVar(nonNullClassName); boolean notProvidedByConstructors = (constructors == null || (!constructors.contains(className) && !constructors.contains(outermostClassName))); boolean notProvidedByRequires = (requires == null || (!requires.containsKey(className) && !requires.containsKey(outermostClassName) && !requires.containsKey(parentNamespace))); boolean notProvidedByExterns = scopeVar == null || !scopeVar.isExtern(); if (notProvidedByConstructors && notProvidedByRequires && notProvidedByExterns && !classNames.contains(className)) { compiler.report(t.makeError(node, MISSING_REQUIRE_WARNING, className)); classNames.add(className); } } for (Map.Entry<String, Node> entry : requires.entrySet()) { String require = entry.getKey(); Node call = entry.getValue(); Node parent = call.getParent(); if (parent.isAssign()) { continue; } if (!usages.containsKey(require) && !weakUsages.containsKey(require)) { reportExtraRequireWarning(call, require); } } }