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 116766 - NPE from method updateDefaultButton()
Summary: NPE from method updateDefaultButton()
Status: CLOSED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: I18N (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@java
URL: http://statistics.netbeans.org/except...
Keywords: JDK_SPECIFIC, RANDOM, THREAD
: 59436 122757 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-09-26 01:07 UTC by gert_cuykens
Modified: 2011-06-09 09:56 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 2413


Attachments
stacktrace (7.69 KB, text/plain)
2007-09-26 01:07 UTC, gert_cuykens
Details
stacktrace (1.54 KB, text/plain)
2007-10-09 07:17 UTC, tboerkel
Details
stacktrace (1.54 KB, text/plain)
2007-10-09 07:35 UTC, tboerkel
Details
stacktrace (1.54 KB, text/plain)
2008-04-02 18:23 UTC, laguiar
Details

Note You need to log in before you can comment on or make changes to this bug.
Description gert_cuykens 2007-09-26 01:07:20 UTC
Build: NetBeans IDE Dev (Build 200709190000)
VM: Java HotSpot(TM) Client VM, 1.6.0_02-b06
OS: Windows XP, 5.1, x86

User Comments: 
dbstuff
Comment 1 gert_cuykens 2007-09-26 01:07:25 UTC
Created attachment 49524 [details]
stacktrace
Comment 2 tboerkel 2007-10-09 07:17:03 UTC
Build: NetBeans IDE Dev (Build 200710071200)
VM: Java HotSpot(TM) Client VM, 1.6.0_03-b05
OS: Windows Vista, 6.0, x86

User Comments: 
Finishing Internationalization Wizard
Comment 3 tboerkel 2007-10-09 07:17:13 UTC
Created attachment 50464 [details]
stacktrace
Comment 4 tboerkel 2007-10-09 07:35:03 UTC
Build: NetBeans IDE Dev (Build 200710071200)
VM: Java HotSpot(TM) Client VM, 1.6.0_03-b05
OS: Windows Vista, 6.0, x86

User Comments: 
Comment 5 tboerkel 2007-10-09 07:35:11 UTC
Created attachment 50467 [details]
stacktrace
Comment 6 tboerkel 2007-10-09 07:41:11 UTC
Why is a NullPointerException P4? It seems to happen to me (JDK 1.6.0u3, Windows Vista) very often while using the
Internationalization Wizard.
Comment 7 Exceptions Reporter 2008-03-18 10:36:40 UTC
This issue has already 5 duplicates 
Comment 8 Lukas Hasik 2008-03-18 10:54:56 UTC
most of the exceptions is coming from I18N wizard 

i18n.wizard.I18nWizardDescriptor.updateDefaultButton

Reassigning for evaluation, maybe something can be done to get rid off the npe
Comment 9 Marian Petras 2008-03-18 15:52:14 UTC
Regarding the exceptions coming from the Internationalization Wizard, the cause is probably that the default button is
set from a non-event-dispatching-thread (aka AWT thread) but from a request processor thread. The code is kind of weird
- it tries to veto the change (just announced via listener) of the default button.
Comment 10 Marian Petras 2008-03-18 16:01:06 UTC
The weird part of code was introduced in revision 1.2 of file

  i18n/src/org/netbeans/modules/i18n/wizard/I18nWizardDescriptor.java

Diff:
http://deadlock.netbeans.org/fisheye/browse/netbeans/i18n/src/org/netbeans/modules/i18n/wizard/I18nWizardDescriptor.java?r1=1.1&r2=1.2
Comment 11 Jana Maleckova 2008-03-25 14:46:46 UTC
StackTrace:
===========
java.lang.NullPointerException
        at java.util.Hashtable.get(Hashtable.java:334)
        at javax.swing.KeyboardManager.registerKeyStroke(KeyboardManager.java:86)
        at javax.swing.JComponent.registerWithKeyboardManager(JComponent.java:2168)
        at javax.swing.JComponent.registerWithKeyboardManager(JComponent.java:2093)
        at javax.swing.JComponent.componentInputMapChanged(JComponent.java:2163)
        at javax.swing.ComponentInputMap.put(ComponentInputMap.java:77)
Comment 13 Tomas Pavek 2008-03-25 19:20:47 UTC
*** Issue 59436 has been marked as a duplicate of this issue. ***
Comment 14 Marian Petras 2008-03-27 22:46:25 UTC
*** Issue 122757 has been marked as a duplicate of this issue. ***
Comment 15 Marian Petras 2008-03-28 19:00:36 UTC
The solution is to rewrite the logic behind enabling/disabling the wizard buttons and switching the wizard step panels.
There is plenty of custom code that most probably can be replaced with a few Dialogs API calls. It is too risky to do
such rewrites that late in the NB 6.1 development cycle - I will fix it in the next release.
Comment 16 laguiar 2008-04-02 18:23:48 UTC
Build: NetBeans IDE Dev (Build 200803302302)
VM: Java HotSpot(TM) Client VM, 10.0-b19, Java(TM) SE Runtime Environment, 1.6.0_04-b12
OS: Windows XP, 5.1, x86

User Comments: 
Comment 17 laguiar 2008-04-02 18:23:51 UTC
Created attachment 59570 [details]
stacktrace
Comment 18 Marian Petras 2008-05-14 19:03:03 UTC
I will fix it by removing all the hacks in the Internationalization module - I will use the standard API for wizards
instead.
Comment 19 Marian Petras 2008-05-15 09:57:55 UTC
Fixed.

Modified files:
   i18n/src/org/netbeans/modules/i18n/wizard/Bundle.properties
   i18n/src/org/netbeans/modules/i18n/wizard/HardStringWizardPanel.java
   i18n/src/org/netbeans/modules/i18n/wizard/I18nWizardDescriptor.java
   i18n/src/org/netbeans/modules/i18n/wizard/ResourceWizardPanel.java
   i18n/src/org/netbeans/modules/i18n/wizard/TestStringWizardPanel.java

Mercurial changeset Id:
68776bfaf0bb
(http://hg.netbeans.org/main/rev/68776bfaf0bb)
Comment 20 Marian Petras 2008-05-15 10:01:42 UTC
I am reopening it so that it can be passed to the 'db' module, which is the origin of the first reported exception.
Comment 21 Marian Petras 2008-05-15 10:03:29 UTC
Passed to the 'db' module so that the first reported exception can be resolved.
Comment 22 Marian Petras 2008-05-15 10:07:15 UTC
One of the exceptions originates in class org.netbeans.modules.jumpto.type.GoToTypeAction$Worker - see
http://statistics.netbeans.org/analytics/detail.do?id=37751
Comment 23 David Vancouvering 2008-05-19 10:47:42 UTC
I'm sorry, can you explain more what I need to do here?  I've looked at the stack trace which calls
ConnectionDialog.setVisible, and it appears that we are calling setVisible() on the AWT event thread.  What do I need to
do differently?
Comment 24 Marian Petras 2008-05-19 11:01:16 UTC
David, I do not see anything suspicious in the stack-trace either. So pass it to 'core' (maybe the bug is somewhere in
the NbPresenter?) or to 'utilities/jumpto' so that the remaining issue in it gets fixed.
Comment 25 David Vancouvering 2008-05-19 12:08:33 UTC
I am not sure I follow the thread of what is going on here, but re-assigning to core.  
Comment 26 Quality Engineering 2008-05-20 05:11:51 UTC
Integrated into 'main-golden', available in NB_Trunk_Production #206 build
Changeset: http://hg.netbeans.org/main/rev/68776bfaf0bb
User: mpetras@netbeans.org
Log: fixed bug #116766 - "NPE i18n.wizard.I18nWizardDescriptor.updateDefaultButton"
Comment 27 Lukas Hasik 2008-05-20 16:15:45 UTC
David, please DO NOT assign to core issues that you don;t know what to do with. Core isn't your trash basket...

I'm closing as fixed for now. The original exception should be fixed by mpetras commit. I cannot see anything connected
with db here...

Marian, please provide more details if you want to reassign to DB again
Comment 28 David Vancouvering 2008-05-20 17:02:49 UTC
Lukas, apologies if you feel like a trash basket.  As you can see from the history, I told Marian it didn't look like my
issue, and Marian suggested I switch to core.  I was just trying to get it to it's proper owner so it could get
addressed.   

If this is not your bug, I don't believe it's appropriate for you to close the issue unless you are certain the issue is
resolved.  I'm not convinced it is, because Marian only fixed the issues in the Internationalization Wizard, and not the
issue caused by the first stack trace.  

However, it does *not* belong to db, as it is clear from the stack trace that we are calling the setVisible() method
from the AWT thread. 

I'll give it back to Marian so she can decide what to do with it.
Comment 29 Marian Petras 2008-05-21 08:45:33 UTC
For now, I am re-assigning it to module "Jump To". Once bug in "Jump To" is fixed, I will get back to the first exception.
Comment 30 Marian Petras 2008-05-21 08:59:30 UTC
Re bug in "Jump To":
The exception's stack trace is at http://statistics.netbeans.org/analytics/detail.do?id=37751
The exception seems to have the same cause as the exception in the Internationalization module - enabling/disabling
buttons from non-AWT thread. Moreover, I think that the GoToTypeAction should not create its own OK button - it should
use a subclass of NotifyDescriptor.Message with OK_CANCEL_OPTION. Changes of state of the OK button can be achieved
using a combination of overridden method 'isValid()' and changes of property PROP_VALID.
Comment 31 Jan Becicka 2008-09-25 09:55:10 UTC
Jmupto issue was already fixed.
http://hg.netbeans.org/main/rev/7abd17319461
Comment 32 Jiri Vagner 2008-10-07 13:36:27 UTC
I was trying to invoke that NPE, I was playing with with both Wizards and everything works correctly. Janie, please, can
you test it too? Maybe all that bugfixes already fixed it. ;)
Comment 33 Jana Maleckova 2008-10-07 19:29:46 UTC
I tried i18n wizards as well and I cannot reproduce this exception as well. Seem to be fixed.

tested on 

Product Version: NetBeans IDE Dev (Build 20081007071513)
Java: 1.6.0_10-rc2; Java HotSpot(TM) Client VM 11.0-b15
System: Windows XP version 5.1 running on x86; Cp1252; en_GB (nb)
Comment 34 Jiri Vagner 2008-10-08 09:26:54 UTC
Seem to be fixed. (Tested by jvagner and janie)
Comment 35 Marian Mirilovic 2011-06-09 09:56:37 UTC
v/c