-
Notifications
You must be signed in to change notification settings - Fork 134
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 of older Java releases in ecj #2536
Comments
@iloveeclipse - How about we take an approach something similar to deprecation in apis.- in a staggered manner - instead of throwing an error in 4.33, we issue a warning in 4.33 and then an error in 4.34? |
The reason to start this initiative was reducing the effort for maintenance & focus on quality of new Java features. |
Basically moves tests that used various old 1.x JDK compiler settings to use 1.8 target (only supported 1.x Java compiler target in the future). See eclipse-jdt/eclipse.jdt.core#2536
Are there issues in jdt.ui and jdt.debug that may be required for this? I don't yet know what we require to do there, but for starter, we will need to remove the compliance from the UI. Might be a good idea to start the discussions around the UI too. |
Basically moves tests that used various old 1.x JDK compiler settings to use 1.8 target (only supported 1.x Java compiler target in the future). See eclipse-jdt/eclipse.jdt.core#2536
Code wise not yet (as I didn't removed JavaCore constants for old Java versions), but I guess there will be some.
This is for sure pending, we will need to change the "target" properties/preference pages in JDT UI and also "available execution environments" for PDE/Debug UI. I will check that but of course would be nice if someone else could take it over while I'm looking into JDT test fixes. I've just pushed eclipse-pde/eclipse.pde#1309 for PDE tests that moves their compilation level from 1.4/1.5 to 1.8. (most of the PDE tests were written at IBM times with Java 1.5 considered "modern" environment :-) ) Regarding JDT tests: as we can see, fails are now down to ~800 from initial ~2.500. I intentionally do not disable tests yet to see how far we can go preserving tests also written for old targets because many of them aren't JLS target specific. |
Sorry, I didn't mean to check if you were going to work on it. I am sure (and hope) we have enough committers in UI to take care of that. I raised eclipse-jdt/eclipse.jdt.ui#1465 to track that. |
Basically moves tests that used various old 1.x JDK compiler settings to use 1.8 target (only supported 1.x Java compiler target in the future). See eclipse-jdt/eclipse.jdt.core#2536
Basically moves tests that used various old 1.x JDK compiler settings to use 1.8 target (only supported 1.x Java compiler target in the future). See eclipse-jdt/eclipse.jdt.core#2536
I've created another ticket for debugger, as most of configuration pages are provided by debugger: eclipse-jdt/eclipse.jdt.debug#451 |
Basically moves tests that used various old 1.x JDK compiler settings to use 1.8 target (only supported 1.x Java compiler target in the future). See eclipse-jdt/eclipse.jdt.core#2536
- AddImportTest - BindingsNameTest - JavaElementPropertyTesterTest - OverrideTest - GenerateHashCodeEqualsTest - AdvancedQuickAssistTest - AdvancedQuickAssistTest1d7 - AssistQuickFixTest1d8 - CleanUpStressTest - CleanUpTest1d5 - CleanUpTest1d6 - JavadocQuickFixTest - ModifierCorrectionsQuickFixTest1d7 - QuickFixEnablementTest - TypeParameterMismatchTest - InlineConstantTests - InlineTempTests1d7 Muted test failure in InlineTempTests.test31() and created https://github.com/eclipse-jdt/eclipse.jdt.ui/issues/1552 for that, it is is a bug in current implementation. See eclipse-jdt/eclipse.jdt.core#2536
- AddImportTest - BindingsNameTest - JavaElementPropertyTesterTest - OverrideTest - GenerateHashCodeEqualsTest - AdvancedQuickAssistTest - AdvancedQuickAssistTest1d7 - AssistQuickFixTest1d8 - CleanUpStressTest - CleanUpTest1d5 - CleanUpTest1d6 - JavadocQuickFixTest - ModifierCorrectionsQuickFixTest1d7 - QuickFixEnablementTest - TypeParameterMismatchTest - InlineConstantTests - InlineTempTests1d7 Muted test failure in InlineTempTests.test31() and created https://github.com/eclipse-jdt/eclipse.jdt.ui/issues/1552 for that, it is is a bug in current implementation. See eclipse-jdt/eclipse.jdt.core#2536
Follow up from eclipse-jdt/eclipse.jdt.core#2536. After switching to minimal 1.8 project compliance in JDT, test `PluginsNotLoadedTest.pluginsNotLoaded` fails complaining about loaded org.eclipse.jdt.junit bundle. See https://download.eclipse.org/eclipse/downloads/drops4/I20240725-1800/testresults/html/org.eclipse.jdt.text.tests_ep433I-unit-cen64-gtk3-java22_linux.gtk.x86_64_22.html Interestingly, it doesn't fail on both Mac platforms, but see below. While debugging (break point at `org.eclipse.jdt.internal.junit.ui.JUnitPlugin.start(BundleContext)`) one can see that the class is loaded at `org.eclipse.jdt.text.tests.MarkOccurrenceTest.markMethodOccurrences()` test, which, surprisingly ... opens Java editor on `junit.framework.TestCase` class and that one tries to draw warning marker annotations that in turn activate warning marker quick fix processor `org.eclipse.jdt.internal.junit.ui.JUnitQuickFixProcessor` that triggers JUnit loading. Not clear why this doesn't work on Mac, probably drawing there is a bit different and so no JUnit bundle is loaded. To solve that, let run PluginsNotLoadedTest as first test in the test suite (not sure why it wasn't done before). Also while debugging the test I saw that the JUnit bundle is not loaded if the welcome page was open, which was hiding opened Java editor and that in turn didn't activated all of Java editor functionality. So let close welcome page, which should have been done anyway for any UI test.
Follow up from eclipse-jdt/eclipse.jdt.core#2536. After switching to minimal 1.8 project compliance in JDT, test `PluginsNotLoadedTest.pluginsNotLoaded` fails complaining about loaded org.eclipse.jdt.junit bundle. See https://download.eclipse.org/eclipse/downloads/drops4/I20240725-1800/testresults/html/org.eclipse.jdt.text.tests_ep433I-unit-cen64-gtk3-java22_linux.gtk.x86_64_22.html Interestingly, it doesn't fail on both Mac platforms, but see below. While debugging (break point at `org.eclipse.jdt.internal.junit.ui.JUnitPlugin.start(BundleContext)`) one can see that the class is loaded at `org.eclipse.jdt.text.tests.MarkOccurrenceTest.markMethodOccurrences()` test, which, surprisingly ... opens Java editor on `junit.framework.TestCase` class and that one tries to draw warning marker annotations that in turn activate warning marker quick fix processor `org.eclipse.jdt.internal.junit.ui.JUnitQuickFixProcessor` that triggers JUnit loading. Not clear why this doesn't work on Mac, probably drawing there is a bit different and so no JUnit bundle is loaded. To solve that, let run PluginsNotLoadedTest as first test in the test suite (not sure why it wasn't done before). Also while debugging the test I saw that the JUnit bundle is not loaded if the welcome page was open, which was hiding opened Java editor and that in turn didn't activated all of Java editor functionality. So let close welcome page, which should have been done anyway for any UI test.
Basically moves tests that used various old 1.x JDK compiler settings to use 1.8 target (only supported 1.x Java compiler target in the future). See eclipse-jdt/eclipse.jdt.core#2536
Sorry to raise a concern late for this issue. Dropping support for older Java versions in ECJ is fine when it is used as a standalone compiler. However, this may cause confusion when ECJ is integrated into IDEs such as Eclipse. Since Eclipse integrates the latest ECJ by default, it is not possible to specify an older ECJ version with the latest JDT. As a result, newer versions of Eclipse will no longer support Java 1.7 and lower, potentially confusing users working on legacy projects. |
Not sure where confusion is coming from, as ecj is a part of JDT core / IDE, it was clear that dropping legacy Java versions support in ecj means exact same for the IDE.
|
Both options are still present in compiler/core code, but shouldn't be set to any other value as "error". For now we will ignore any provided values and use "error" by default. See eclipse-jdt#2536
Both options are still present in compiler/core code, but shouldn't be set to any other value as "error". For now we will ignore any provided values and use "error" by default. See #2536
Added an entry for JDT, mentioning the removal of source, target and release Java 7 and below. See the respective JDT issue: eclipse-jdt/eclipse.jdt.core#2536
Added an entry for JDT, mentioning the removal of source, target and release Java 7 and below. See the respective JDT issue: eclipse-jdt/eclipse.jdt.core#2536 Signed-off-by: Simeon Andreev <[email protected]>
Added an entry for JDT, mentioning the removal of source, target and release Java 7 and below. See the respective JDT issue: eclipse-jdt/eclipse.jdt.core#2536 Signed-off-by: Simeon Andreev <[email protected]>
Added an entry for JDT, mentioning the removal of source, target and release Java 7 and below. See the respective JDT issue: eclipse-jdt/eclipse.jdt.core#2536 Signed-off-by: Simeon Andreev <[email protected]>
Added an entry for JDT, mentioning the removal of source, target and release Java 7 and below. See the respective JDT issue: eclipse-jdt/eclipse.jdt.core#2536 Signed-off-by: Simeon Andreev <[email protected]>
- `List<String> getAllJavaSourceVersionsSupportedByCompiler()` - all Java versions that could be used for Java projects inside Eclipse. The difference to existing `getAllVersions()` API is that later one knows almost all Java versions ever released and might be used not only in JDT core but also in debugger/PDE area. - `boolean isJavaSourceVersionSupportedByCompiler(String version)` - differs from existing `isSupportedJavaVersion()` in the same way as explained above - `String getFirstJavaSourceVersionSupportedByCompiler()` - similar to existing `latestSupportedJavaVersion()` and should return minimal "default" version supported by JDT. API above will be used in JDT UI, Debug (PR's are following), and (most likely) PDE. **Internal** API added in batch compiler `CompilerOptions`: - `getFirstSupportedJavaVersion()` - `getFirstSupportedJdkLevel()` See eclipse-jdt#2536
Added one suite to rule all: RunAllJdtModelTestsTracing, to avoid (random) pattern-matching based test execution order in maven build. Additionally run all tests with TracingSuite (will log every test executed & create dumps if test hangs). See eclipse-jdt#2536
The main goal is to be more verbose on any unexpected error, do not hide them, have clean and consistent environment between testsuites executions and between local/Jenkins executions. Many testsuites are written in a different style and do some assertions related to the way how testsuite shares common setup data between different tests extending the testsuite. Unfortunately the logic is complicated to understand and so many testsuites leave environment in a different state as before (e.g. leraking created projects, settings like classpath variables etc). As a short term solution CleanupAfterSuiteTests can be added after such "messy" test suites to cleanup environment for the following testsuites. Extracted / added common code for cleanup: - org.eclipse.jdt.core.tests.util.Util.cleanupWorkspace(String) - org.eclipse.jdt.core.tests.util.Util.cleanupClassPathVariablesAndContainers() Added resource settings in bug.test.b534624 for ModuleBuilderTests.testBug534624a, otherwise the test fails with unrelated warning about missing encoding. Changes setup of CompletionTests, CompletionTests2 and parent class to avoid errors that happen if both testsuites run together. See eclipse-jdt#2536
The jar path was defined as classpath variable but was never provided. In order to have a clean environment state with all variables properly defined (and so allow automatic checks for the invalid variables), added jclFull1.8src.zip as a copy of jclMin1.8src.zip. Note: it was not possible to find out how jclFull1.8src was originally constructed, so here we simply copy jclMin1.8src. See eclipse-jdt#2536
This variable is defined as "src" and seem to be not always available See eclipse-jdt#2536
That was missing in eclipse-jdt#2710 See eclipse-jdt#2536
Discussed in #820
Originally posted by iloveeclipse March 9, 2023
Stephan asked good question, I'm not sure we've discussed that before.
The question is:
and my take on this is: if we can make our life easier, we should follow what javac does, and it does what was proposed in JEP-182: with each Java LTS release they seem to drop support for one of previous releases.
See
Current state in Java 17 (still same in 19):
for Java 21 we have
The proposal is for 4.33 to drop support for all Java releases older Java 8.
I plan to start working on this next week.
The text was updated successfully, but these errors were encountered: