Community
Participate
Working Groups
I20040518-gtk M9 test pass It's going to be hard to reconstruct what I did, but I ended up with nested output folders (will attach a screenshot of the property page). +/- Steps: 1. Create project JUnit 2. import junit.zip, no separate source and output folders 3. Using the context menu in the package explorer, add source folder "test" 4. info: the output will be set to "bin". Ok. -> Note that the standard directory with my junit source is not a source folder any longer 5. Open the project properties, Java build path 6. Add a source folder, choose the root (Project) -> error, "cannot nest Junit/test into Junit" 7. exclude JUnit/test/ from JUnit source folder (cool caption telling me to add a slash to fully exclude the folder!) Everything ok up to now. 8. Enable output folders per source folder 9. Set the output folder for test to "Junit/bin" 10. Set the output folder for the root dir to "Junit/bin/test" (no complaint) 11. leave the property page Hm, now I have a different problem: The folder JUnit/bin/test does not exist -> error in problems view telling me that the project cannot be built because of this We'll continue this way, cannot reproduce the original set up. 12. Over the context menu, choose to create JUnit/bin/test -> I get this in the log: !ENTRY org.eclipse.jdt.core 4 4 May 18, 2004 19:19:49.409 !MESSAGE JavaBuilder handling ImageBuilderInternalException while building: JUnit !STACK 1 org.eclipse.core.internal.resources.ResourceException: Resource /JUnit/bin/test does not exist. at java.lang.Throwable.<init>(Throwable.java) at java.lang.Throwable.<init>(Throwable.java) at org.eclipse.core.runtime.CoreException.<init>(CoreException.java:37) at org.eclipse.core.internal.resources.ResourceException.<init>(ResourceException.java:30) at org.eclipse.core.internal.resources.Resource.checkExists(Resource.java) at org.eclipse.core.internal.resources.Container.members(Container.java) at org.eclipse.core.internal.resources.Container.members(Container.java) at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.cleanOutputFolders(BatchImageBuilder.java:112) at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.build(BatchImageBuilder.java:35) at org.eclipse.jdt.internal.core.builder.JavaBuilder.buildAll(JavaBuilder.java:213) at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:145) at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:532) at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java) at org.eclipse.core.runtime.Platform.run(Platform.java) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:148) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:225) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:178) at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:205) at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java) at org.eclipse.core.runtime.Platform.run(Platform.java) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:208) at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:244) at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:273) at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:151) at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:198) at org.eclipse.core.internal.jobs.Worker.run(Worker.java) !SUBENTRY 1 org.eclipse.core.resources 4 368 May 18, 2004 19:19:49.434 !MESSAGE Resource /JUnit/bin/test does not exist.
Created attachment 10781 [details] nested output folders shows nested output folders.
moving to jdt.core the JavaConventions.validateClasspath should not allow invalid settings
Created attachment 11014 [details] Expected validation error seen at stage 10 Cannot reproduce on M9. At stage 10, I obtain the expected validation error refusing to nest output folders in each other.
Can you reproduce it with exact steps you described in fresh new workspace ? Please reopen once information is available.
Here we go - there were a couple of steps missing in my original steps: 1. Create project JUnit 2. import junit.zip, no separate source and output folders 3. Using the context menu in the package explorer, add source folder "test" 4. info: the output will be set to "bin". Ok. -> Note that the standard directory with my junit source is not a source folder any longer 5. Open the project properties, Java build path 6. Add a source folder, choose the root (Project) -> error, "cannot nest Junit/test into Junit" 7. exclude JUnit/test/ from JUnit source folder 7a. ok & leave property page Everything ok up to now. The problem lies in the following steps, I believe: 7b. Open the properties anew. 7c. Set the default output folder to the project root: JUnit. (should this be possible?) 7d. Ok & Exit. 7e. Open the properties anew. 8. Enable output folders per source folder 9. Set the output folder for test to "Junit/bin" 10. Set the output folder for the root dir to "Junit/bin/test" (no complaint) 11. leave the property page 11a. Observe: JUnit/bin/test does not exist 12. Over the context menu, choose to create JUnit/bin/test -> I get the exception mentioned in comment 0.
Reproduced with new steps.
Output folder nesting check was ordering dependent (1) and not specific enough (2). (1) List of output folders in order is: {P/, P/bin/test/, P/bin/}. When checking P/bin/test/, we don't yet have come across P/bin/, and only find enclosing P/ which is tolerated (as default output folder). Changed check to accumulate all outputs before looking for enclosing scenario. Thus check on P/bin/test/ can now find P/bin/. (2) Also when looking for enclosing scenario, we were looking for first enclosing folder, as opposed to most specific one, thus in above scenario, we would always find the output folder P/ which is then thought to be acceptable; and thus failing to notice more specific nesting in output folders. [Note: nesting in default output folder is tolered iff all source folder declare a custom output.] Added regression test ClasspathTests#test39-41. Fixed
Fixed
Verified in 200405281200