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 51414 - NullPointerException in InfoUtil.getElementNames
Summary: NullPointerException in InfoUtil.getElementNames
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 4.x
Hardware: PC Windows XP
: P3 blocker with 1 vote (vote)
Assignee: Tomas Hurka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-11 11:34 UTC by mainberg
Modified: 2007-09-26 09:14 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
message.log with asked build information (293.38 KB, text/plain)
2004-11-16 08:04 UTC, mainberg
Details
me to (109.00 KB, text/plain)
2004-11-16 15:27 UTC, herve
Details

Note You need to log in before you can comment on or make changes to this bug.
Description mainberg 2004-11-11 11:34:43 UTC
*********** Exception occurred ************ at 
12:19 PM on Nov 11, 2004
Annotation: Exception occurred in Request 
Processor
java.lang.NullPointerException
	at 
org.netbeans.modules.javacore.parser.InfoUtil.getE
lementNames(InfoUtil.java:75)
	at 
org.netbeans.modules.javacore.parser.EnumInfoMeasu
re.getDistance(EnumInfoMeasure.java:47)
	at 
org.netbeans.modules.javacore.parser.ArrayMapper.g
etDistance(ArrayMapper.java:195)
	at 
org.netbeans.modules.javacore.parser.ArrayMapper.m
apArray(ArrayMapper.java:120)
	at 
org.netbeans.modules.javacore.parser.ArrayMapper.g
etMap(ArrayMapper.java:48)
	at 
org.netbeans.modules.javacore.jmiimpl.javamodel.Se
miPersistentElement.processMembers
(SemiPersistentElement.java:410)
	at 
org.netbeans.modules.javacore.jmiimpl.javamodel.Ja
vaClassImpl.matchPersistent
(JavaClassImpl.java:471)
	at 
org.netbeans.modules.javacore.jmiimpl.javamodel.Se
miPersistentElement.updatePersistent
(SemiPersistentElement.java:278)
	at 
org.netbeans.modules.javacore.jmiimpl.javamodel.Se
miPersistentElement.matchMember
(SemiPersistentElement.java:544)
	at 
org.netbeans.modules.javacore.jmiimpl.javamodel.Se
miPersistentElement.processMembers
(SemiPersistentElement.java:440)
	at 
org.netbeans.modules.javacore.jmiimpl.javamodel.Re
sourceImpl.matchPersistent(ResourceImpl.java:188)
	at 
org.netbeans.modules.javacore.jmiimpl.javamodel.Se
miPersistentElement.updatePersistent
(SemiPersistentElement.java:278)
	at 
org.netbeans.modules.javacore.jmiimpl.javamodel.Re
sourceImpl.updateMetadata(ResourceImpl.java:581)
	at 
org.netbeans.modules.javacore.jmiimpl.javamodel.Re
sourceImpl.directUpdate(ResourceImpl.java:574)
	at 
org.netbeans.modules.javacore.jmiimpl.javamodel.Re
sourceImpl.checkUpToDate(ResourceImpl.java:479)
	at 
org.netbeans.modules.javacore.jmiimpl.javamodel.Re
sourceImpl.checkUpToDate(ResourceImpl.java:465)
	at 
org.netbeans.modules.javacore.jmiimpl.javamodel.Re
sourceImpl.initResource(ResourceImpl.java:366)
	at 
org.netbeans.modules.javacore.jmiimpl.javamodel.Me
tadataElement.initCheck(MetadataElement.java:131)
	at 
org.netbeans.modules.javacore.jmiimpl.javamodel.Se
miPersistentElement.getElementInfo
(SemiPersistentElement.java:144)
	at 
org.netbeans.modules.javacore.jmiimpl.javamodel.Se
miPersistentElement.getInternalForm
(SemiPersistentElement.java:764)
	at 
org.netbeans.modules.javacore.jmiimpl.javamodel.Me
tadataElement.getASTree(MetadataElement.java:444)
	at 
org.netbeans.modules.javacore.jmiimpl.javamodel.Se
miPersistentElement.getParser
(SemiPersistentElement.java:759)
	at 
org.netbeans.modules.javacore.jmiimpl.javamodel.Re
sourceImpl.getFeaturePosition
(ResourceImpl.java:396)
	at 
org.netbeans.modules.javacore.jmiimpl.javamodel.Fe
atureImpl.getPosition(FeatureImpl.java:269)
	at 
