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

jclMin22.jar contains classes compiled against Java 21 #2580

Closed
Tracked by #2761
iloveeclipse opened this issue Jun 17, 2024 · 11 comments · Fixed by #2912
Closed
Tracked by #2761

jclMin22.jar contains classes compiled against Java 21 #2580

iloveeclipse opened this issue Jun 17, 2024 · 11 comments · Fixed by #2912
Assignees
Labels
bug Something isn't working
Milestone

Comments

@iloveeclipse
Copy link
Member

iloveeclipse commented Jun 17, 2024

Found while fixing tests in #2551.

jclMin22.jar contains classes compiled against Java 21. The expectation is that every such jar contains classes built for exact that Java API version it supposed to represent, so compiler tests can see / assert matching class file version if looking on classes from jclMin.jar's. Beside this, jclMin22.jar contains .classpath file that refers to JavaSE-14 which also looks wrong.

I see that there was an attempt made to provide some systematic approach for jclMin* & converterJclMin* jars (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=560658 and d925ea3), however I do not see any trace of actual automation for jclMin jars, nor I see any explanation what is expected content of those jars and what is the difference between jclMin and converterJclMin jars.

I would be very grateful if @stephan-herrmann or @jarthana would add something to the https://github.com/eclipse-jdt/eclipse.jdt.core/wiki/Adding-support-for-new-Java-version-and-Features-in-JDT page (or any other Wiki page that fits to the "jcl" jars).

Once I would know the expected procedure I could update jclMin22.jar with proper content (and may be fix other jars as I can see that jclMin17.jar contains .classpath file that refers to JavaSE-14).

PS.
In the changed code, it's org.eclipse.jdt.core.tests.model.ClasspathTests.test232816f() that found the problem

@stephan-herrmann
Copy link
Contributor

I see that there was an attempt made to provide some systematic approach for jclMin* & converterJclMin* jars (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=560658 and d925ea3), however I do not see any trace of actual automation for jclMin jars ...

Right. Seems we ran out of steam before completing the task :(

@iloveeclipse
Copy link
Member Author

Right. Seems we ran out of steam before completing the task :(

Could you just explain what is expected content of those jars and what is the difference between jclMin and converterJclMin jars, and how jclMin jars were created before?

@stephan-herrmann
Copy link
Contributor

Right. Seems we ran out of steam before completing the task :(

Could you just explain what is expected content of those jars and what is the difference between jclMin and converterJclMin jars, and how jclMin jars were created before?

Guess what: I have no idea.

Both jclMin.jar and converterJclMin.jar where initially committed by Jerome Lanneluc on 2002-07-11, seperate commits, both without a commit comment. Both look like initial imports (into CVS) of some parts of the pre-existing code base.

All I can say is that converterJclMin* are used by DOM converter tests, and jclMin* by model tests.

So, when we need to do something about jclMin anyway, let's try to merge them and see what happens. Since converterJclMin* have sources in git and a build.xml, those should be the starting point for the merge.

The only rationale that I can provide is this: tests are supposed to run with much reduced class libraries to avoid performance problems and to make tests stable while the JDK evolves.

@iloveeclipse
Copy link
Member Author

I see some really strange p1 packages artifacts in converterJclMin1.5.jar (which is of course causes extra fails after switching to converterJclMin1.8.jar because of course later one doesn't have that package).

@jarthana or @mpalat or @srikanth-sankaran : do you know what's the what is the difference between jclMin and converterJclMin jars, and how jclMin jars were created before?

@stephan-herrmann
Copy link
Contributor

stephan-herrmann commented Jun 18, 2024

how jclMin jars were created before?

Unpack the corresponding jclMinSrc.zip, add stuff, compile and re-create the jar.

(no idea related to the difference between variants)

@iloveeclipse
Copy link
Member Author

Unpack the corresponding jclMinSrc.zip, add stuff,

Which stuff? Where it is coming from? Is this something like CtSym?

@stephan-herrmann
Copy link
Contributor

stephan-herrmann commented Jun 18, 2024

Unpack the corresponding jclMinSrc.zip, add stuff,

Which stuff? Where it is coming from? Is this something like CtSym?

Vaguely similar to CtSym as both are about stubbing JRE libraries.

All additions are manually crafted.

  • some are obvious from language features being added (foreach loop needs Iterable, records need Record etc.)
  • some are otherwise "standard" stuff to facilitate using almost-real-world examples in tests.

Still, for every type added, we go with a "minimal" set of members.

@merks
Copy link
Contributor

merks commented Sep 4, 2024

After errors in my SDK workspace for months I wondered why this still hasn't been fixed.

The only recourse seems to be not to import them into the workspace. Or is there some plan here?

@iloveeclipse
Copy link
Member Author

After errors in my SDK workspace for months

Which errors? This issue shouldn't produce any errors.

@merks
Copy link
Contributor

merks commented Sep 4, 2024

Is this a different issue?

image

@iloveeclipse
Copy link
Member Author

Is this a different issue?

Yes. Please remove projects inside JCL from Oomph setup, they shouldn't be used by most of developers. Even experienced ones don't know how to use them properly :-)

iloveeclipse added a commit to iloveeclipse/eclipse.jdt.core that referenced this issue Sep 4, 2024
Re-built jclMin22.jar from jclMin22src.jar with proper project
compilation target and enabled test232816f().

Fixes eclipse-jdt#2580
iloveeclipse added a commit to iloveeclipse/eclipse.jdt.core that referenced this issue Sep 4, 2024
iloveeclipse added a commit to iloveeclipse/eclipse.jdt.core that referenced this issue Sep 5, 2024
Re-built jclMin22.jar from jclMin22src.jar with proper project
compilation target and enabled test232816f().

Fixes eclipse-jdt#2580
iloveeclipse added a commit to iloveeclipse/eclipse.jdt.core that referenced this issue Sep 5, 2024
iloveeclipse added a commit that referenced this issue Sep 5, 2024
Re-built jclMin22.jar from jclMin22src.jar with proper project
compilation target and enabled test232816f().

Fixes #2580
@iloveeclipse iloveeclipse self-assigned this Sep 5, 2024
@iloveeclipse iloveeclipse added this to the 4.34 M1 milestone Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants