-
Notifications
You must be signed in to change notification settings - Fork 1
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
javac doesn't configure output folders of dependent projects correctly #1017
Conversation
@@ -385,7 +385,7 @@ private static Collection<File> classpathEntriesToFiles(JavaProject project, Pre | |||
for (IClasspathEntry transitiveEntry : resolved ) { | |||
if (transitiveEntry.getEntryKind() == IClasspathEntry.CPE_SOURCE) { | |||
IPath outputLocation = transitiveEntry.getOutputLocation(); | |||
if (outputLocation != null && select.test(transitiveEntry)) { | |||
if (outputLocation != null && !transitiveEntry.isTest()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The select
condition needs to be a parameter, it may take different values depending on the case. So instead of hardcoding the condition here, I think it should instead be tweaked in the parameter of the callers.
Concretely here, what is missing? Is it an entry in the sourcepath or in the classpath? If the former, tweaking line 268 seems better, if the former then line 303 would be a more accurate location to change,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have updated line 303.
7f5c20a
to
87832d6
Compare
cd777ab
to
c591429
Compare
Thanks. This patch indeed seems simple. |
The issue happens when a dependent project has a source folder with an output folder. You can try the project (multimodule.zip) from redhat-developer/vscode-java#3885 (comment)
How to create a test case for javac? |
You can try to add a test to org.eclipse.jdt.core.tests.javac/.../RegressionTests.java . |
Note that the test cannot depend on Gradle. Having a non-Gradle reproducer seems important. |
@mickaelistria I have updated the PR. |
8df3562
to
20b620e
Compare
Signed-off-by: Snjezana Peco <[email protected]>
20b620e
to
35b7069
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change indeed seems good. Thank you.
I suggest we wait for build results before merging. I won't be available until monday, so here are the things to check before a safe merge:
- the CI Jenkins build completes
- its number of failures is not superior to the one of the dom-with-javac branch for its parent commit
- The number of total tests increased to ensure the newly added tests has run
When all these criteria are verified (build should take ~40 minutes to complete, so not too far from now), then please merge this PR.
Fixes #1016