lsp4j icon indicating copy to clipboard operation
lsp4j copied to clipboard

Test and build errors on Java 11

Open jonahgraham opened this issue 5 years ago • 6 comments

Running LSP4J's build with Java 11 has numerous warnings and errors, such as:

  • warning - invalid usage of tag > and similar in many javadocs
  • TracingMessageConsumerTest has many test failures

jonahgraham avatar Oct 26 '20 20:10 jonahgraham

The tests are failing with this diff (note PM vs pm)

org.junit.ComparisonFailure: expected:<[Trace - 06:07:30 [PM]] Sending response '...> but was:<[Trace - 06:07:30 [pm]] Sending response '...>
	at org.junit.Assert.assertEquals(Assert.java:115)
	at org.junit.Assert.assertEquals(Assert.java:144)
	at org.eclipse.lsp4j.jsonrpc.test.TracingMessageConsumerTest.testSendingResponse(TracingMessageConsumerTest.java:207)

jonahgraham avatar Oct 26 '20 20:10 jonahgraham

The tests are failing with this diff (note PM vs pm)

org.junit.ComparisonFailure: expected:<[Trace - 06:07:30 [PM]] Sending response '...> but was:<[Trace - 06:07:30 [pm]] Sending response '...>
	at org.junit.Assert.assertEquals(Assert.java:115)
	at org.junit.Assert.assertEquals(Assert.java:144)
	at org.eclipse.lsp4j.jsonrpc.test.TracingMessageConsumerTest.testSendingResponse(TracingMessageConsumerTest.java:207)

The problem here is the date time formatter was using default locale. Not sure why the calculation and resulting output is different between Java 8 and 11. I have fixed this with https://github.com/eclipse/lsp4j/pull/460/commits/b5a2b94de7692792bcb743d43417276c60ba0547 which adds a new constructor that takes the locale and the tests pass in the US locale so we can do string comparisons.

jonahgraham avatar Oct 26 '20 21:10 jonahgraham

  • warning - invalid usage of tag > and similar in many javadocs

I fixed a bunch of the Java11 javadoc issues in https://github.com/eclipse/lsp4j/pull/460/commits/820be5691654d032d824725f4330435204a93e19 - but some of the links were problematic. In particular I couldn't get this link to work in Java 8 and 11 at the same time. The current code renders properly in Java 8: https://github.com/eclipse/lsp4j/blob/c0b921895b4576feeb355eea7a053a0d56daba7b/org.eclipse.lsp4j/src/main/java/org/eclipse/lsp4j/util/SemanticHighlightingTokens.java#L134

jonahgraham avatar Oct 26 '20 21:10 jonahgraham

Are there any issues left or this can be closed?

apupier avatar Oct 15 '21 13:10 apupier

I can't remember - need to try using Java 11 and see if it complains. I can see that SemanticHighlightingTokens no longer exists, so that may have solved the problem.

jonahgraham avatar Oct 15 '21 13:10 jonahgraham

i dont see any compile and test errors with 11.

cdietrich avatar Oct 15 '21 17:10 cdietrich