org.netbeans.modules.javacore.JMManager.getElement
Position(JMManager.java:732)
	at 
org.netbeans.modules.javacore.JMManager.isElementG
uarded(JMManager.java:574)
	at 
org.netbeans.modules.java.ui.nodes.JavaSourceNodeF
actory.createClassNode
(JavaSourceNodeFactory.java:159)
	at 
org.netbeans.modules.java.ui.nodes.elements.Source
Children.createNodesImpl(SourceChildren.java:206)
	at 
org.netbeans.modules.java.ui.nodes.elements.Source
Children.prepareNodes(SourceChildren.java:350)
	at 
org.netbeans.modules.java.ui.nodes.elements.Childr
enProvider$1.run(ChildrenProvider.java:202)
	at org.openide.util.Mutex.readAccess
(Mutex.java:169)
	at 
org.netbeans.modules.java.ui.nodes.elements.Childr
enProvider.createNodeMap
(ChildrenProvider.java:192)
	at 
org.netbeans.modules.java.ui.nodes.elements.Childr
enProvider.run(ChildrenProvider.java:85)
	at org.openide.util.Task.run
(Task.java:136)
	at 
org.openide.util.RequestProcessor$Task.run
(RequestProcessor.java:330)
[catch] at 
org.openide.util.RequestProcessor$Processor.run
(RequestProcessor.java:686)
Comment 1 Martin Matula 2004-11-15 23:11:22 UTC
What build are you using? Could you please attach the whole IDE log?
Next time please attach the stacktraces as text files (or even better
attach the whole messages.log) instead of pasting them to the issue
description. Otherwise the formatting is screwed and one needs to
scroll a long way down to read other comments. Thanks in advance.
Comment 2 mainberg 2004-11-16 08:04:52 UTC
Created attachment 18913 [details]
message.log with asked build information
Comment 3 Martin Matula 2004-11-16 09:45:33 UTC
Tomas, please evaluate.
Comment 4 herve 2004-11-16 15:27:38 UTC
Created attachment 18925 [details]
me to
Comment 5 Tomas Hurka 2004-12-01 10:42:23 UTC
This is probably caused by enum class, which has syntax error in its constants definition. 
Can you, please attach this enum class, so we can reproduce it. Thanks.
Comment 6 Martin Matula 2005-03-17 16:23:40 UTC
The first issue was occurring in NB4.0beta2 and was never reported again in
newer builds - seems to be fixed.
The second issue (from herve's log) was an issue in clazz module and is also
fixed in the current build.
Comment 7 ben_kelley 2005-08-04 02:52:40 UTC
I encountered this issue with 4.1 (build 200505031930) on Solaris 2.8. It 
would seem to stem from an issue with 
org.netbeans.mdr.storagemodel.StorableObject. (See below)

When this problem happens the method and field names do not appear in the 
Navigator window for the problematic class. Also, if a breakpoint is set in 
that class it is not possible to start the debugger.

Workaround:

I discovered that closing netbeans and clearing the cached files (remove all 
files from $HOME/.netbeans/4.1/var/cache/mdrstorage/org-netbeans-java/0.64) 
gets rid of the error. You get the notice about needing to re-scan the 
classpath on startup, but after that the Navigator and debugging work fine 
(with no exception from getElementNames).

Partial stack:

org.netbeans.mdr.persistence.StorageBadRequestException: Record with key 
D24ED955-F725-11D9-BC4D-BFB1629CAA77:0000000000002F95 already exists
    at org.netbeans.mdr.persistence.btreeimpl.btreestorage.BtreeDatabase.add
(BtreeDatabase.java:651)
    at org.netbeans.mdr.storagemodel.MdrStorage.addObject(MdrStorage.java:746)
    at org.netbeans.mdr.storagemodel.MdrStorage.addInstance
(MdrStorage.java:773)
    at org.netbeans.mdr.storagemodel.StorableObject.addInstance
(StorableObject.java:433)
    at org.netbeans.mdr.storagemodel.StorableObject.<init>
(StorableObject.java:82)
    at org.netbeans.mdr.storagemodel.StorableObject.<init>
(StorableObject.java:65)
Comment 8 Tomas Hurka 2005-08-04 08:18:35 UTC
I do not see how this is related to original error. It is a lot more better to
file separate issue and attach whole ide.log not just partial stack trace. 
Comment 9 Quality Engineering 2007-09-20 10:57:20 UTC
Reorganization of java component