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

Bug 530476

Summary: Incorrect library dependency error
Product: [Eclipse Project] JDT Reporter: cwb bwc <cwb123.dev>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: minor    
Priority: P3 CC: cwb123.dev
Version: 4.7.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard: stalebug

Description cwb bwc CLA 2018-01-29 19:48:30 EST
Eclipse Bug Summary:
Java dependency errors are incorrectly generated and displayed to the user of a library that is configured on the classpath. This is presumably due to that library containing a buggy module-info.java file. Note that the project will still compile and run, in spite of the supposed error that is displayed.

Additionally, the error message displayed was not particularly informative under the circumstances (ie the source code itself appeared valid, the "missing dependency" was correctly imported within the library sources, and everything was working).

Environment:
Windows 7 x64
Java 9.0.1+11
Eclipse v4.7.2 build id 20171218-0600
LWJGL3 v3.1.5 build 1

Configuration:
The jar files for lwjgl-core, lwjgl-glfw, and lwjgl-vulkan are manually configured as a single User Library in Eclipse.
This User Library is then added to the build path of a project under Build Path > Libraries > Classpath (NOT Modulepath!). Note that each listed jar file is identified as "Is not modular - non modifiable" in the dropdown menu.

Observed Behavior:
Eclipse emits the error message "The type org.lwjgl.vulkan.VkInstance cannot be resolved. It is indirectly referenced from required .class files" ONLY when both "org.lwjgl.glfw.GLFWVulkan" and "org.lwjgl.vulkan.VkInstance" are imported into the same source file. It also emits the error message "The import org.lwjgl.vulkan.VkInstance cannot be resolved", but it is unclear to me what precise source code conditions are required for this second one.

When either of the above errors are present, Eclipse's autocomplete functionality fails. However, this is the only observed side effect - the project builds and runs without issue, even though it makes use of the "missing" class.

Expected Behavior:
These errors should not be emitted, as the library as configued is (to my understanding) a perfectly valid classpath library. The issue seems to stem from a bug in 'lwjgl-glfw' 'module-info.java', which fails to 'require static ...' against 'lwjgl-vulkan' but nonetheless imports, makes use of, and exposes its types. Since this is a classpath library, 'module-info.java' should presumably not be parsed.

Possible resemblance of: bugs 144477, 255931, 376827
Comment 1 Eclipse Genie CLA 2020-03-26 18:34:40 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. 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.