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 71389 - NPE during the startup, org.netbeans.core.ShortcutsFolder.addShortcut
Summary: NPE during the startup, org.netbeans.core.ShortcutsFolder.addShortcut
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker (vote)
Assignee: mslama
URL:
Keywords: I18N
: 71818 72903 73410 73562 73906 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-01-13 23:18 UTC by aekarahan
Modified: 2008-12-22 23:37 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description aekarahan 2006-01-13 23:18:25 UTC
When I start the IDE 5.0 RC1 on both Linux and Windows platform I get the
following: (I run the IDE from unpacked zipped packages, since the binary
installer is buggy (issue 48633)

java.lang.NullPointerException
	at org.netbeans.core.ShortcutsFolder.addShortcut(ShortcutsFolder.java:146)
	at org.netbeans.core.ShortcutsFolder.readShortcuts(ShortcutsFolder.java:133)
	at org.netbeans.core.ShortcutsFolder.refresh(ShortcutsFolder.java:111)
	at org.netbeans.core.ShortcutsFolder.<init>(ShortcutsFolder.java:78)
	at org.netbeans.core.ShortcutsFolder.initShortcuts(ShortcutsFolder.java:59)
	at org.netbeans.core.NonGui.initializeMainWindow(NonGui.java:187)
	at org.netbeans.core.NonGui.run(NonGui.java:96)
	at org.netbeans.core.startup.Main.start(Main.java:395)
	at org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:90)
[catch] at java.lang.Thread.run(Thread.java:595)
Comment 1 Marian Mirilovic 2006-01-19 09:05:08 UTC
jlahoda, 
please look at this. 
Comment 2 Jan Lahoda 2006-01-19 09:33:06 UTC
Not quite sure why me :-).

Seems that there is something strange in the "Shortcuts" folder. The solution is
twofold:
1. Find out what is the strange thing in the shortcuts folder (and remove it).
2. Fix the org.netbeans.core.ShortcutsFolder to handle this situation gracefully
- should be enough to add if (keyStrokes != null) before line 133 (and do some
logging if keyStrokes == null).

Reporter, do you have any additional modules installed? Could you please try to
run NB with "-J-Dorg.netbeans.core.ShortcutsFolder=0" command line switch and
attach full messages.log to this bug? Thanks.
Comment 3 mslama 2006-01-25 11:30:44 UTC
I will take this issue. Problem is actualy with Utilities.stringToKeys which
uses String.toUpperCase().
Comment 4 mslama 2006-01-25 11:31:51 UTC
*** Issue 71818 has been marked as a duplicate of this issue. ***
Comment 5 mslama 2006-01-25 12:37:39 UTC
Fixed in main trunk. Use String.toUpperCase(Locale.ENGLISH) in stringToKey and
stringToKeys instead of String.toUpperCase().

Modified:
openide/util/src/org/openide/util/Utilities.java
new revision: 1.8; previous revision: 1.7
Comment 6 Jesse Glick 2006-01-25 19:19:36 UTC
BTW reporter: if you ever have a weird problem with a Java app that no one else
seems to have, and you are running in Turkish locale, mention that in the bug
report - usually a missing Locale.ENGLISH param in some
String.to{Upper,Lower}Case, making code get confused by the Turkish dotted vs.
undotted 'I'.
Comment 7 Marian Mirilovic 2006-02-27 12:56:00 UTC
*** Issue 72903 has been marked as a duplicate of this issue. ***
Comment 8 Marian Mirilovic 2006-04-06 08:50:51 UTC
*** Issue 73562 has been marked as a duplicate of this issue. ***
Comment 9 Marian Mirilovic 2006-04-06 08:52:03 UTC
*** Issue 73906 has been marked as a duplicate of this issue. ***
Comment 10 Marian Mirilovic 2006-04-06 08:56:51 UTC
Probably we can fix this for NB 5.5 as well, what do you think ?
Comment 11 mslama 2006-04-06 09:43:46 UTC
It is simple and low risk fix. If you thing it is worth to fix it in NB 5.5 go
ahead.
Comment 12 Jesse Glick 2006-04-07 01:04:40 UTC
Also note that the NPE is not thrown after the fix to ShortcutsFolder (1.42)
from issue #74169. However that just prevents the exception; Marek's patch
actually fixes the cause.
Comment 13 Marian Mirilovic 2006-04-18 18:20:25 UTC
*** Issue 73410 has been marked as a duplicate of this issue. ***
Comment 14 Marian Mirilovic 2006-04-18 18:21:28 UTC
Ok Marek, please fix this for NB 5.5.
Comment 15 mslama 2006-04-25 16:14:51 UTC
Fixed in branch 'release55':
openide/util/src/org/openide/util/Utilities.java
new revision: 1.4.6.2.2.1; previous revision: 1.4.6.2