Bug 577072 - Multi release JAR class loading is messy
Summary: Multi release JAR class loading is messy
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.21   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2021-11-04 14:05 EDT by Jeff MAURY CLA
Modified: 2024-04-06 12:41 EDT (History)
1 user (show)

See Also:


Attachments
Project (3.61 KB, application/x-zip-compressed)
2021-11-09 10:06 EST, Jeff MAURY CLA
no flags Details
Simple test project (120.91 KB, application/x-zip-compressed)
2022-04-08 03:41 EDT, Jeff MAURY CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jeff MAURY CLA 2021-11-04 14:05:55 EDT
When a JAR from the class path is a multi release JAR, versions specific classes are shown in the tree but they can not be opened.

To reproduce, create a Maven project from the POM:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.redhat.devtools</groupId>
  <artifactId>multijar</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  
  <properties>
    <maven.compiler.source>11</maven.compiler.source>
    <maven.compiler.target>11</maven.compiler.target>
  </properties>
  
  <dependencies>
    <dependency>
      <groupId>io.smallrye</groupId>
      <artifactId>smallrye-context-propagation</artifactId>
      <version>1.2.2</version>
    </dependency>
  </dependencies>
</project>

Then in the Maven dependencies, you should see the io.smallrye.context.Jdk9CompletableFutureWrapper class. Try to open it and you will get the error
Comment 1 Jeff MAURY CLA 2021-11-04 14:08:21 EDT
Seems to me the buggy code is in org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/java/model/BinaryTypeFactory.java around line 72
Comment 2 Andrey Loskutov CLA 2021-11-09 09:48:44 EST
Don't get me wrong, could you please attach a simple "ready to use" project that demonstrates the problem? This will save our all time.

(In reply to Jeff MAURY from comment #1)
> Seems to me the buggy code is in
> org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/nd/java/model/
> BinaryTypeFactory.java around line 72

If you have patch in mind, please share. Line 72 in current master doesn't look wrong to me.
Comment 3 Jeff MAURY CLA 2021-11-09 10:06:29 EST
Created attachment 287469 [details]
Project
Comment 4 Andrey Loskutov CLA 2022-04-07 09:07:54 EDT
Please report the issue for m2e project: https://github.com/eclipse-m2e/m2e-core/issues or provide a reproducer that doesn't use m2e.
Comment 5 Jeff MAURY CLA 2022-04-08 03:41:31 EDT
Created attachment 288417 [details]
Simple test project

Simple test project without Maven
Comment 6 Eclipse Genie CLA 2024-04-06 12:41:47 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.