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

Drop support for older Java versions #1465

Closed
jarthana opened this issue Jun 18, 2024 · 9 comments
Closed

Drop support for older Java versions #1465

jarthana opened this issue Jun 18, 2024 · 9 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@jarthana
Copy link
Member

We should follow-up the jdt.core issue eclipse-jdt/eclipse.jdt.core#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
Copy link
Member

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

@noopur2507
Copy link
Member

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:

  • Disallow identifiers called 'assert' - When enabled, the compiler will issue an error or a warning whenever 'assert' is used as an identifier (reserved keyword in J2SE 1.4).
  • Disallow identifiers called 'enum' - When enabled, the compiler will issue an error or a warning whenever 'enum' is used as an identifier (reserved keyword in J2SE 1.5).

Please comment if there is any objection to removing these.

@noopur2507
Copy link
Member

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
Copy link
Member

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

@noopur2507
Copy link
Member

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
Copy link
Member

@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 added a commit to iloveeclipse/eclipse.jdt.ui that referenced this issue Jun 19, 2024
- Don't propose compilation targets below 1.8 JLS
- don't show old EE's in wizards

Requires eclipse-jdt/eclipse.jdt.debug#452
Requires eclipse-jdt/eclipse.jdt.core#2606
See eclipse-jdt#1465
iloveeclipse added a commit to iloveeclipse/eclipse.jdt.ui that referenced this issue Jun 19, 2024
- Don't propose compilation targets below 1.8 JLS
- don't show old EE's in wizards

Requires eclipse-jdt/eclipse.jdt.debug#452
Requires eclipse-jdt/eclipse.jdt.core#2606
See eclipse-jdt#1465
@iloveeclipse
Copy link
Member

@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.

@noopur2507
Copy link
Member

@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 added a commit to iloveeclipse/eclipse.jdt.ui that referenced this issue Jun 26, 2024
- Don't propose compilation targets below 1.8 JLS
- don't show old EE's in wizards

Requires eclipse-jdt/eclipse.jdt.debug#452
Requires eclipse-jdt/eclipse.jdt.core#2606
See eclipse-jdt#1465
iloveeclipse added a commit to iloveeclipse/eclipse.jdt.ui that referenced this issue Jun 27, 2024
- Don't propose compilation targets below 1.8 JLS
- don't show old EE's in wizards

Requires eclipse-jdt/eclipse.jdt.debug#452
Requires eclipse-jdt/eclipse.jdt.core#2606
See eclipse-jdt#1465
iloveeclipse added a commit that referenced this issue Jun 27, 2024
- Don't propose compilation targets below 1.8 JLS
- don't show old EE's in wizards

Requires eclipse-jdt/eclipse.jdt.debug#452
Requires eclipse-jdt/eclipse.jdt.core#2606
See #1465
iloveeclipse added a commit to iloveeclipse/eclipse.jdt.ui that referenced this issue Aug 7, 2024
- Inline finally blocks (larger class files, but improved performance)
(JavaCore.COMPILER_CODEGEN_INLINE_JSR_BYTECODE)
- Disallow identifiers called 'assert'
(JavaCore.COMPILER_PB_ASSERT_IDENTIFIER)
- Disallow identifiers called 'enum'
(JavaCore.COMPILER_PB_ENUM_IDENTIFIER)

See eclipse-jdt#1465
iloveeclipse added a commit that referenced this issue Aug 7, 2024
- Inline finally blocks (larger class files, but improved performance)
(JavaCore.COMPILER_CODEGEN_INLINE_JSR_BYTECODE)
- Disallow identifiers called 'assert'
(JavaCore.COMPILER_PB_ASSERT_IDENTIFIER)
- Disallow identifiers called 'enum'
(JavaCore.COMPILER_PB_ENUM_IDENTIFIER)

See #1465
iloveeclipse added a commit to iloveeclipse/eclipse.jdt.ui that referenced this issue Aug 7, 2024
After we dropped support of Java < 1.8 compliance level, we still have
to deal with projects that have these setting stored in preferences.

- Make sure we don't allow use unsupported compliance from JRE < 1.8
- Make sure we update value of compliance/source and target to first
supported version

See eclipse-jdt#1465
iloveeclipse added a commit that referenced this issue Aug 7, 2024
After we dropped support of Java < 1.8 compliance level, we still have
to deal with projects that have these setting stored in preferences.

- Make sure we don't allow use unsupported compliance from JRE < 1.8
- Make sure we update value of compliance/source and target to first
supported version

See #1465
@iloveeclipse iloveeclipse self-assigned this Aug 8, 2024
@iloveeclipse iloveeclipse added the enhancement New feature or request label Aug 8, 2024
@iloveeclipse iloveeclipse added this to the 4.33 M3 milestone Aug 8, 2024
@iloveeclipse
Copy link
Member

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 #1571 and #1572.

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

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

No branches or pull requests

3 participants