Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Arthanareeswaran2019-02-27 10:22:11 +0000
committerJay Arthanareeswaran2019-03-04 04:29:00 +0000
commit3325ba8a5c8f5838e0a099c7cdf97d24854143fd (patch)
tree582f3b65c928d7b0a67aa82c966abcccc60eb799
parent348aad642ce79be7112961b7d8acaa520a45e279 (diff)
downloadeclipse.jdt.core-3325ba8a5c8f5838e0a099c7cdf97d24854143fd.tar.gz
eclipse.jdt.core-3325ba8a5c8f5838e0a099c7cdf97d24854143fd.tar.xz
eclipse.jdt.core-3325ba8a5c8f5838e0a099c7cdf97d24854143fd.zip
Change-Id: I72b85041530a75f7b3f277738e68e1c025e4ae96 Signed-off-by: Jay Arthanareeswaran <jarthana@in.ibm.com>
-rw-r--r--org.eclipse.jdt.compiler.apt/src/org/eclipse/jdt/internal/compiler/apt/util/JrtFileSystem.java6
-rw-r--r--org.eclipse.jdt.compiler.tool/src/org/eclipse/jdt/internal/compiler/tool/JrtFileSystem.java6
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/util/JRTUtil.java3
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaProject.java6
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JrtPackageFragmentRoot.java6
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathJrt.java3
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathJrtWithReleaseOption.java13
7 files changed, 37 insertions, 6 deletions
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 c54b616aec..b23b9f4192 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
@@ -93,7 +93,11 @@ public class JrtFileSystem extends Archive {
@Override
public FileVisitResult visitModule(Path mod) throws IOException {
- JrtFileSystem.this.modulePathMap.put(mod.getFileName().toString(), mod);
+ String name = mod.getFileName().toString();
+ if (name.endsWith("/")) { //$NON-NLS-1$
+ name = name.substring(0, name.length() - 1);
+ }
+ JrtFileSystem.this.modulePathMap.put(name, mod);
return FileVisitResult.CONTINUE;
}
}, JRTUtil.NOTIFY_MODULES);
diff --git a/org.eclipse.jdt.compiler.tool/src/org/eclipse/jdt/internal/compiler/tool/JrtFileSystem.java b/org.eclipse.jdt.compiler.tool/src/org/eclipse/jdt/internal/compiler/tool/JrtFileSystem.java
index 07cadc27fb..57e6bd9a82 100644
--- a/org.eclipse.jdt.compiler.tool/src/org/eclipse/jdt/internal/compiler/tool/JrtFileSystem.java
+++ b/org.eclipse.jdt.compiler.tool/src/org/eclipse/jdt/internal/compiler/tool/JrtFileSystem.java
@@ -93,7 +93,11 @@ public class JrtFileSystem extends Archive {
@Override
public FileVisitResult visitModule(Path mod) throws IOException {
- JrtFileSystem.this.modulePathMap.put(mod.getFileName().toString(), mod);
+ String name = mod.getFileName().toString();
+ if (name.endsWith("/")) { //$NON-NLS-1$
+ name = name.substring(0, name.length() - 1);
+ }
+ JrtFileSystem.this.modulePathMap.put(name, mod);
return FileVisitResult.CONTINUE;
}
}, JRTUtil.NOTIFY_MODULES);
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/util/JRTUtil.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/util/JRTUtil.java
index f6903f814f..51bfc33171 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/util/JRTUtil.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/util/JRTUtil.java
@@ -254,6 +254,9 @@ class JrtFileSystemWithOlderRelease extends JrtFileSystem {
try (DirectoryStream<java.nio.file.Path> stream = Files.newDirectoryStream(releasePath)) {
for (final java.nio.file.Path subdir: stream) {
String r = subdir.getFileName().toString();
+ if (r.endsWith("/")) { //$NON-NLS-1$
+ r = r.substring(0, r.length() - 1);
+ }
if (r.contains(this.releaseInHex)) {
sub.add(r);
} else {
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaProject.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaProject.java
index 301df83247..45cd6edb15 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaProject.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaProject.java
@@ -936,7 +936,11 @@ public class JavaProject
@Override
public FileVisitResult visitModule(java.nio.file.Path mod) throws IOException {
- JrtPackageFragmentRoot root = new JrtPackageFragmentRoot(imagePath, mod.toString(), JavaProject.this);
+ String name = mod.toString();
+ if (name.endsWith("/")) { //$NON-NLS-1$
+ name = name.substring(0, name.length() - 1);
+ }
+ JrtPackageFragmentRoot root = new JrtPackageFragmentRoot(imagePath, name, JavaProject.this);
roots.add(root);
if (rootToResolvedEntries != null)
rootToResolvedEntries.put(root, ((ClasspathEntry)resolvedEntry).combineWith((ClasspathEntry) referringEntry));
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JrtPackageFragmentRoot.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JrtPackageFragmentRoot.java
index cd3e8158c8..93c178155b 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JrtPackageFragmentRoot.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JrtPackageFragmentRoot.java
@@ -79,7 +79,11 @@ public class JrtPackageFragmentRoot extends JarPackageFragmentRoot implements IM
@Override
public FileVisitResult visitModule(Path mod) throws IOException {
- if (!JrtPackageFragmentRoot.this.moduleName.equals(mod.toString())) {
+ String name = mod.toString();
+ if (name.endsWith("/")) { //$NON-NLS-1$
+ name = name.substring(0, name.length() - 1);
+ }
+ if (!JrtPackageFragmentRoot.this.moduleName.equals(name)) {
return FileVisitResult.SKIP_SUBTREE;
}
return FileVisitResult.CONTINUE;
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathJrt.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathJrt.java
index 50cfd275f1..7f7a9f4398 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathJrt.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathJrt.java
@@ -106,6 +106,9 @@ static HashMap<String, SimpleSet> findPackagesInModules(final ClasspathJrt jrt)
}
this.packageSet = new SimpleSet(41);
this.packageSet.add(""); //$NON-NLS-1$
+ if (name.endsWith("/")) { //$NON-NLS-1$
+ name = name.substring(0, name.length() - 1);
+ }
packagesInModule.put(name, this.packageSet);
return FileVisitResult.CONTINUE;
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathJrtWithReleaseOption.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathJrtWithReleaseOption.java
index a5d8446c37..6207656dc3 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathJrtWithReleaseOption.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathJrtWithReleaseOption.java
@@ -92,8 +92,11 @@ public class ClasspathJrtWithReleaseOption extends ClasspathJrt {
private boolean isJRE12Plus(Path path) {
try (DirectoryStream<java.nio.file.Path> stream = Files.newDirectoryStream(path)) {
for (final java.nio.file.Path subdir : stream) {
- String rel = subdir.getFileName().toString();
- if (Files.exists(this.fs.getPath(rel, "system-modules"))) { //$NON-NLS-1$
+ if (Files.exists(subdir.resolve("system-modules"))) { //$NON-NLS-1$
+ String rel = subdir.getFileName().toString();
+ if (rel.endsWith("/")) { //$NON-NLS-1$
+ rel = rel.substring(0, rel.length() - 1);
+ }
int parseInt = Integer.parseInt(rel, 16);
return (parseInt > 11);
}
@@ -155,6 +158,9 @@ public class ClasspathJrtWithReleaseOption extends ClasspathJrt {
try (DirectoryStream<java.nio.file.Path> stream = Files.newDirectoryStream(releasePath)) {
for (final java.nio.file.Path subdir : stream) {
String rel = subdir.getFileName().toString();
+ if (rel.endsWith("/")) { //$NON-NLS-1$
+ rel = rel.substring(0, rel.length() - 1);
+ }
if (rel.contains(this.releaseInHex)) {
sub.add(rel);
} else {
@@ -205,6 +211,9 @@ public class ClasspathJrtWithReleaseOption extends ClasspathJrt {
String name = mod.getName(1).toString();
this.packageSet = new SimpleSet(41);
this.packageSet.add(""); //$NON-NLS-1$
+ if (name.endsWith("/")) { //$NON-NLS-1$
+ name = name.substring(0, name.length() - 1);
+ }
packagesInModule.put(name, this.packageSet);
return FileVisitResult.CONTINUE;
}

Back to the top