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 a28eb692cf..4756845883 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 @@ -3461,7 +3461,12 @@ public void testCompletion_Lambda() throws Exception { assertNotNull(lambda); assertTrue(lambda.getTextEdit().getLeft().getNewText().matches("\\$\\{1:\\w+\\} -> \\$\\{0\\}")); - assertEquals("(Object arg0) ->", lambda.getLabel()); + try { + assertEquals("(Object t) ->", lambda.getLabel()); + } catch (ComparisonFailure e) { + // In case the JDK has no sources + assertEquals("(Object arg0) ->", lambda.getLabel()); + } assertNull(lambda.getLabelDetails().getDetail()); assertEquals(lambda.getLabelDetails().getDescription(), "void"); }