Community
Participate
Working Groups
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)
Fixed JavaConventions and added regression test ClasspathTests.testClasspathValidation11()
Verified.
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()