Skip to content

Conversation

shred
Copy link
Contributor

@shred shred commented Apr 18, 2020

According to JEP223, Java versions do not include trailing zero
elements. This means that e.g. Java 14.0.0 reports its version just as
"14". The changed code part expected at least three characters, so it
failed to start on such "zero-zero" Java releases. The evaluated java
version was not used anywhere, so the code block was removed.

For example, my machine is running Java 14 (openjdk version "14" 2020-03-17). When I start the IDE, the following exception is reported and the IDE won't start:

java.lang.ExceptionInInitializerError
	at processing.app.helpers.PreferencesMap.load(PreferencesMap.java:100)
	at processing.app.helpers.PreferencesMap.load(PreferencesMap.java:74)
	at processing.app.PreferencesData.init(PreferencesData.java:53)
	at processing.app.BaseNoGui.initParameters(BaseNoGui.java:856)
	at processing.app.Base.<init>(Base.java:197)
	at processing.app.Base.main(Base.java:135)
Caused by: java.lang.StringIndexOutOfBoundsException: begin 0, end 3, length 2
	at java.base/java.lang.String.checkBoundsBeginEnd(String.java:3756)
	at java.base/java.lang.String.substring(String.java:1902)
	at processing.app.legacy.PApplet.<clinit>(PApplet.java:38)
	... 6 more

This patch fixes the problem.

According to JEP223, Java versions do not include trailing zero
elements. This means that e.g. Java 14.0.0 reports its version just as
"14". The changed code part expected at least three characters, so it
failed to start on such "zero-zero" Java releases. The evaluated java
version was not used anywhere, so the code block was removed.
@cmaglie cmaglie merged commit ca20093 into arduino:master Apr 21, 2020
@cmaglie cmaglie added this to the Release 1.8.13 milestone Apr 21, 2020
@cmaglie
Copy link
Member

cmaglie commented Apr 21, 2020

Thanks!

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

Successfully merging this pull request may close these issues.

2 participants