package-private for testing.
17725
static InternalLogger wrapLogger(Logger logger) {
        return logger instanceof LocationAwareLogger ?
                new LocationAwareSlf4JLogger((LocationAwareLogger) logger) : new Slf4JLogger(logger);
    }
288606
private final void checkInvariants() throws Error {

        if (_lineBreak == null) {
            throw new Error("_lineBreak == null");
        } else if (_lineBreak == LineBreak.NONE && _indentation.length() > 0) {
            throw new Error("_lineBreak == LineBreak.NONE && _indentation = \"" + _indentation + "\".");
        } else if (_elementStack == null) {
            throw new Error("_elementStack (" + _elementStack + " == null");
        } else if (_elementStackSize < 0) {
            throw new Error("_elementStackSize (" + _elementStackSize + ") < 0");
        }
    }
222724
private void validate() {
        if (host.isEmpty()) {
            throw new IllegalArgumentException("host cannot be null");
        }
        if (catalog == null) {
            throw new IllegalArgumentException("namespace cannot be null");
        }
        if (table == null) {
            throw new IllegalArgumentException("set cannot be null");
        }
        if (portList.isEmpty()) {
            if(port>0){
                port(port);
            }else{
                throw new IllegalArgumentException("port cannot be null");
            }

        }
        if (host.size() != portList.size()) {
            throw new IllegalArgumentException("Host and ports cardinality must be the same");
        }

    }
1034079
private void init() {
		Collection<String> paths = StringSupport.split(classpath, ";:", false);

		for (String location : paths) {

			location = FileSupport.convertToUnixStylePath(location);
			if (location.endsWith(".zip") || location.endsWith(".jar")) {
				mapFilesInZip(location);
			} else {
				File dir = new File(location);
				if (dir.isDirectory()) {
					if (!location.endsWith("/")) {
						location += '/';
					}
					Collection<File> classFiles = FileSupport.getFilesInDirectoryTree(dir);
					for (File file : classFiles) {
						String fileName = file.getPath();
						if ((fileName.endsWith(".jar") || fileName.endsWith(".zip")) && !file.isHidden()) {
							mapFilesInZip(fileName);
						} else { // .class .properties etc.
							mapClassResourceEntry(file.getPath().substring(location.length()), file);
							fileCreationTimes.put(file, new Long(file.lastModified()));
						}
					}
				} else {
					//path can not be mapped
				}
			}
		}
	}
1354116
@Override
    public boolean analyzeJar(Analyzer analyzer) throws Exception {
        loadInternalRangeFix();
        loadExternalRangeFix();

        if (analyzer.getReferred() == null) {
            return false;
        }

        // Data loaded, start analysis
        for (Map.Entry<Descriptors.PackageRef, Attrs> entry : analyzer.getReferred().entrySet()) {
            for (Range range : ranges) {
                if (range.matches(entry.getKey().getFQN())) {
                    String value = range.getRange(analyzer);
                    if (value != null) {
                        reporter.warning("Updating import version of " + range.name + " to " + value);
                        entry.getValue().put("version", value);
                    }
                }
            }
        }
        return false;
    }
155841
Object readClassOrType(int i) {
        int index =  poolIdx[i];
        int len = getChar(index + 1);
        int start = index + 3;
        Assert.check(buf[start] == '[' || buf[start + len - 1] != ';');
        // by the above assertion, the following test can be
        // simplified to (buf[start] == '[')
        return (buf[start] == '[' || buf[start + len - 1] == ';')
            ? (Object)sigToType(buf, start, len)
            : (Object)enterClass(names.fromUtf(internalize(buf, start,
                                                           len)));
    }
1101711
function checkForSemicolonForVariableDeclaration(node) {
            const parent = node.parent;

            if ((parent.type !== "ForStatement" || parent.init !== node) &&
                (!/^For(?:In|Of)Statement/u.test(parent.type) || parent.left !== node)
            ) {
                checkForSemicolon(node);
            }
        }
1159087
private static void exch(long[] values, int i, int j) {
        long k = values[i];
        values[i] = values[j];
        values[j] = k;
    }
66470
private RuntimeException codeBug()
        throws RuntimeException
    {
        throw Kit.codeBug("ts.cursor=" + ts.cursor
                          + ", ts.tokenBeg=" + ts.tokenBeg
                          + ", currentToken=" + currentToken);
    }
445370
public boolean hasTemplate(String key)
	{
		Program program = (Program) this.programCache.get(key);
		return program != null;
	}
463048
@Execute
    public void process() throws Exception {
        if (!concatOr(outCb == null, doReset)) {
            return;
        }
        checkNull(inRaster1);
        RenderedImage map1RI = inRaster1.getRenderedImage();
        RenderedImage map2RI = null;
        if (inRaster2 == null) {
            map2RI = map1RI;
        } else {
            map2RI = inRaster2.getRenderedImage();
        }

        outCb = new CoupledFieldsMoments().process(map1RI, map2RI, pBins, pFirst, pLast, pm, binmode);
    }
