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.

Bug 169942 - Generated method is created inside guarded block
Summary: Generated method is created inside guarded block
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Max Sauer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-06 04:07 UTC by Masaki Katakai
Modified: 2009-09-24 05:11 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
sample project (113.75 KB, application/x-compressed)
2009-08-06 04:07 UTC, Masaki Katakai
Details
screenshot (75.43 KB, image/png)
2009-09-22 12:06 UTC, Masaki Katakai
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Masaki Katakai 2009-08-06 04:07:01 UTC
Product Version: NetBeans IDE 6.7.1 (Build 200907230233)
Java: 1.6.0_13; Java HotSpot(TM) 64-Bit Server VM 11.3-b02-83
System: Mac OS X version 10.5.7 running on x86_64; SJIS; en (nb)

Generated method is created inside guarded block.

1. Open DesktopApplication1 project

2. Open only DesktopApplication1View.java
   Do not open NewJDialog.java

3. You can find one error in showAboutBox()
   d.setX(1) is not defined. Select Create Method setX(int) in desktopapplication1.NewJDialog
   on suggestion window

4. method setX() is created in guarded block like below

    // Variables declaration - do not modify                     
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;

    void setX(int i) {
        throw new UnsupportedOperationException("Not yet implemented");
    }
    // End of variables declaration       

There is no way to move the codes to outside on NetBeans.
Comment 1 Masaki Katakai 2009-08-06 04:07:51 UTC
Created attachment 85878 [details]
sample project
Comment 2 Tomas Pavek 2009-08-06 10:47:22 UTC
Reproducible. If NewJDialog is not opened, the new method is added to the guarded block.
Comment 3 Max Sauer 2009-08-18 12:24:32 UTC
Fixed, please verify.
---
http://hg.netbeans.org/jet-main/rev/a1000ec9db36
Comment 4 Quality Engineering 2009-08-21 06:08:07 UTC
Integrated into 'main-golden', will be available in build *200908210201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/a1000ec9db36
User: Max Sauer <msauer@netbeans.org>
Log: #169942: Generated method is created inside guarded block
Comment 5 Masaki Katakai 2009-09-22 12:05:27 UTC
Verified the fix on 200909220201.

But it seems that selection for inserted codes is not correct. See attached screenshot. I don't think it's high
priority. Should I file another issue? Please advice.
Comment 6 Masaki Katakai 2009-09-22 12:06:06 UTC
Created attachment 88094 [details]
screenshot
Comment 7 Max Sauer 2009-09-22 12:17:55 UTC
Yes, please file an issue, P3 or P4 against java.hints or java.source, assigned to 'msauer'. Please attach sample source or let me know if the project/steps 
to reproduce are still the same as in this issue. Thank you very much.
Comment 8 Masaki Katakai 2009-09-24 05:11:18 UTC
Thank you! I opened a new bug 172956 as P4.