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.
Summary: | "Cannot apply changes due to guarded block" message in the situation it should not happen | ||
---|---|---|---|
Product: | java | Reporter: | Petr Dvorak <joshis> |
Component: | Editor | Assignee: | Jan Pokorsky <jpokorsky> |
Status: | RESOLVED WONTFIX | ||
Severity: | blocker | ||
Priority: | P3 | ||
Version: | 6.x | ||
Hardware: | PC | ||
OS: | Linux | ||
Issue Type: | DEFECT | Exception Reporter: |
It looks like you can break guarded blocks by using insert option inside guarded block. Most likely this issue should be P2. Reassigning to Editor team. Is it still reproducible with the latest build? There has been added some fixes to GuardedDocument to allow to insert code around guarded sections AFAIK. Otherwise I would appreciate some unit test case that would demonstrate the problem as I am not familiar with source code of MIDP projects. Resolving all issues with milestone "future" as LATER. If you feel strongly that it should be implemented please reopen and set the target milestone to "next". NetBeans.org Migration: changing resolution from LATER to WONTFIX |
Product Version: NetBeans IDE Dev (Build 200803021202) Java: 1.6.0_04; Java HotSpot(TM) Client VM 10.0-b19 System: Linux version 2.6.22-14-generic running on i386; UTF-8; en_US (nb) The issue is concerning the generated code. Create a new MIDP project (empty), insert a new WaitScreen in the Flow designer and go to the Screen designer. There is a task resource called "task" in the Resource panel (it is the task which is by default associated with the WaitScreen). Right-click the "task" resource in the Resources panel, select "Go to source" from the pop-up menu. A source code appears. There is a set of "guarded blocks" (the code that cannot be modified by directly typing into it). Right-click this code (for example: right click the word "setExecutable" in the line: "task.setExecutable(new org.netbeans.microedition.util.Executable() {" ... and select "Insert code" from the popup menu. Then choose for example Constructor, check for example the exitCommand in the pop-up window and confirm your choice. A code: >> public HelloMIDlet(Command exitCommand) { >> this.exitCommand = exitCommand; >> } >> //</editor-fold> ... appears right bellow the method "getTask()" in the source. Note, that there is only "//</editor-fold>" tag, which is probably a mistake by itself (missing an opening tag). Now, manually delete generated code (the one above), save the file (Ctrl+S) and close the MIDlet file. Reopen the file in the "Projects" window and go back to the source file (*.java). Scroll down bellow the method "getTask" (it is probably just collapsed block described as "Generated Getter: task"). Go JUST bellow the "getTask" method (to the first place in the code where you can normaly write a code after the block "Generated Getter: task"), right-click there and try to insert a code again. The action will fail with the message "Cannot apply changes due to guarded block". You cannot generate a code here in spite of the fact it should be possible. It almost seems that the steps described in the beginning (trying to insert a code into a guarded block) somehow invalidates the integrity of guarded blocks...