Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Herrmann2019-01-21 17:47:47 -0500
committerStephan Herrmann2019-01-21 17:47:47 -0500
commitd83eba27c249065f8a479d0ede7680609556ea71 (patch)
treee4b6808ce3c243bc0f3ac70a5fc98f6631ef3b46
parent6e564d275036df6ddbdc74eed6e8e0bd0751ed8a (diff)
downloadeclipse.jdt.core-d83eba27c249065f8a479d0ede7680609556ea71.tar.gz
eclipse.jdt.core-d83eba27c249065f8a479d0ede7680609556ea71.tar.xz
eclipse.jdt.core-d83eba27c249065f8a479d0ede7680609556ea71.zip
Bug 543647 - Regression after fix for Bug 542896
Change-Id: Ic8fc6e3f8b764be4f5bc487f1f8e884e5b3293c3 Signed-off-by: Stephan Herrmann <stephan.herrmann@berlin.de>
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceModuleBinding.java28
1 files changed, 21 insertions, 7 deletions
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceModuleBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceModuleBinding.java
index bcd6af0a87..ee5fd9a20e 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceModuleBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceModuleBinding.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2017, 2018 GK Software AG, and others.
+ * Copyright (c) 2017, 2019 GK Software AG, and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -41,7 +41,7 @@ public class SourceModuleBinding extends ModuleBinding {
}
public void setRequires(ModuleBinding[] requires, ModuleBinding[] requiresTransitive) {
- // TODO(SHMOD): it's a bit awkward that we may get called after applyModuleUpdates() has already worked.
+ // remember that we may get called after applyModuleUpdates() has already worked.
ModuleBinding javaBase = this.environment.javaBaseModule();
this.requires = merge(this.requires, requires, javaBase, ModuleBinding[]::new);
this.requiresTransitive = merge(this.requiresTransitive, requiresTransitive, null, ModuleBinding[]::new);
@@ -106,18 +106,32 @@ public class SourceModuleBinding extends ModuleBinding {
@Override
Stream<ModuleBinding> getRequiredModules(boolean transitiveOnly) {
- if (this.requires == NO_MODULES) {
- this.scope.referenceContext.moduleDeclaration.resolveModuleDirectives(this.scope);
- }
+ // don't rely on "if (this.requires == NO_MODULES)" - could have been modified by completeIfNeeded()
+ this.scope.referenceContext.moduleDeclaration.resolveModuleDirectives(this.scope);
return super.getRequiredModules(transitiveOnly);
}
@Override
public ModuleBinding[] getAllRequiredModules() {
- if (this.scope != null)
- this.scope.referenceContext.moduleDeclaration.resolveModuleDirectives(this.scope);
+ // don't rely on "if (this.requires == NO_MODULES)" - could have been modified by completeIfNeeded()
+ this.scope.referenceContext.moduleDeclaration.resolveModuleDirectives(this.scope);
return super.getAllRequiredModules();
}
+
+ @Override
+ public PackageBinding[] getExports() {
+ // don't rely on "if (this.exportedPackages == Binding.NO_PACKAGES)" - could have been modified by completeIfNeeded()
+ this.scope.referenceContext.moduleDeclaration.resolvePackageDirectives(this.scope);
+ return super.getExports();
+ }
+
+ @Override
+ public PackageBinding[] getOpens() {
+ // don't rely on "if (this.openedPackages == Binding.NO_PACKAGES)" - could have been modified by completeIfNeeded()
+ this.scope.referenceContext.moduleDeclaration.resolvePackageDirectives(this.scope);
+ return super.getOpens();
+ }
+
@Override
public long getAnnotationTagBits() {
ensureAnnotationsResolved();

Back to the top