while (iter.hasNext()) { ClasspathLocation location = iter.next(); if (!strategy.matches(location, ClasspathLocation::hasModule)) continue; NameEnvironmentAnswer answer;
if (strategy.matches(location, ClasspathLocation::hasModule) ) { if (location.isPackage(qualifiedPackageName, null)) { char[][] mNames = location.getModulesDeclaringPackage(qualifiedPackageName, null);
if (strategy.matches(location, ClasspathLocation::hasModule) ) { if (location.isPackage(qualifiedPackageName, null)) { char[][] mNames = location.getModulesDeclaringPackage(qualifiedPackageName, null);
for (IPackageFragmentRoot packageRoot : packageRoots) { IPackageFragmentRoot[] singleton = { packageRoot }; if (strategy.matches(singleton, locs -> locs[0] instanceof JrtPackageFragmentRoot || getModuleDescription(locs) != null)) { if (this.nameLookup.isPackage(pkgName, singleton)) { IModuleDescription moduleDescription = getModuleDescription(singleton);
for (IPackageFragmentRoot packageRoot : packageRoots) { IPackageFragmentRoot[] singleton = { packageRoot }; if (strategy.matches(singleton, locs -> locs[0] instanceof JrtPackageFragmentRoot || getModuleDescription(locs) != null)) { if (this.nameLookup.isPackage(pkgName, singleton)) { IModuleDescription moduleDescription = getModuleDescription(singleton);
if (qualifiedPackageName == qp2) { for (int i = 0, length = this.classpaths.length; i < length; i++) { if (!strategy.matches(this.classpaths[i], Classpath::hasModule)) continue; NameEnvironmentAnswer answer = this.classpaths[i].findClass(typeName, qualifiedPackageName, null, qualifiedBinaryFileName, asBinaryOnly); for (int i = 0, length = this.classpaths.length; i < length; i++) { Classpath p = this.classpaths[i]; if (!strategy.matches(p, Classpath::hasModule)) continue; NameEnvironmentAnswer answer = !(p instanceof ClasspathDirectory)
char[][] names = CharOperation.NO_CHAR_CHAR; for (ClasspathLocation location : this.binaryLocations) { if (strategy.matches(location, ClasspathLocation::hasModule)) { char[][] declaringModules = location.getModulesDeclaringPackage(pkgName, null); if (declaringModules != null) if (strategy.matches(location, ClasspathLocation::hasModule)) { char[][] declaringModules = location.getModulesDeclaringPackage(pkgName, null); if (declaringModules != null)
if (strategy.matches(this.binaryLocations[i], ClasspathLocation::hasModule)) if (this.binaryLocations[i].isPackage(qualifiedPackageName, null)) return true; if (strategy.matches(this.sourceLocations[i], ClasspathLocation::hasModule)) if (this.sourceLocations[i].isPackage(qualifiedPackageName, null)) return true;
if (strategy.matches(cp, Classpath::hasModule)) { if (strategy == LookupStrategy.Unnamed) {
for (IPackageFragmentRoot packageRoot : packageRoots) { IPackageFragmentRoot[] singleton = { packageRoot }; if (strategy.matches(singleton, locs -> locs[0] instanceof JrtPackageFragmentRoot || getModuleDescription(locs) != null)) { if (this.nameLookup.hasCompilationUnit(pkgName, singleton)) return true;
char[][] names = CharOperation.NO_CHAR_CHAR; for (ClasspathLocation location : this.binaryLocations) { if (strategy.matches(location, ClasspathLocation::hasModule)) { char[][] declaringModules = location.getModulesDeclaringPackage(pkgName, null); if (declaringModules != null) if (strategy.matches(location, ClasspathLocation::hasModule)) { char[][] declaringModules = location.getModulesDeclaringPackage(pkgName, null); if (declaringModules != null)
for (int i = 0; i < this.classpaths.length; i++) { Classpath location = this.classpaths[i]; if (strategy.matches(location, Classpath::hasModule)) if (location.hasCompilationUnit(qPackageName, moduleNameString)) return true;
for (IPackageFragmentRoot packageRoot : packageRoots) { IPackageFragmentRoot[] singleton = { packageRoot }; if (strategy.matches(singleton, locs -> locs[0] instanceof JrtPackageFragmentRoot || getModuleDescription(locs) != null)) { if (this.nameLookup.hasCompilationUnit(pkgName, singleton)) return true;
case Unnamed: for (ClasspathLocation location : this.binaryLocations) { if (strategy.matches(location, ClasspathLocation::hasModule)) if (location.hasCompilationUnit(pkgName, null)) return true; if (strategy.matches(location, ClasspathLocation::hasModule)) if (location.hasCompilationUnit(pkgName, null)) return true;
case Unnamed: for (ClasspathLocation location : this.binaryLocations) { if (strategy.matches(location, ClasspathLocation::hasModule)) if (location.hasCompilationUnit(pkgName, null)) return true; if (strategy.matches(location, ClasspathLocation::hasModule)) if (location.hasCompilationUnit(pkgName, null)) return true;
if (strategy.matches(cp, Classpath::hasModule)) { if (strategy == LookupStrategy.Unnamed) {
for (int i = 0; i < this.classpaths.length; i++) { Classpath location = this.classpaths[i]; if (strategy.matches(location, Classpath::hasModule)) if (location.hasCompilationUnit(qPackageName, moduleNameString)) return true;
if (strategy.matches(this.binaryLocations[i], ClasspathLocation::hasModule)) if (this.binaryLocations[i].isPackage(qualifiedPackageName, null)) return true; if (strategy.matches(this.sourceLocations[i], ClasspathLocation::hasModule)) if (this.sourceLocations[i].isPackage(qualifiedPackageName, null)) return true;
@Override public boolean hasCompilationUnit(char[][] qualifiedPackageName, char[] moduleName, boolean checkCUs) { String qualifiedPackageNameString = String.valueOf(CharOperation.concatWith(qualifiedPackageName, '/')); LookupStrategy strategy = LookupStrategy.get(moduleName); String moduleNameString = LookupStrategy.getStringName(moduleName); if (strategy == LookupStrategy.Named) { if (this.moduleLocations != null) { ClasspathLocation location = this.moduleLocations.get(moduleNameString); if (location != null) return location.hasCompilationUnit(qualifiedPackageNameString, moduleNameString); } } else { for (ClasspathLocation location : this.locationSet) { if (strategy.matches(location, ClasspathLocation::hasModule) ) if (location.hasCompilationUnit(qualifiedPackageNameString, moduleNameString)) return true; } } return false; }
@Override public boolean hasCompilationUnit(char[][] qualifiedPackageName, char[] moduleName, boolean checkCUs) { String qualifiedPackageNameString = String.valueOf(CharOperation.concatWith(qualifiedPackageName, '/')); LookupStrategy strategy = LookupStrategy.get(moduleName); String moduleNameString = LookupStrategy.getStringName(moduleName); if (strategy == LookupStrategy.Named) { if (this.moduleLocations != null) { ClasspathLocation location = this.moduleLocations.get(moduleNameString); if (location != null) return location.hasCompilationUnit(qualifiedPackageNameString, moduleNameString); } } else { for (ClasspathLocation location : this.locationSet) { if (strategy.matches(location, ClasspathLocation::hasModule) ) if (location.hasCompilationUnit(qualifiedPackageNameString, moduleNameString)) return true; } } return false; }