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 62719 - NPE on surrounding with try-catch
Summary: NPE on surrounding with try-catch
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 5.x
Hardware: PC Windows XP
: P2 blocker (vote)
Assignee: issues@java
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-20 18:08 UTC by cbulcu
Modified: 2007-09-26 09:14 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
log file (22.92 KB, text/plain)
2005-08-20 18:09 UTC, cbulcu
Details

Note You need to log in before you can comment on or make changes to this bug.
Description cbulcu 2005-08-20 18:08:53 UTC
NPE on surrounding UIManager.setLookAndFeel(                    
UIManager.getSystemLookAndFeelClassName()); with try-catch block using context
menu. (Netbeans dev Build 200508181800)
Comment 1 cbulcu 2005-08-20 18:09:54 UTC
Created attachment 24105 [details]
log file
Comment 2 Milan Kubec 2005-08-24 11:08:25 UTC
I'm not able to reproduce, lowering priority to standard. Please evaluate those
exceptions.
Comment 3 cbulcu 2005-08-24 22:44:40 UTC
I tried again and again. When I do it outside "public void run()" method all is
right. But when I do it inside run(), on "new NewJFrame1().setVisible(true);" it
fires NPE. I hope is ok now. This happens everytime!

public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new NewJFrame1().setVisible(true);
            }
        });
    }
Comment 4 cbulcu 2005-08-24 22:52:32 UTC
I hope you tested on the same build
Comment 5 cbulcu 2005-08-24 23:52:53 UTC
the same has happend in the latest build 200508231800.
Comment 6 cbulcu 2005-08-24 23:58:14 UTC
of course that that piece of code was generated by NetBeans within a new JForm. 
Comment 7 Milan Kubec 2005-08-30 11:33:05 UTC
I got it. It's reproducible. 
I've put the code for setting L&F into contructor and regardless if the
constructor declares throws or not trying to surround following code:
new NewJFrame1().setVisible(true);
with try-catch ends up with NPE.
Comment 8 Tomas Hurka 2005-08-30 15:19:13 UTC
Fixed in trunk.
Checking in NewClassExpressionImpl.java;
/cvs/java/javacore/src/org/netbeans/modules/javacore/jmiimpl/javamodel/
NewClassExpressionImpl.java,v  <--  NewClassExpressionImpl.java
new revision: 1.10; previous revision: 1.9
done
Comment 9 cbulcu 2005-12-28 09:35:55 UTC
Verified in the dev build 200512262030.
Comment 10 Quality Engineering 2007-09-20 10:46:13 UTC
Reorganization of java component