Bug 5943 - internal error in setting buildpath (name collsion)
Summary: internal error in setting buildpath (name collsion)
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P1 normal (vote)
Target Milestone: 2.0 M1   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-11-15 05:21 EST by Adam Kiezun CLA
Modified: 2002-01-11 09:22 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Kiezun CLA 2001-11-15 05:21:23 EST
1. in the org.eclipse.jdt.ui.tests plugin try addign the 
ui source folder of org.eclipse.jdt.ui project to the buildpath 
(open project properties)

2. you get:
4 org.eclipse.jdt.ui 1 Internal Error
Java Model Exception: Java Model Status [Name collision.]
	at org.eclipse.jdt.internal.core.JavaProject.setRawClasspath
(JavaProject.java:1753)
	at org.eclipse.jdt.internal.core.JavaProject.setRawClasspath
(JavaProject.java:1724)
	at 
org.eclipse.jdt.internal.ui.wizards.buildpaths.BuildPathsBlock.createJavaProject
(BuildPathsBlock.java:598)
	at 
org.eclipse.jdt.internal.ui.wizards.buildpaths.BuildPathsBlock.access$3
(BuildPathsBlock.java:556)
	at org.eclipse.jdt.internal.ui.wizards.buildpaths.BuildPathsBlock$2.run
(BuildPathsBlock.java:542)
	at org.eclipse.ui.actions.WorkspaceModifyDelegatingOperation.execute
(WorkspaceModifyDelegatingOperation.java:39)
	at org.eclipse.ui.actions.WorkspaceModifyOperation$1.run
(WorkspaceModifyOperation.java:64)
	at org.eclipse.core.internal.resources.Workspace.run
(Workspace.java:1184)
	at org.eclipse.ui.actions.WorkspaceModifyOperation.run
(WorkspaceModifyOperation.java:78)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run
(ModalContext.java:98)
	4 org.eclipse.jdt.core 977 Name collision.
Comment 1 Martin Aeschlimann CLA 2001-11-19 12:11:15 EST
Reproducable scenario:
1. project P1: source folder src
2. project P2: library folder P1/src, required project P1

Tolerated by JavaConventions.validateClasspath, rejected by setClasspath
Comment 2 Philipe Mulet CLA 2001-11-20 13:26:37 EST
1. There is a classpath validation API: JavaConventions#validateClasspath

2. When using IJavaProject#setRawClasspath, it only performs a lightweight 
check of the new
   classpath, which however did catch a scenario missed by 
JavaConventions#validateClasspath.

   The offending scenario is a library folder nested inside a source folder. 
This should be
   forbidden, but the classpath validation did not find it.


The proposed change is:

a) Make the classpath validation code stricter (include a check for this 
scenario)
b) Have IJavaProject#setRawClasspath run the full classpath validation check 
before accepting
   the classpath update.

Any concern about this change ? 
Comment 3 Philipe Mulet CLA 2001-11-21 07:43:54 EST
Until getting more feedback, I left the #verifyClasspath in, and made the 
validation check stricter. 

Comment 4 Philipe Mulet CLA 2001-11-22 11:08:06 EST
Validation check is stricter and run whenever setting the classpath.
Fixed