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

Test and build errors on Java 11 #459

Open
jonahgraham opened this issue Oct 26, 2020 · 6 comments
Open

Test and build errors on Java 11 #459

jonahgraham opened this issue Oct 26, 2020 · 6 comments

Comments

@jonahgraham
Copy link
Contributor

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
Copy link
Contributor Author

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
Copy link
Contributor Author

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 b5a2b94 which adds a new constructor that takes the locale and the tests pass in the US locale so we can do string comparisons.

@jonahgraham
Copy link
Contributor Author

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

I fixed a bunch of the Java11 javadoc issues in 820be56 - 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 added a commit that referenced this issue Oct 27, 2020
jonahgraham added a commit that referenced this issue Nov 3, 2020
vladdu pushed a commit to vladdu/lsp4j that referenced this issue Jan 26, 2021
vladdu pushed a commit to vladdu/lsp4j that referenced this issue Jan 26, 2021
@apupier
Copy link
Contributor

apupier commented Oct 15, 2021

Are there any issues left or this can be closed?

@jonahgraham
Copy link
Contributor Author

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.

@cdietrich
Copy link
Contributor

i dont see any compile and test errors with 11.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants