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: | AIOOBE from NewFile.preselectedProject when no projects open | ||
---|---|---|---|
Product: | projects | Reporter: | Jesse Glick <jglick> |
Component: | Generic Projects UI | Assignee: | Jesse Glick <jglick> |
Status: | VERIFIED FIXED | ||
Severity: | blocker | CC: | mkrauskopf |
Priority: | P2 | Keywords: | SIMPLEFIX |
Version: | 5.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: | Stack trace |
Description
Jesse Glick
2005-06-03 17:03:40 UTC
Created attachment 22486 [details]
Stack trace
*** Issue 61173 has been marked as a duplicate of this issue. *** It seems to me that this was introduced in revision 1.19 of NewFile.java: revision 1.19 date: 2005/05/17 00:15:43; author: jglick; state: Exp; lines: +7 -2 Threading fix, avoids stack trace. The problem is IMO following: 1. The user presses Ctrl-N, on an instance of NewFile action "createContextAwareAction" method is called with appropriate Lookup (in the AWT Thread probably). 2. New "NewFile" action is created (newly created actions have isEnabled() == true). 3. In the NewFile's constructor, "refresh" is called. The refresh replans to AWT Thread to perform setEnabled and setDisplayName. (originaly, the setEnabled was called synchronously in the refresh method). 4. isEnabled() is called on the newly created action (returns true as the setEnabled(false) has not been runned yet), and as the result is true, actionPerformed is called (resulting in the exception). Please note that the action should be enabled only if "OpenProjectList.getDefault().getOpenProjects().length > 0" and in such a case calling OpenProjectList.getDefault().getOpenProjects()[0] seems OK. Yup, needed to change enablement synch if already in EQ. Checking in projects/projectui/src/org/netbeans/modules/project/ui/actions/NewFile.java; /cvs/projects/projectui/src/org/netbeans/modules/project/ui/actions/NewFile.java,v <-- NewFile.java new revision: 1.20; previous revision: 1.19 done Marking this issue as VERIFIED since the issue reporter == issue owner. |