protected String readJarContent(final SimpleSet packageSet) { String modInfo = null; for (Enumeration<? extends ZipEntry> e = this.zipFile.entries(); e.hasMoreElements(); ) { ZipEntry entry = e.nextElement(); char[] entryName = entry.getName().toCharArray(); int index = CharOperation.indexOf('/', entryName); if (index != -1) { char[] folder = CharOperation.subarray(entryName, 0, index); if (CharOperation.equals(CLASSES, folder)) { char[] fileName = CharOperation.subarray(entryName, index + 1, entryName.length); if (modInfo == null && fileName.length == MODULE_DESCRIPTOR_NAME_LENGTH) { if (CharOperation.equals(fileName, IModule.MODULE_INFO_CLASS.toCharArray())) { modInfo = new String(entryName); } } addToPackageSet(packageSet, new String(fileName), false); } } } return modInfo; } }
static ClasspathLocation forLibrary(String libraryPathname, long lastModified, AccessRuleSet accessRuleSet, IPath annotationsPath, boolean autoModule) { return Util.isJrt(libraryPathname) ? new ClasspathJrt(libraryPathname, annotationsPath) : Util.archiveFormat(libraryPathname) == Util.JMOD_FILE ? new ClasspathJMod(libraryPathname, lastModified, accessRuleSet, annotationsPath) : new ClasspathJar(libraryPathname, lastModified, accessRuleSet, annotationsPath, autoModule); }
@Override public NameEnvironmentAnswer findClass(String binaryFileName, String qualifiedPackageName, String moduleName, String qualifiedBinaryFileName, boolean asBinaryOnly, Predicate<String> moduleNameFilter) { if (!isPackage(qualifiedPackageName, moduleName)) return null; // most common case if (moduleNameFilter != null && this.module != null && !moduleNameFilter.test(String.valueOf(this.module.name()))) return null;
static ClasspathLocation forLibrary(String libraryPathname, long lastModified, AccessRuleSet accessRuleSet, IPath annotationsPath, boolean autoModule, String compliance) { return Util.archiveFormat(libraryPathname) == Util.JMOD_FILE ? new ClasspathJMod(libraryPathname, lastModified, accessRuleSet, annotationsPath) : (compliance == null || (CompilerOptions.versionToJdkLevel(compliance) < ClassFileConstants.JDK9) ? new ClasspathJar(libraryPathname, lastModified, accessRuleSet, annotationsPath, autoModule) : new ClasspathMultiReleaseJar(libraryPathname, lastModified, accessRuleSet, annotationsPath, autoModule, compliance)); } static ClasspathJrt forJrtSystem(String jrtPath, AccessRuleSet accessRuleSet, IPath annotationsPath, String release) {
public NameEnvironmentAnswer findClass(String binaryFileName, String qualifiedPackageName, String moduleName, String qualifiedBinaryFileName, boolean asBinaryOnly) { if (!isPackage(qualifiedPackageName, moduleName)) return null; // most common case
@Override protected String readJarContent(final SimpleSet packageSet) { String modInfo = null; for (Enumeration<? extends ZipEntry> e = this.zipFile.entries(); e.hasMoreElements(); ) { ZipEntry entry = e.nextElement(); char[] entryName = entry.getName().toCharArray(); int index = CharOperation.indexOf('/', entryName); if (index != -1) { char[] folder = CharOperation.subarray(entryName, 0, index); if (CharOperation.equals(CLASSES, folder)) { char[] fileName = CharOperation.subarray(entryName, index + 1, entryName.length); if (modInfo == null && fileName.length == MODULE_DESCRIPTOR_NAME_LENGTH) { if (CharOperation.equals(fileName, IModule.MODULE_INFO_CLASS.toCharArray())) { modInfo = new String(entryName); } } addToPackageSet(packageSet, new String(fileName), false); } } } return modInfo; } }