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

Add extra options when launching Java langserver if JDK's version > 8 #36100

Merged
merged 3 commits into from
May 7, 2019

Conversation

Poytr1
Copy link
Contributor

@Poytr1 Poytr1 commented May 6, 2019

@elasticmachine
Copy link
Contributor

💔 Build Failed

if (javaVersion == 8) {
this.needExtraOptions = false;
}
if (javaVersion >= 8) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you mean <= 8, we do false, and > 8 we do true?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

then shouldn't we do?

if (javaVersion <= 8) {
        this.needModuleArguments = false;
      }
if (javaVersion > 8) {
``
?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe the semantic here is not very clear. If java version < 8, we use the bundled JDK(whose version >8), so we need extra arguments by default. When system jdk's version >= 8, we use the system JDK, while only for jdk's version = 8, we needn't extra arguments.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, maybe use <= instead of ==, although it cover more case that not existed, yet it's easier to understand.

or you could put those comments there so people don't get confuse

@@ -19,6 +19,7 @@ import { RequestExpander } from './request_expander';

export class JavaLauncher implements ILanguageServerLauncher {
private isRunning: boolean = false;
private needExtraOptions: boolean = true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe rename to needModuleArguments

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

if (javaVersion == 8) {
this.needExtraOptions = false;
}
if (javaVersion >= 8) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

then shouldn't we do?

if (javaVersion <= 8) {
        this.needModuleArguments = false;
      }
if (javaVersion > 8) {
``
?

@elasticmachine
Copy link
Contributor

💔 Build Failed

@Poytr1 Poytr1 merged commit 7711b65 into elastic:master May 7, 2019
@elasticmachine
Copy link
Contributor

💔 Build Failed

@spalger
Copy link
Contributor

spalger commented May 7, 2019

Reverted in 7a4a884

Please don't merge PRs with failing builds

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.

4 participants