Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update m2e to 1.14 #1238

Merged
merged 1 commit into from
Nov 4, 2019
Merged

Update m2e to 1.14 #1238

merged 1 commit into from
Nov 4, 2019

Conversation

fbricon
Copy link
Contributor

@fbricon fbricon commented Oct 29, 2019

This brings in Maven 3.6.2, which might help with redhat-developer/vscode-java#1103

@fbricon
Copy link
Contributor Author

fbricon commented Oct 29, 2019

test this please

1 similar comment
@snjeza
Copy link
Contributor

snjeza commented Oct 30, 2019

test this please

@snjeza
Copy link
Contributor

snjeza commented Oct 30, 2019

The following patch fixes failing tests:

diff --git a/org.eclipse.jdt.ls.tests/src/org/eclipse/jdt/ls/core/internal/handlers/CompletionHandlerTest.java b/org.eclipse.jdt.ls.tests/src/org/eclipse/jdt/ls/core/internal/handlers/CompletionHandlerTest.java
index abcc42d5..5bb885cb 100644
--- a/org.eclipse.jdt.ls.tests/src/org/eclipse/jdt/ls/core/internal/handlers/CompletionHandlerTest.java
+++ b/org.eclipse.jdt.ls.tests/src/org/eclipse/jdt/ls/core/internal/handlers/CompletionHandlerTest.java
@@ -579,7 +579,10 @@ public class CompletionHandlerTest extends AbstractCompilationUnitBasedTest {
 		assertNotNull(ci);
 
 		assertEquals("put", ci.getInsertText());
-		assertEquals("java.util.HashMap.put(String key, String value) : String", ci.getDetail());
+		if (!"java.util.HashMap.put(String key, String value) : String".equals(ci.getDetail())) {
+			// In case the JDK has no sources
+			assertTrue(ci.getDetail().matches("java.util.HashMap.put\\(String \\w+, String \\w+\\) : String"));
+		}
 		assertEquals(CompletionItemKind.Method, ci.getKind());
 		assertEquals("999999019", ci.getSortText());
 		assertNull(ci.getTextEdit());
diff --git a/org.eclipse.jdt.ls.tests/src/org/eclipse/jdt/ls/core/internal/handlers/WorkspaceDiagnosticsHandlerTest.java b/org.eclipse.jdt.ls.tests/src/org/eclipse/jdt/ls/core/internal/handlers/WorkspaceDiagnosticsHandlerTest.java
index 5824efc3..ba2fdced 100644
--- a/org.eclipse.jdt.ls.tests/src/org/eclipse/jdt/ls/core/internal/handlers/WorkspaceDiagnosticsHandlerTest.java
+++ b/org.eclipse.jdt.ls.tests/src/org/eclipse/jdt/ls/core/internal/handlers/WorkspaceDiagnosticsHandlerTest.java
@@ -35,7 +35,6 @@ import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.jdt.ls.core.internal.JavaClientConnection;
 import org.eclipse.jdt.ls.core.internal.ResourceUtils;
 import org.eclipse.jdt.ls.core.internal.managers.AbstractProjectsManagerBasedTest;
-import org.eclipse.jdt.ls.core.internal.preferences.ClientPreferences;
 import org.eclipse.jdt.ls.tests.Unstable;
 import org.eclipse.jface.text.IDocument;
 import org.eclipse.lsp4j.Diagnostic;
@@ -196,10 +195,6 @@ public class WorkspaceDiagnosticsHandlerTest extends AbstractProjectsManagerBase
 		List<PublishDiagnosticsParams> allCalls = captor.getAllValues();
 		Collections.reverse(allCalls);
 		projectsManager.setConnection(client);
-
-		Optional<PublishDiagnosticsParams> fooDiags = allCalls.stream().filter(p -> p.getUri().endsWith("Foo.java")).findFirst();
-		assertTrue("No Foo.java errors were found", fooDiags.isPresent());
-		List<Diagnostic> diags = fooDiags.get().getDiagnostics();
 		Comparator<Diagnostic> comparator = (Diagnostic d1, Diagnostic d2) -> {
 			int diff = d1.getRange().getStart().getLine() - d2.getRange().getStart().getLine();
 			if (diff == 0) {
@@ -207,14 +202,9 @@ public class WorkspaceDiagnosticsHandlerTest extends AbstractProjectsManagerBase
 			}
 			return diff;
 		};
-		Collections.sort(diags, comparator );
-		assertEquals(diags.toString(), 2, diags.size());
-		assertEquals("The import org cannot be resolved", diags.get(0).getMessage());
-		assertEquals("StringUtils cannot be resolved", diags.get(1).getMessage());
-
 		Optional<PublishDiagnosticsParams> pomDiags = allCalls.stream().filter(p -> p.getUri().endsWith("pom.xml")).findFirst();
 		assertTrue("No pom.xml errors were found", pomDiags.isPresent());
-		diags = pomDiags.get().getDiagnostics();
+		List<Diagnostic> diags = pomDiags.get().getDiagnostics();
 		Collections.sort(diags, comparator);
 		assertEquals(diags.toString(), 1, diags.size());
 		assertEquals("Project build error: 'dependencies.dependency.version' for org.apache.commons:commons-lang3:jar is missing.", diags.get(0).getMessage());

@fbricon
Copy link
Contributor Author

fbricon commented Oct 30, 2019

I'm fine with the missing source fi, but the missing diagnostics reveal a serious regression: if dependencies are missing then the java configuration of the project is incomplete

@snjeza
Copy link
Contributor

snjeza commented Oct 30, 2019

m2e 1,13 returns the following:

m2e113

m2e1.14;

m2e114

@fbricon
Copy link
Contributor Author

fbricon commented Oct 31, 2019

test this please

2 similar comments
@fbricon
Copy link
Contributor Author

fbricon commented Nov 4, 2019

test this please

@fbricon
Copy link
Contributor Author

fbricon commented Nov 4, 2019

test this please

Signed-off-by: Fred Bricon <fbricon@gmail.com>
@fbricon fbricon merged commit 1dfdeea into eclipse-jdtls:master Nov 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants