Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 527885

Summary: BinaryType#resolveType does not work for classes from java9 modules
Product: [Eclipse Project] JDT Reporter: Michael Golubev <borlander>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: stephan.herrmann
Version: 4.8   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X   
Whiteboard: stalebug
Attachments:
Description Flags
Stack trace from java 9, note the message
none
Complete project with test case none

Description Michael Golubev CLA 2017-11-28 15:47:48 EST
As far as I can see the `BinaryType # resolveType` always throws JavaModelException for any binary type from JDK modules: 

```
  @Test
  public void testResolveFromBinaryContext() throws Exception {
    IJavaProject javaProject = myTestProject.getJavaProject();
    IType list = javaProject.findType("java.util.List");
    assertNotNull(list);
    String[][] objectViaFqn = list.resolveType("java.lang.Object");
    assertNotNull(objectViaFqn);

    String[][] objectViaSimpleName = list.resolveType("Object");
    assertNotNull(objectViaSimpleName);
  }

```

Running Eclipse Oxygen 1a in java 9.0.1, using all the tweaks listed in wiki [1]. 
Tried with target platform of Oxygen 1a and with Photon M3, with the same result. 

[1] https://wiki.eclipse.org/Configure_Eclipse_for_Java_9#Configure_Eclipse_for_Java_9_modules
Comment 1 Michael Golubev CLA 2017-11-28 15:50:02 EST
Created attachment 271687 [details]
Stack trace from java 9, note the message
Comment 2 Michael Golubev CLA 2017-11-28 15:53:12 EST
Created attachment 271688 [details]
Complete project with test case
Comment 3 Stephan Herrmann CLA 2017-11-28 16:17:02 EST
@Jay, could it be that BinaryTypeFactory simply isn't prepared to handle JRT?

I see that that class was updated for Bug 500905 but nothing relating to JRT...

@Michael, for good measure, could you please attach .project and .classpath of that test project?
Comment 4 Stephan Herrmann CLA 2017-11-28 16:17:47 EST
(In reply to Stephan Herrmann from comment #3)
> @Michael, for good measure, could you please attach .project and .classpath
> of that test project?

skip that, I didn't see you already attached the project ...
Comment 5 Eclipse Genie CLA 2020-02-12 10:26:59 EST
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. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. 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.