eclipse-jdt / eclipse.jdt.ui

Eclipse Public License 2.0
36 stars 86 forks source link

add java version and java spec version to system property cleanup #1591

Closed carstenartur closed 4 days ago

carstenartur commented 3 weeks ago

What it does

It adds to cases to the cleanup. 1) System.getProperty("java.runtime.version") This is replaced by Runtime.version().toString()

2) System.getProperty("java.specification.version") This is replaced by Runtime.version().feature()

Other properties like System.getProperty("java.class.version") that could be replaced with java.lang.reflect.ClassFileFormatVersion.latest().major() seem to be such a corner case that it might not worth it.

How to test

Run the cleanup on code that contains System.getProperty() calls like mentioned above. It should replace it.

Author checklist

jjohnstn commented 4 days ago

Thanks @carstenartur