public IModule getModule() { if (this.isAutoModule && this.module == null) { return this.module = IModule.createAutomatic(this.path, false, null/*no manifest*/); } return this.module; } }
void cachePartsFrom(IModule module) { if (module.isOpen()) this.modifiers |= ClassFileConstants.ACC_OPEN; IModuleReference[] requiresReferences = module.requires(); this.requires = new ModuleBinding[requiresReferences.length]; this.requiresTransitive = new ModuleBinding[requiresReferences.length]; int count = 0; int transitiveCount = 0; for (int i = 0; i < requiresReferences.length; i++) { ModuleBinding requiredModule = this.environment.getModule(requiresReferences[i].name()); if (requiredModule != null) { this.requires[count++] = requiredModule; if (requiresReferences[i].isTransitive()) this.requiresTransitive[transitiveCount++] = requiredModule; } // TODO(SHMOD): handle null case } if (count < this.requiresTransitive.length) System.arraycopy(this.requires, 0, this.requires = new ModuleBinding[count], 0, count); if (transitiveCount < this.requiresTransitive.length) System.arraycopy(this.requiresTransitive, 0, this.requiresTransitive = new ModuleBinding[transitiveCount], 0, transitiveCount); this.unresolvedExports = module.exports(); this.unresolvedOpens = module.opens(); this.unresolvedUses = module.uses(); this.unresolvedProvides = module.provides(); }
@Override public char[][] getAllAutomaticModules() { if (this.moduleLocations == null || this.moduleLocations.size() == 0) return CharOperation.NO_CHAR_CHAR; Set<char[]> set = this.moduleLocations.values().stream().map(e -> e.getModule()).filter(m -> m != null && m.isAutomatic()) .map(m -> m.name()).collect(Collectors.toSet()); return set.toArray(new char[set.size()][]); }
public AutomaticModuleBinding(IModule module, LookupEnvironment existingEnvironment) { super(module.name(), existingEnvironment); existingEnvironment.root.knownModules.put(this.moduleName, this); this.isAuto = true; this.autoNameFromManifest = module.isAutoNameFromManifest(); this.requires = Binding.NO_MODULES; this.requiresTransitive = Binding.NO_MODULES; this.exportedPackages = Binding.NO_PACKAGES; } @Override
public char[][] singletonModuleNameIf(boolean condition) { if (!condition) return null; if (this.module != null) return new char[][] { this.module.name() }; return new char[][] { ModuleBinding.UNNAMED }; } }
if (module == null) return null; String modName = new String(module.name()); if (!modName.equals(file.getName())) { throw new IllegalArgumentException("module name " + modName + " does not match expected name " + file.getName()); //$NON-NLS-1$ //$NON-NLS-2$ module = IModule.createAutomatic(getFileName(file), file.isFile(), getManifest(file));
public void acceptModule(IModule mod) { this.module = mod; this.isAutoModule = mod.isAutomatic(); } @Override
default IPackageExport[] getExportedPackages() throws JavaModelException { return getModuleInfo().exports(); } default IService[] getProvidedServices() throws JavaModelException {
default IModuleReference[] getRequiredModules() throws JavaModelException { return getModuleInfo().requires(); } default IPackageExport[] getExportedPackages() throws JavaModelException {
default IPackageExport[] getOpenedPackages() throws JavaModelException { return getModuleInfo().opens(); } @Override
@Override public int getFlags() throws JavaModelException { if (getModuleInfo().isOpen()) return ClassFileConstants.ACC_OPEN; return 0; } @Override
default IService[] getProvidedServices() throws JavaModelException { return getModuleInfo().provides(); } default char[][] getUsedServices() throws JavaModelException {
default char[][] getUsedServices() throws JavaModelException { return getModuleInfo().uses(); } default IPackageExport[] getOpenedPackages() throws JavaModelException {
public char[][] singletonModuleNameIf(boolean condition) { if (!condition) return null; if (this.module != null) return new char[][] { this.module.name() }; return new char[][] { ModuleBinding.UNNAMED }; } }
if (module == null) return null; String modName = new String(module.name()); if (!modName.equals(file.getName())) { throw new IllegalArgumentException("module name " + modName + " does not match expected name " + file.getName()); //$NON-NLS-1$ //$NON-NLS-2$ module = IModule.createAutomatic(getFileName(file), file.isFile(), getManifest(file));
@Override public void acceptModule(IModule mod) { this.module = mod; this.isAutoModule = mod.isAutomatic(); } @Override
IModule module = getModule.apply(mod); if (module != null) { for (IPackageExport packageExport : module.exports()) { if (!packageExport.isQualified()) { result.add(moduleName);