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

Summary: Exception when selecting location in New JavaScript wizard
Product: javascript Reporter: Petr Jiricka <pjiricka>
Component: -- Other --Assignee: issues@javascript <issues>
Status: RESOLVED WONTFIX    
Severity: normal    
Priority: P3    
Version: 6.x   
Hardware: PC   
OS: Mac OS X   
Issue Type: DEFECT Exception Reporter:
Attachments: Exception stack trace

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.