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.
Steps to reproduce: 1. Create JSP file. Insert following string to JSP: <%! int i = 5;%> 2. Compile JSP and open generated servlet. 3. Select string " int i = 5; " in servlet code and press right mouse button. 4. Click Add->Field popup menu. 5. Click ok in Add New Field dialog. 6. Switch to JSP view and press F11. Result: exception occured: JSP_2.jsp [-1:-1] org.openide.filesystems.FileAlreadyLockedException at org.openide.filesystems.AbstractFileObject.lock (AbstractFileObject.java:204) at org.openide.filesystems.FileObject.delete (FileObject.java:274) at org.netbeans.modules.tomcat.tomcat40.compile.TomcatCompileC ontext$TomcatDevelopmentCompilation.cleanJSP (TomcatCompileContext.java:311) at org.netbeans.modules.web.core.jsploader.CleanCompiler$Group .start(CleanCompiler.java:107) at org.netbeans.core.compiler.CompilationEngineImpl$CompilerTh read$GroupCompiler.run(CompilationEngineImpl.java:280) Errors compiling JSP_0005f2$jsp. I think user shouldn't have ability to add new fields/constructor/methods, etc to generated servlet. "Add" context menu item should be always disabled in generated servlet. The same problem exist with "Customize" popup menu item. Reproduced with Nevada 030502.
Agreed. All 'editable' actions should be disabled for generated servlet.
*** Issue 31345 has been marked as a duplicate of this issue. ***
Reassigning to editor: Editable actions (like cut/paste/delete) shouldn't be enabled on readonly file.
Changing subcomponent to menu.
The generated servlet file is not readonly. I'm not sure how exactly this should be fixed. I tried 'Generate' action (alt-insert) to override a method and it seemed to work fine. Switching back to JSP and Design view was ok too.
The actions are handled by java editor, reassigning to Honza.
later.
NetBeans.org Migration: changing resolution from LATER to WONTFIX