Skip to content

Commit

Permalink
Eclipse 4.11 (RC2) JDT Patch for Groovy-Eclipse: JDT commit c6d7ef9
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-milles committed Mar 8, 2019
1 parent 1f478fa commit acad711
Show file tree
Hide file tree
Showing 11 changed files with 58 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</license>

<requires>
<import feature="org.eclipse.jdt" version="3.17.0.v20190301-0040" patch="true"/>
<import feature="org.eclipse.jdt" version="3.17.0.v20190307-0500" patch="true"/>
</requires>

<plugin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9572,4 +9572,17 @@ public void testBug536860() {
"}\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"
});
}
}
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -155,22 +155,15 @@ public boolean isCompatibleWith(TypeBinding otherType, Scope captureScope) {
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++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,22 +187,15 @@ public boolean isCompatibleWith(TypeBinding right, Scope scope) {
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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,9 @@ void initialize(File jdk, String rel) throws IOException {
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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -942,7 +942,11 @@ public FileVisitResult visitFile(java.nio.file.Path path, java.nio.file.Path mod

@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));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,11 @@ public FileVisitResult visitFile(Path path, Path mod, BasicFileAttributes attrs)

@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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ public FileVisitResult visitModule(Path mod) 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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,11 @@ private String getReleaseOptionFromCompliance(String comp) {
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);
}
Expand Down Expand Up @@ -155,6 +158,9 @@ protected void initialize() throws CoreException {
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 {
Expand Down Expand Up @@ -205,6 +211,9 @@ public FileVisitResult visitModule(Path mod) throws IOException {
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;
}
Expand Down
2 changes: 1 addition & 1 deletion jdt-patch/e411/org.eclipse.jdt.core/pom.bak
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2012, 2019 Eclipse Foundation and others.
Copyright (c) 2012, 2018 Eclipse Foundation and others.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Distribution License v1.0
which accompanies this distribution, and is available at
Expand Down
1 change: 1 addition & 0 deletions jdt-patch/e411/org.eclipse.jdt.core/readme.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
2019-01-11: 33638a6 (2019-03 M1)
2019-02-22: ea4f416 (2019-03 M3)
2019-03-01: 348aad6 (2019-03 RC1)
2019-03-08: c6d7ef9 (2019-03 RC2)

0 comments on commit acad711

Please sign in to comment.