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.
10/31 build -I do expect that this is editor issue but I'd like to Visual Designer guys to take care of it and evaluate first -go to any of the mobility guarded blocks of vmd. Try to add pre-init, post-init code e.g. throw new Exception(); when you wanna invoke "Surrond with try-catch" only a message in status bar appears but no code is added. It used to throw exception described in issue 112764 before. ->it works in J2SE code - private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { try { throw new Exception(); } catch (Exception ex) { Logger.getLogger(NewJFrame.class.getName()).log(Level.SEVERE, null, ex); } } -> mobility project doesn't work any of Insert Code (Alt+Insert) actions in the GB
The surround with try-catch hint is designed to encapsulate whole block into the try-catch. If the block is inside a guarded block, it currently cannot work. Similar situation for some other hints. This can theoretically be fixed, but there simply is not enough time for NB6.0. The Alt-Insert does not work inside the anonymous innerclasses that are inside a guarded block - it obviously cannot generate the code there, and this cannot fixed, IMO, because the GB is there. The Insert Code should be ideally disabled in the guarded anonymous innerclasses, but this is like P4. I tried the Alt-Insert in the outer class (where it makes sense to use it, IMO), and it worked OK to me.
I don't agree the code isn't in guarded block. It isn't anonymous inner class. I'm attaching sample project. look at the code. The throw new Ex() isn't in guarded block but between two guarded blocks //<editor-fold defaultstate="collapsed" desc=" Generated Method: initialize ">//GEN-BEGIN:|0-initialize|0|0-preInitialize /** * Initilizes the application. * It is called only once when the MIDlet is started. The method is called before the <code>startMIDlet</code> method. */ private void initialize() {//GEN-END:|0-initialize|0|0-preInitialize throw new Exception(); //GEN-LINE:|0-initialize|1|0-postInitialize throw new Exception(); }//GEN-BEGIN:|0-initialize|2| //</editor-fold>//GEN-END:|0-initialize|2| note: When I was creating the sample project then it happened to me that the IDE 2 times used the try-catch hint correctly. In most of cases it ignores it and shows just a warning therefore the functionality doesn't work and users get confused. Please, consider to fix it as it highly restricts the editor for mobility visual designer.
Created attachment 52130 [details] sample project
Yes, that is a hell of a guards. Not only hints are responsible (use-case described by Honza Lahoda), also generator. In current design, that is very difficult to provide a "real" fix. I will prepare some hacking stuff which should eliminate the problem.
Should be better. Use-cases described by Honza Lahoda (hint tries to refactor source containing guarded block) will still not work. IMO now it could be P3. ---------------------------- revision 1.46 date: 2007/10/31 16:17:12; author: pflaska; state: Exp; lines: +3 -0 #120599: It should be possible to use hints in mobility. ----------------------------
Max volunteered :)
Will resolve later.
NetBeans.org Migration: changing resolution from LATER to WONTFIX