Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Arthanareeswaran2019-03-20 05:34:08 -0400
committerJay Arthanareeswaran2019-03-20 05:34:08 -0400
commit896cb38596980efacd9f1a3858de3d5249bab258 (patch)
tree8381947296d8b2ddc8499bc9d61ee6a45c4583e3 /org.eclipse.jdt.compiler.apt
parentb9957bd06da31c58841b8ad50731877e58c32071 (diff)
parent9d41eef9c57e4ff00f30312ccf1fdfdfc61daa21 (diff)
downloadeclipse.jdt.core-896cb38596980efacd9f1a3858de3d5249bab258.tar.gz
eclipse.jdt.core-896cb38596980efacd9f1a3858de3d5249bab258.tar.xz
eclipse.jdt.core-896cb38596980efacd9f1a3858de3d5249bab258.zip
Merge branch 'BETA_JAVA_12' to master for 4.12 builds
Diffstat (limited to 'org.eclipse.jdt.compiler.apt')
-rw-r--r--org.eclipse.jdt.compiler.apt/src/org/eclipse/jdt/internal/compiler/apt/dispatch/RoundEnvImpl.java8
-rw-r--r--org.eclipse.jdt.compiler.apt/src/org/eclipse/jdt/internal/compiler/apt/model/ModuleElementImpl.java16
-rw-r--r--org.eclipse.jdt.compiler.apt/src/org/eclipse/jdt/internal/compiler/apt/util/JrtFileSystem.java8
3 files changed, 22 insertions, 10 deletions
diff --git a/org.eclipse.jdt.compiler.apt/src/org/eclipse/jdt/internal/compiler/apt/dispatch/RoundEnvImpl.java b/org.eclipse.jdt.compiler.apt/src/org/eclipse/jdt/internal/compiler/apt/dispatch/RoundEnvImpl.java
index 185dfd8f8a..d4aca24a4c 100644
--- a/org.eclipse.jdt.compiler.apt/src/org/eclipse/jdt/internal/compiler/apt/dispatch/RoundEnvImpl.java
+++ b/org.eclipse.jdt.compiler.apt/src/org/eclipse/jdt/internal/compiler/apt/dispatch/RoundEnvImpl.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2017 IBM Corporation and others.
+ * Copyright (c) 2005, 2019 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -34,6 +34,7 @@ import org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding;
import org.eclipse.jdt.internal.compiler.lookup.Binding;
import org.eclipse.jdt.internal.compiler.lookup.FieldBinding;
import org.eclipse.jdt.internal.compiler.lookup.MethodBinding;
+import org.eclipse.jdt.internal.compiler.lookup.ModuleBinding;
import org.eclipse.jdt.internal.compiler.lookup.ParameterizedTypeBinding;
import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding;
import org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding;
@@ -235,6 +236,11 @@ public class RoundEnvImpl implements RoundEnvironment
throw new IllegalArgumentException("Top-level type binding could not be converted to element: " + typeBinding); //$NON-NLS-1$
}
elements.add(element);
+ ModuleBinding binding = typeBinding.module();
+ if (binding != null) {
+ Element m = _factory.newElement(binding);
+ elements.add(m);
+ }
}
}
_rootElements = elements;
diff --git a/org.eclipse.jdt.compiler.apt/src/org/eclipse/jdt/internal/compiler/apt/model/ModuleElementImpl.java b/org.eclipse.jdt.compiler.apt/src/org/eclipse/jdt/internal/compiler/apt/model/ModuleElementImpl.java
index adda859990..86183925d5 100644
--- a/org.eclipse.jdt.compiler.apt/src/org/eclipse/jdt/internal/compiler/apt/model/ModuleElementImpl.java
+++ b/org.eclipse.jdt.compiler.apt/src/org/eclipse/jdt/internal/compiler/apt/model/ModuleElementImpl.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2018 IBM Corporation and others.
+ * Copyright (c) 2018, 2019 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*
@@ -90,8 +90,18 @@ public class ModuleElementImpl extends ElementImpl implements ModuleElement {
for (PackageBinding p : packs) {
if (p == null)
continue;
- if (!p.hasCompilationUnit(true))
+ if (p instanceof SplitPackageBinding) {
+ // select from incarnations the unique package containing CUs, if any:
+ for (PackageBinding incarnation : ((SplitPackageBinding) p).incarnations) {
+ if (incarnation.enclosingModule == module && incarnation.hasCompilationUnit(true)) {
+ unique.add(getModulesPackageBinding(p));
+ }
+ }
continue;
+ } else {
+ if (!p.hasCompilationUnit(true))
+ continue;
+ }
unique.add(getModulesPackageBinding(p));
}
if (module.isUnnamed()) {
diff --git a/org.eclipse.jdt.compiler.apt/src/org/eclipse/jdt/internal/compiler/apt/util/JrtFileSystem.java b/org.eclipse.jdt.compiler.apt/src/org/eclipse/jdt/internal/compiler/apt/util/JrtFileSystem.java
index b23b9f4192..a34fbbf62e 100644
--- a/org.eclipse.jdt.compiler.apt/src/org/eclipse/jdt/internal/compiler/apt/util/JrtFileSystem.java
+++ b/org.eclipse.jdt.compiler.apt/src/org/eclipse/jdt/internal/compiler/apt/util/JrtFileSystem.java
@@ -92,12 +92,8 @@ public class JrtFileSystem extends Archive {
}
@Override
- public FileVisitResult visitModule(Path mod) throws IOException {
- String name = mod.getFileName().toString();
- if (name.endsWith("/")) { //$NON-NLS-1$
- name = name.substring(0, name.length() - 1);
- }
- JrtFileSystem.this.modulePathMap.put(name, mod);
+ public FileVisitResult visitModule(Path path, String name) throws IOException {
+ JrtFileSystem.this.modulePathMap.put(name, path);
return FileVisitResult.CONTINUE;
}
}, JRTUtil.NOTIFY_MODULES);

Back to the top