Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Arthanareeswaran2019-03-08 05:17:15 -0500
committerJay Arthanareeswaran2019-03-08 05:17:15 -0500
commit9f9edbf4463ce6e93615d79dc51542b6adecb47a (patch)
treec47995337808329c19769bdde847ebd85f44a94e
parentb18b06a7905221757481afe8da611c6db4ce277b (diff)
parentc6d7ef991f723f8b37cf85f1d368979f6e5f0485 (diff)
downloadeclipse.jdt.core-9f9edbf4463ce6e93615d79dc51542b6adecb47a.tar.gz
eclipse.jdt.core-9f9edbf4463ce6e93615d79dc51542b6adecb47a.tar.xz
eclipse.jdt.core-9f9edbf4463ce6e93615d79dc51542b6adecb47a.zip
Merge remote-tracking branch 'origin/master' into BETA_JAVA_12Y20190308-0715
# Conflicts: # org.eclipse.jdt.compiler.apt/src/org/eclipse/jdt/internal/compiler/apt/util/JrtFileSystem.java # org.eclipse.jdt.compiler.tool/src/org/eclipse/jdt/internal/compiler/tool/JrtFileSystem.java # org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/util/JRTUtil.java # org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaProject.java # org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JrtPackageFragmentRoot.java # org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathJrtWithReleaseOption.java Change-Id: I284c23829a6de8131b7ca33af8f27bfc95ab4574
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest_1_8.java13
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CaptureBinding18.java23
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/IntersectionTypeBinding18.java21
-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.java3
5 files changed, 34 insertions, 29 deletions
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest_1_8.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest_1_8.java
index 1504327072..e2fe76ef0e 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest_1_8.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericsRegressionTest_1_8.java
@@ -9572,4 +9572,17 @@ public void testBug508834_comment0() {
"}\n"
});
}
+ public void testBug545121() {
+ runConformTest(
+ new String[] {
+ "X.java",
+ "public class X {\n" +
+ " <T extends V, U extends T, V> void foo(U arg1, T arg2, V arg3) {}\n" +
+ "\n" +
+ " void check() {\n" +
+ " foo((Long) 0l, 0d, \"\");\n" +
+ " }\n" +
+ "}\n"
+ });
+ }
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CaptureBinding18.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CaptureBinding18.java
index 2dc50f4c69..447df46720 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CaptureBinding18.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CaptureBinding18.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2013, 2014 GK Software AG.
+ * Copyright (c) 2013, 2019 GK Software AG.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -155,22 +155,15 @@ public class CaptureBinding18 extends CaptureBinding {
rightIntersectingTypes = ((IntersectionTypeBinding18) otherType).intersectingTypes;
}
if (rightIntersectingTypes != null) {
- int numRequired = rightIntersectingTypes.length;
- TypeBinding[] required = new TypeBinding[numRequired];
- System.arraycopy(rightIntersectingTypes, 0, required, 0, numRequired);
- for (int i = 0; i < length; i++) {
- TypeBinding provided = this.upperBounds[i];
- for (int j = 0; j < required.length; j++) {
- if (required[j] == null) continue;
- if (provided.isCompatibleWith(required[j], captureScope)) {
- required[j] = null;
- if (--numRequired == 0)
- return true;
- break;
- }
+ nextRequired:
+ for (TypeBinding required : rightIntersectingTypes) {
+ for (TypeBinding provided : this.upperBounds) {
+ if (provided.isCompatibleWith(required, captureScope))
+ continue nextRequired;
}
+ return false;
}
- return false;
+ return true;
}
for (int i = 0; i < length; i++) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/IntersectionTypeBinding18.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/IntersectionTypeBinding18.java
index 649ff04324..e30bbb5442 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/IntersectionTypeBinding18.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/IntersectionTypeBinding18.java
@@ -187,22 +187,15 @@ public class IntersectionTypeBinding18 extends ReferenceBinding {
rightIntersectingTypes = ((IntersectionTypeBinding18) right).intersectingTypes;
}
if (rightIntersectingTypes != null) {
- int numRequired = rightIntersectingTypes.length;
- TypeBinding[] required = new TypeBinding[numRequired];
- System.arraycopy(rightIntersectingTypes, 0, required, 0, numRequired);
- for (int i = 0; i < this.length; i++) {
- TypeBinding provided = this.intersectingTypes[i];
- for (int j = 0; j < required.length; j++) {
- if (required[j] == null) continue;
- if (provided.isCompatibleWith(required[j], scope)) {
- required[j] = null;
- if (--numRequired == 0)
- return true;
- break;
- }
+ nextRequired:
+ for (TypeBinding required : rightIntersectingTypes) {
+ for (TypeBinding provided : this.intersectingTypes) {
+ if (provided.isCompatibleWith(required, scope))
+ continue nextRequired;
}
+ return false;
}
- return false;
+ return true;
}
// normal case:
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 9576ce72fe..a3aaa8f21b 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
@@ -109,6 +109,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 9a388393ce..95f3523bf1 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
@@ -208,6 +208,9 @@ public class ClasspathJrtWithReleaseOption extends ClasspathJrt {
public FileVisitResult visitModule(Path path, String name) throws IOException {
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