Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Herrmann2018-07-26 17:10:48 +0000
committerStephan Herrmann2018-07-26 17:13:38 +0000
commitd0fe062fe77750c82ecccd8ef3b812c75adeef2e (patch)
tree826a18b73e6a52e6a0b3a4738049584c5070c407 /org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryModuleBinding.java
parentd97e1b8ae45bb1ce31aca58f9fff321bd2c640fa (diff)
downloadorg.eclipse.objectteams-d0fe062fe77750c82ecccd8ef3b812c75adeef2e.tar.gz
org.eclipse.objectteams-d0fe062fe77750c82ecccd8ef3b812c75adeef2e.tar.xz
org.eclipse.objectteams-d0fe062fe77750c82ecccd8ef3b812c75adeef2e.zip
Update jdt.core to I20180725-2000 (towards 2018-09 M2)
Diffstat (limited to 'org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryModuleBinding.java')
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryModuleBinding.java21
1 files changed, 18 insertions, 3 deletions
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryModuleBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryModuleBinding.java
index 906105396..14b9e6b84 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryModuleBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryModuleBinding.java
@@ -165,7 +165,7 @@ public class BinaryModuleBinding extends ModuleBinding {
int count = 0;
for (int i = 0; i < this.unresolvedExports.length; i++) {
IPackageExport export = this.unresolvedExports[i];
- PackageBinding declaredPackage = getVisiblePackage(CharOperation.splitOn('.', export.name()));
+ PackageBinding declaredPackage = forcedGetExportedPackage(CharOperation.splitOn('.', export.name()));
if (declaredPackage != null) {
this.exportedPackages[count++] = declaredPackage;
if (declaredPackage instanceof SplitPackageBinding)
@@ -174,8 +174,6 @@ public class BinaryModuleBinding extends ModuleBinding {
declaredPackage.isExported = Boolean.TRUE;
recordExportRestrictions(declaredPackage, export.targets());
}
- } else {
- // TODO(SHMOD): report incomplete module path?
}
}
if (count < this.exportedPackages.length)
@@ -201,6 +199,23 @@ public class BinaryModuleBinding extends ModuleBinding {
System.arraycopy(this.openedPackages, 0, this.openedPackages = new PackageBinding[count], 0, count);
}
+ PackageBinding forcedGetExportedPackage(char[][] compoundName) {
+ // when resolving "exports" in a binary module we simply assume the package must exist,
+ // since this has been checked already when compiling that module.
+ PackageBinding binding = getVisiblePackage(compoundName);
+ if (binding != null)
+ return binding;
+ if (compoundName.length > 1) {
+ PackageBinding parent = forcedGetExportedPackage(CharOperation.subarray(compoundName, 0, compoundName.length-1));
+ binding = new PackageBinding(compoundName, parent, this.environment, this);
+ parent.addPackage(binding, this, true);
+ return binding;
+ }
+ binding = new PackageBinding(compoundName[0], this.environment, this);
+ addPackage(binding, true);
+ return binding;
+ }
+
@Override
public TypeBinding[] getUses() {
if (this.uses == null) {

Back to the top