eclipse-jdt / eclipse.jdt.ui

Eclipse Public License 2.0
36 stars 87 forks source link

Drop support for older Java versions #1465

Closed jarthana closed 1 month ago

jarthana commented 3 months ago

We should follow-up the jdt.core issue https://github.com/eclipse-jdt/eclipse.jdt.core/issues/2536 with support in the UI as well. This issue is to discuss and track the corresponding UI changes. To start with, we should remove the older versions of JEs and compliance levels from the UI.

The other issue that is kind of related but might be worth taking up is the ordering of the compliance levels. As we focus more on support for more recent Java versions, it doesn't make sense to stick to the older-versions-first approach on the UI drop down list. Perhaps, we should revert the order to reflect the trend in usage.

noopur2507 commented 3 months ago

The compliance levels are added by JDT UI in the Java Compiler preferences. This issue will remove the compliance levels < 1.8.

noopur2507 commented 3 months ago

These two settings on the Java Compiler preferences page can also be removed with this change as these are enabled only when the source compatibility level is less than 1.4 or 1.5 respectively:

Please comment if there is any objection to removing these.

noopur2507 commented 3 months ago

The option under "Classfile Generation" to "Inline finally blocks" can also be removed as the API doc for JavaCore.COMPILER_CODEGEN_INLINE_JSR_BYTECODE says "Note that JSR inlining is optional only for target platform lesser than 1.5. From 1.5 on, the JSR inlining is mandatory."

iloveeclipse commented 3 months ago

@noopur2507 : I have a patch, will push in few minutes.

noopur2507 commented 3 months ago

The compliance levels are added by JDT UI in the Java Compiler preferences. This issue will remove the compliance levels < 1.8.

The above PR removes the compliance levels < 1.8 from the preferences.

The other 3 options mentioned above will be removed in a separate PR if there is no objection.

noopur2507 commented 3 months ago

@noopur2507 : I have a patch, will push in few minutes.

Please check if it provides the same changes. Feel free to merge/discard the above.

iloveeclipse commented 3 months ago

@noopur2507 : please check https://github.com/eclipse-jdt/eclipse.jdt.ui/pull/1469, it does a bit more in JDT UI but requires

Could you please review my version of ComplianceConfigurationBlock.java. I've tried to do only needed changes, but later code could be cleaned up more.

noopur2507 commented 3 months ago

@noopur2507 : please check #1469, it does a bit more in JDT UI but requires Could you please review my version of ComplianceConfigurationBlock.java. I've tried to do only needed changes, but later code could be cleaned up more.

I had a quick look at the changes and the approach via new API looks fine.

iloveeclipse commented 1 month ago

I've updated the code accordingly (versions are filtered and sorted with highest on top now), I've removed obsoleted compiler options from UI, and made some logic changes to deal with unsupported versions, see screenshots at https://github.com/eclipse-jdt/eclipse.jdt.ui/pull/1571 and https://github.com/eclipse-jdt/eclipse.jdt.ui/pull/1572.

If there is anything else to do, I would propose to create new dedicated tickets, closing this now.