Bug 25538 - Conflict of classfolder and outputfolder not reported
Summary: Conflict of classfolder and outputfolder not reported
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.1 M4   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-10-30 09:31 EST by Martin Aeschlimann CLA
Modified: 2003-01-08 11:18 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 Martin Aeschlimann CLA 2002-10-30 09:31:30 EST
20021029

1. create new project
   - no source folders
   - output folder at project
   - new class folder lib
2. select the class folder in the package explorer, Refactor->Rename to lib2
3. -> NPE
The problem is that JavaCore.create(IFolder) returns null for the class folder.
From debugging I see that the reason is that 'conflictsWithOutputLocation' 
return true and no Java element handle is created.

java.lang.NullPointerException
	at 
org.eclipse.jdt.internal.corext.refactoring.changes.RenameSourceFolderChange.get
JavaProject(RenameSourceFolderChange.java:91)
	at 
org.eclipse.jdt.internal.corext.refactoring.changes.RenameSourceFolderChange.mod
ifyClassPath(RenameSourceFolderChange.java:66)
	at 
org.eclipse.jdt.internal.corext.refactoring.changes.RenameSourceFolderChange.doR
ename(RenameSourceFolderChange.java:57)
	at 
org.eclipse.jdt.internal.corext.refactoring.AbstractJavaElementRenameChange.perf
orm(AbstractJavaElementRenameChange.java:68)
	at 
org.eclipse.jdt.internal.ui.refactoring.PerformChangeOperation$1.execute
(PerformChangeOperation.java:147)
	at org.eclipse.ui.actions.WorkspaceModifyOperation$1.run
(WorkspaceModifyOperation.java:65)
	at org.eclipse.core.internal.resources.Workspace.run
(Workspace.java:1378)
	at org.eclipse.ui.actions.WorkspaceModifyOperation.run
(WorkspaceModifyOperation.java:79)
	at 
org.eclipse.jdt.internal.ui.refactoring.PerformChangeOperation.executeChange
(PerformChangeOperation.java:154)
	at org.eclipse.jdt.internal.ui.refactoring.PerformChangeOperation.run
(PerformChangeOperation.java:124)
	at org.eclipse.jface.operation.ModalContext.runInCurrentThread
(ModalContext.java:296)
	at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:246)
	at org.eclipse.jface.window.ApplicationWindow$1.run
(ApplicationWindow.java:391)
Comment 1 Jerome Lanneluc CLA 2002-12-02 09:49:19 EST
Fixed JavaConventions and added regression test 
ClasspathTests.testClasspathValidation11()
Comment 2 David Audel CLA 2002-12-17 10:05:44 EST
Verified.
Comment 3 Jerome Lanneluc CLA 2003-01-08 11:18:28 EST
Actually, the JavaConventions should allow this case since the project's output 
folder is not used. Changed 'conflictsWithOutputLocation' to return false in 
this case.

Moved test to FactoryTests.testCreateLibInOutput()