Bug 560328 - JavaRuntime.computeUnresolvedRuntimeClasspath ignores excludeTestCode parameter
Summary: JavaRuntime.computeUnresolvedRuntimeClasspath ignores excludeTestCode parameter
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 4.15   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Debug-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2020-02-19 12:41 EST by Eric Milles CLA
Modified: 2022-05-31 13:04 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Milles CLA 2020-02-19 12:41:44 EST
org.eclipse.jdt.launching.JavaRuntime#computeUnresolvedRuntimeClasspath(IJavaProject, boolean) does not use its boolean excludeTestCode parameter to filter the returned entries.  For comparison, org.eclipse.jdt.launching.JavaRuntime#computeUnresolvedRuntimeDependencies(IJavaProject, boolean) does filter.
Comment 1 Till Brychcy CLA 2020-02-19 16:25:04 EST
I assume you just saw that in the code and thought it looks like a bug. Or are you aware of an actual defect?

Anyway, what you write is true, but that is because for the "classpath" case a DefaultProjectClasspathEntry is created and the actual filtering is done when resolving it.

I think the problem with the DefaultProjectClasspathEntry was that it didn't fit to the classpath/modulepath split in Java 9 and later.

So, as you noted, for the "dependencies"-case (i.e. Java 9+), computeUnresolvedRuntimeDependencies directly does the filtering, and the parameter was also added to computeUnresolvedRuntimeClasspath to keep the API symmatrical and to allow later implementation changes without changing the API.
Comment 2 Eric Milles CLA 2020-02-19 17:08:38 EST
I was trying to use the first and noticed that test entries were present in my launch config.
Comment 3 Eclipse Genie CLA 2022-05-31 13:04:56 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.