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

java.lang.NumberFormatException: For input string: "11-ea" #1469

Closed
imriss opened this issue Feb 15, 2019 · 3 comments
Closed

java.lang.NumberFormatException: For input string: "11-ea" #1469

imriss opened this issue Feb 15, 2019 · 3 comments
Labels

Comments

@imriss
Copy link

imriss commented Feb 15, 2019

It seems that the fix for "9-Debian" Java version does not work for "11-ea" like string:

Caused by: java.lang.NumberFormatException: For input string: "11-ea"
    at java.lang.NumberFormatException.forInputString (NumberFormatException.java:65)
    at java.lang.Integer.parseInt (Integer.java:652)
    at java.lang.Integer.parseInt (Integer.java:770)
    at com.google.gson.util.VersionUtils.determineMajorJavaVersion (VersionUtils.java:28)
    at com.google.gson.util.VersionUtils.<clinit> (VersionUtils.java:24)
    at com.google.gson.internal.reflect.ReflectionAccessor.<clinit> (ReflectionAccessor.java:36)
    at com.google.gson.internal.ConstructorConstructor.<init> (ConstructorConstructor.java:51)
    at com.google.gson.Gson.<init> (Gson.java:205)
    at com.google.gson.Gson.<init> (Gson.java:185)
    at org.sonar.scanner.bootstrap.ScannerPluginInstaller.listInstalledPlugins (ScannerPluginInstaller.java:108)
    at org.sonar.scanner.bootstrap.ScannerPluginInstaller.loadPlugins (ScannerPluginInstaller.java:78)
    at org.sonar.scanner.bootstrap.ScannerPluginInstaller.installRemotes (ScannerPluginInstaller.java:62)
    at org.sonar.scanner.bootstrap.ScannerPluginRepository.start (ScannerPluginRepository.java:59

It seems to be called from here via Gson().fromJson:
https://github.com/SonarSource/sonarqube/blob/138171d657c57fe015c4dcc4be996973f87f5365/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/ScannerPluginInstaller.java#L103

Thanks

[1] - Fix for "9-Debian" Java version string: https://github.com/google/gson/pull/1311/files
[2] - Report of "9-Debian" Java version issue:

@JakeWharton
Copy link
Contributor

Ugh. We should just create a multi-release jar so that we can use Runtime.Version on 9+.

@cosenmarco
Copy link

Hi, is there any way to work around the issue until a patch is available ?

@cosenmarco
Copy link

Ok, Updating to 2.8.5 solved the issue for me.

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

No branches or pull requests

3 participants