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 125801 - NPE from BaseOptions.getIndentEngine
Summary: NPE from BaseOptions.getIndentEngine
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Settings (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: issues@editor
URL:
Keywords: REGRESSION
Depends on:
Blocks:
 
Reported: 2008-01-22 21:19 UTC by Jesse Glick
Modified: 2008-01-23 09:21 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Stack traces (14.95 KB, text/plain)
2008-01-22 21:20 UTC, Jesse Glick
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2008-01-22 21:19:44 UTC
Starting with recent dev builds (I am using 080121), this NPE is thrown routinely in the IDE, especially when I open
text files, etc. Presumably some problem with my old settings, but did not go away just by deleting
$userdir/config/Editors. Potential 6.0 settings compatibility bug.
Comment 1 Jesse Glick 2008-01-22 21:20:27 UTC
Created attachment 55405 [details]
Stack traces
Comment 2 Jesse Glick 2008-01-22 21:56:46 UTC
I think I've found a fix for it, but please review. For whatever reason, a MIME path had no Preferences instance in it.
When I fixed the getter, I found I also had to fix the setter (so I put in a warning), but then I did not get the setter
problem again, so I am not sure what to say.

Checking in editor/src/org/netbeans/modules/editor/options/BaseOptions.java;
/shared/data/ccvs/repository/editor/src/org/netbeans/modules/editor/options/BaseOptions.java,v  <--  BaseOptions.java
new revision: 1.161; previous revision: 1.160
done
Comment 3 Vitezslav Stejskal 2008-01-23 09:21:02 UTC
Thanks Jesse, the fix looks ok. I mean it would be better to understand why there is no Preferences in MimeLookup, but I
suspect that this is a problem with initialization of MimeLookup that when re-entered may return an empty lookup and it
wouldn't be easy to track down. Also, after eliminating BaseOptions and Settings the initialization should be more
straightforward and we shouldn't have these problems.