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 176421 - Exception when selecting location in New JavaScript wizard
Summary: Exception when selecting location in New JavaScript wizard
Status: RESOLVED WONTFIX
Alias: None
Product: javascript
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 6.x
Hardware: PC Mac OS X
: P3 normal (vote)
Assignee: issues@javascript
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-10 08:36 UTC by Petr Jiricka
Modified: 2012-09-21 11:17 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Exception stack trace (4.49 KB, text/plain)
2009-11-10 08:36 UTC, Petr Jiricka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Jiricka 2009-11-10 08:36:33 UTC
Created attachment 90719 [details]
Exception stack trace

In a web project, create JavaScript file, and change Location - click on the combo box, and then select Web Pages again. This could be Mac OS X specific.
Comment 1 Denis Anisimov 2009-11-10 11:09:40 UTC
Sorry, please clarify .
Are these steps correct ? :
1) invoke "create JS file" wizard.
2) in opened dialog change "Web Pages" location to "Sources Packages".
3) change "Sources Packages" value in combobox back to "Web Pages".

As result exception is thrown .

Is it correct ?

With this scenario I cannot reproduce it on Win XP.
I wonder if it is reproduced with ANY platform.
NPE on pointed string could be only if "getSelectedItem()" method 
of JComboBox class returns null.
But with described scenario it should never happen.
It looks like an issue in Mac OS X JDK.

It cannot be easily fixed because it really break the logic of API.
By the way it should not relate to JS only .
Such behavior should be for any template:
JSP, JSF, XHTML, Tag, Taglib,....

Also this issue should not relate to my refactoring .
The code in this area was not changed . So it should be reproducible
with previous builds.
Comment 2 Petr Jiricka 2009-11-11 04:47:28 UTC
Well, actually the steps are:

1) invoke "create JS file" wizard.
2) in opened dialog click on the Location dialog so it expands the choices.
3) in the expanded list, click again on Web Pages (so the selected item is NOT changed).

Then the exception appears.

> Such behavior should be for any template:
> JSP, JSF, XHTML, Tag, Taglib,....

Yes.

It looks like this is really Mac specific and problem in the JDK. Still, let's leave this issue open for tracking purposes, even if we can not fix easily.

> Also this issue should not relate to my refactoring .

You are right, I tried an older build and the exception was there also in a different form:

java.lang.NullPointerException
	at org.netbeans.modules.web.wizards.TargetChooserPanelGUI.changedUpdate(TargetChooserPanelGUI.java:913)
	at org.netbeans.modules.web.wizards.TargetChooserPanelGUI$13.actionPerformed(TargetChooserPanelGUI.java:534)
Comment 3 Denis Anisimov 2009-11-11 04:53:54 UTC
OK.
Thanks to clarification.
Yes, I believe this is Mac OS X JDK bug.

I agree to keep it opened.
Comment 4 Petr Pisl 2012-09-21 11:17:31 UTC
The code is not here anymore. Replaced with new implementation.