839323
private final void checkCompatibility(VariableNumMap other) {
    int i = 0, j = 0;
    int[] otherNums = other.nums;
    String[] otherNames = other.names;
    Variable[] otherVars = other.vars;
    while (i < nums.length && j < otherNums.length) {
      if (nums[i] < otherNums[j]) {
        i++;
      } else if (nums[i] > otherNums[j]) {
        j++;
      } else {
        // Equal
        Preconditions.checkArgument(names[i].equals(otherNames[j]));
        Preconditions.checkArgument(vars[i].getName().equals(otherVars[j].getName()));
        i++; j++;
      }
    }
  }
1008066
void memberEnter(List<? extends JCTree> trees, Env<AttrContext> env) {
        for (List<? extends JCTree> l = trees; l.nonEmpty(); l = l.tail)
            memberEnter(l.head, env);
    }
1155553
public void scan(List<? extends JCTree> trees) {
        if (trees != null)
        for (List<? extends JCTree> l = trees; l.nonEmpty(); l = l.tail)
            scan(l.head);
    }


/* ***************************************************************************
 * Visitor methods
 ****************************************************************************/

    public void visitTopLevel(JCCompilationUnit tree) {
        scan(tree.defs);
    }

    public void visitPackageDef(JCPackageDecl tree) {
        scan(tree.annotations);
        scan(tree.pid);
    }

    @Override
    public void visitModuleDef(JCModuleDecl tree) {
        scan(tree.mods);
        scan(tree.qualId);
        scan(tree.directives);
    }

    @Override
    public void visitExports(JCExports tree) {
        scan(tree.qualid);
        scan(tree.moduleNames);
    }

    @Override
    public void visitOpens(JCOpens tree) {
        scan(tree.qualid);
        scan(tree.moduleNames);
    }

    @Override
    public void visitProvides(JCProvides tree) {
        scan(tree.serviceName);
        scan(tree.implNames);
    }

    @Override
    public void visitRequires(JCRequires tree) {
        scan(tree.moduleName);
    }

    @Override
    public void visitUses(JCUses tree) {
        scan(tree.qualid);
    }

    public void visitImport(JCImport tree) {
        scan(tree.qualid);
    }

    public void visitClassDef(JCClassDecl tree) {
        scan(tree.mods);
        scan(tree.typarams);
        scan(tree.extending);
        scan(tree.implementing);
        scan(tree.defs);
    }

    public void visitMethodDef(JCMethodDecl tree) {
        scan(tree.mods);
        scan(tree.restype);
        scan(tree.typarams);
        scan(tree.recvparam);
        scan(tree.params);
        scan(tree.thrown);
        scan(tree.defaultValue);
        scan(tree.body);
    }

    public void visitVarDef(JCVariableDecl tree) {
        scan(tree.mods);
        scan(tree.vartype);
        scan(tree.nameexpr);
        scan(tree.init);
    }

    public void visitSkip(JCSkip tree) {
    }
1263568
protected void checkParameters() {
        if (homeDir == null && classpath == null) {
            throw new BuildException("either home attribute or " + "classpath attributes "
                    + " must be defined for task <" + getTaskName() + "/>", getLocation());
        }

        if (pluginList != null) {
            // Make sure that all plugins are actually Jar files.
            String[] pluginFileList = pluginList.list();
            for (String pluginFile : pluginFileList) {
                if (!pluginFile.endsWith(".jar")) {
                    throw new BuildException("plugin file " + pluginFile + " is not a Jar file " + "in task <" + getTaskName()
                    + "/>", getLocation());
                }
            }
        }

        for (SystemProperty systemProperty : systemPropertyList) {
            if (systemProperty.getName() == null || systemProperty.getValue() == null) {
                throw new BuildException("systemProperty elements must have name and value attributes");
            }
        }
    }
270189
public void scan(List<? extends JCTree> trees) {
        if (trees != null)
        for (List<? extends JCTree> l = trees; l.nonEmpty(); l = l.tail)
            scan(l.head);
    }


/* ***************************************************************************
 * Visitor methods
 ****************************************************************************/

    public void visitTopLevel(JCCompilationUnit tree) {
        scan(tree.packageAnnotations);
        scan(tree.pid);
        scan(tree.defs);
    }

    public void visitImport(JCImport tree) {
        scan(tree.qualid);
    }

    public void visitClassDef(JCClassDecl tree) {
        scan(tree.mods);
        scan(tree.typarams);
        scan(tree.extending);
        scan(tree.implementing);
        scan(tree.defs);
    }

    public void visitMethodDef(JCMethodDecl tree) {
        scan(tree.mods);
        scan(tree.restype);
        scan(tree.typarams);
        scan(tree.recvparam);
        scan(tree.params);
        scan(tree.thrown);
        scan(tree.defaultValue);
        scan(tree.body);
    }

    public void visitVarDef(JCVariableDecl tree) {
        scan(tree.mods);
        scan(tree.vartype);
        scan(tree.nameexpr);
        scan(tree.init);
    }

    public void visitSkip(JCSkip tree) {
    }
599836
private boolean checkPathAndPackage(Path dir, JCTree pkgName) {
        Iterator<String> pathIter = new ParentIterator(dir);
        Iterator<String> pkgIter = new EnclosingPkgIterator(pkgName);
        while (pathIter.hasNext() && pkgIter.hasNext()) {
            if (!pathIter.next().equals(pkgIter.next()))
                return false;
        }
        return !pkgIter.hasNext(); /*&& !pathIter.hasNext() See JDK-8059598 */
    }