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.
[ BUILD # : 200710211200 ] [ JDK VERSION : 1.6.0_02 ] 1. Create a webapp 2. Change sun-web.xml to geronimo-web.xml (the file will disappear from Configuration Files node in Projects window) 3. Go to Files window > web/WEB-INF directory and open geronimo-web.xml 4. Change its content to any valid XML. 5. Upon save NPE's thrown. See the attachment.
Created attachment 51473 [details] NPE stack trace
Cannot reproduce (on Solaris x86, but OS should not matter). There is no rename for this file type (sun-web.xml) inside the IDE that I'm aware of, so exactly what actions did you take that correspond to your step 2 (Change sun-web.xml to geronimo-web.xml)? I renamed the file from a command prompt and upon refocusing the IDE, it was clear that not only had the file been renamed, but that a new DataLoader had loaded it since the icon was different (This is what should happen). The exception you describe implies that somehow the renamed file was not reloaded with the correct loader and that could certainly cause problems. But I don't see how that could ever happen.
I could reproduce it very easily in Beta 2, too. The rename feature is simple F2 while the file's selected. That's the step 2.
Thanks. Ok, I can reproduce this now. The NPE is no big deal to fix, I'll fix that and enhance the error tracking a bit so it works similar to the way the standard descriptors handle this (behavior of ejb-jar.xml is closest facimile). The more interesting question is how renaming of these files is handled. For the Sun DD files, renaming should cause existing dataobjects to be destroyed and new dataloader and dataobject to be created, if necessary. I suspect there are other XML files that ought to be handled this way as well.
Fixed NPE & error hint issues. Whether rename should or shouldn't even be allowed here, I'll leave as a topic for another day.