This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
1. Create new java application 2. Select window Files and browse to folder "src" of the application 3. Rename it --> a NPE is thrown It is caused by error in method folderRenamed() of org.netbeans.modules.javacore.RepositoryUpdater The method should be changed as follows: private void folderRenamed(FileRenameEvent fe) { FileObject newFo = fe.getFile(); boolean failed = true; JMManager.getDefaultRepository().beginTrans(true); try { Enumeration children = newFo.getChildren(true); FileObject cpRoot = getCPRoot(newFo); if (cpRoot == null) { // ignore folders that are not visible from our merged classpath return; } String dirName = JMManager.getResourceName(cpRoot, newFo); while (children.hasMoreElements()) { FileObject f = (FileObject) children.nextElement(); if ("java".equals(f.getExt()) && !f.isVirtual()) { // NOI18N String oldName = JMManager.getResourceName(cpRoot, f); String newName = replaceStart(oldName, dirName, fe.getName()); newName = replaceEnd(dirName, fe.getName()); newName = replaceStart(oldName, dirName, newName); if (DEBUG) System.out.println("Folder renamed: Resource " + newName + " renamed to " + oldName); // NOI18N manager.getResource(cpRoot, oldName).setName(newName); } } failed = false; } finally { JMManager.getDefaultRepository().endTrans(failed); } }
Created attachment 17721 [details] fixed RepositoryUpdater
Thanks for the fix, but please: 1. Attach stack trace of the NPE 2. If you are attaching patches, don't attach whole files, but only diffs (-u)
Created attachment 17753 [details] Stack trace
Created attachment 17754 [details] diff
Thanks for attachments. Fixed. Checking in RepositoryUpdater.java; /cvs/java/javacore/src/org/netbeans/modules/javacore/RepositoryUpdater.java,v <-- RepositoryUpdater.java new revision: 1.19; previous revision: 1.18 done
Verified in 4.2 (200507110943)
Reorganization of java component