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 17680 - ClassCastException on UPDATE PARSER DATABASE
Summary: ClassCastException on UPDATE PARSER DATABASE
Status: CLOSED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 3.x
Hardware: PC Windows 3.1/NT
: P3 blocker (vote)
Assignee: issues@java
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-11-14 19:53 UTC by _ gtzabari
Modified: 2007-09-26 09:14 UTC (History)
2 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 _ gtzabari 2001-11-14 19:53:10 UTC
dev build 200111120100
Sun JDK 1.3.1

While running UPDATE PARSER DATABASE I got the following:

Wed Nov 14 14:49:53 EST 2001: java.lang.ClassCastException: Posted StackTrace
Annotation: Exception occurred in Request Processor
Nested annotation: org.openide.filesystems.MultiFileObject$VoidValue
org.openide.util.RequestProcessor$Holder: Posted StackTrace(task 
org.netbeans.modules.java.parser.ParsingSupport$Processor@59d7ac [-1232, 1, -1])
        at org.openide.util.RequestProcessor$Holder.fillInStackTrace
(RequestProcessor.java:300)
        at java.lang.Throwable.<init>(Throwable.java:90)
        at java.lang.Exception.<init>(Exception.java:38)
        at org.openide.util.RequestProcessor$Holder.<init>
(RequestProcessor.java:280)
        at org.openide.util.RequestProcessor$Task.createHolder
(RequestProcessor.java:333)
        at org.openide.util.RequestProcessor.post(RequestProcessor.java:100)
        at org.openide.util.RequestProcessor.post(RequestProcessor.java:84)
        at org.netbeans.modules.java.parser.ParsingSupport.addRequest
(ParsingSupport.java:787)
        at org.netbeans.modules.java.parser.ParsingSupport.parse
(ParsingSupport.java:201)
        at org.netbeans.modules.java.parser.ParsingSupport.parse
(ParsingSupport.java:162)
        at org.netbeans.modules.java.parser.SourceImplProxy.findModelDelegate
(SourceImplProxy.java:289)
        at 
org.netbeans.modules.java.parser.SourceImplProxy.safeFindModelDelegate
(SourceImplProxy.java:302)
        at org.netbeans.modules.java.parser.SourceImplProxy.getAllClasses
(SourceImplProxy.java:161)
        at org.openide.src.SourceElement.getAllClasses(SourceElement.java:242)
        at org.netbeans.modules.editor.java.JCUpdater.appendSource
(JCUpdater.java:216)
        at org.netbeans.modules.editor.java.JCUpdater.updateProvider
(JCUpdater.java:357)
        at org.netbeans.modules.editor.java.JCUpdater.processNode
(JCUpdater.java:168)
        at org.netbeans.modules.editor.java.JCUpdater.run(JCUpdater.java:110)
        at org.netbeans.modules.editor.java.JCUpdateAction.performAction
(JCUpdateAction.java:61)
        at org.openide.util.actions.NodeAction.performAction
(NodeAction.java:130)
        at org.openide.util.actions.NodeAction.actionPerformed
(NodeAction.java:121)
        at org.netbeans.core.ModuleActions$1.run(ModuleActions.java:105)
        at org.openide.util.Task.run(Task.java:152)
[catch] at org.openide.util.RequestProcessor$ProcessorThread.run
(RequestProcessor.java:622)
 
Wed Nov 14 14:49:53 EST 2001: java.lang.ClassCastException: 
org.openide.filesystems.MultiFileObject$VoidValue
java.lang.ClassCastException: org.openide.filesystems.MultiFileObject$VoidValue
        at 
org.netbeans.modules.java.JavaDataObject$PersistentConnectionSupport.readDepende
ncies(JavaDataObject.java:1291)
        at org.netbeans.modules.java.codesync.SourceConnectionSupport.loadModel
(SourceConnectionSupport.java:280)
        at 
org.netbeans.modules.java.codesync.SourceConnectionSupport.refreshLinks
(SourceConnectionSupport.java:333)
        at 
org.netbeans.modules.java.codesync.SourceConnectionSupport.handleStatusChange
(SourceConnectionSupport.java:409)
        at 
org.netbeans.modules.java.codesync.SourceConnectionSupport.propertyChange
(SourceConnectionSupport.java:318)
        at org.netbeans.modules.java.parser.SourceImplProxy.propertyChange
(SourceImplProxy.java:326)
        at java.beans.PropertyChangeSupport.firePropertyChange
(PropertyChangeSupport.java:152)
        at java.beans.PropertyChangeSupport.firePropertyChange
(PropertyChangeSupport.java:178)
        at org.netbeans.modules.java.parser.ParsingSupport.changeStatus
(ParsingSupport.java:291)
        at org.netbeans.modules.java.parser.ParsingSupport$Processor.complete
(ParsingSupport.java:669)
        at org.netbeans.modules.java.parser.ParsingSupport$Processor.run
(ParsingSupport.java:600)
        at org.openide.util.Task.run(Task.java:152)
[catch] at org.openide.util.RequestProcessor$ProcessorThread.run
(RequestProcessor.java:622)
Comment 1 _ gtzabari 2001-11-14 20:04:05 UTC
Repro hints

1) I'm running off a JavaCVS FS
2) If I use UPDATE PARSER off /WEB-INF/CLASSES, everything works fine 
but if I try the same thing off the /WEB-INF object, it dies with the 
specified exception.

This is 100% reproducible.
Comment 2 Martin Roskanin 2001-11-15 11:37:59 UTC
Reassigning to java module.
Comment 3 Svata Dedic 2001-11-15 13:30:29 UTC
Radek, what's a "VoidValue" ? getAttribute() is supposed to return
null if there's no attribute or error deserializing it, isn't it ?
Comment 4 Svata Dedic 2001-11-15 14:08:14 UTC
Radek, I take it that although javadoc says that I should get "null"
for a non-existent attribute, I can get some alien instance if the
DataObject is on a multifilesystem. So any code using getAttribute()
should use instanceof to ensure the returned value is the correct
datatype and ingore the rest. Could you, please, add this warning to
the javadoc of FileObject.getAttribute() ?
Comment 5 Svata Dedic 2001-11-15 14:21:42 UTC
Supposedly fixed in trunk:
/cvs/java/src/org/netbeans/modules/java/JavaDataObject.java,v  <-- 
JavaDataObject.java
new revision: 1.148; previous revision: 1.147
Comment 6 rmatous 2001-11-15 14:49:03 UTC
MultiFileObject was intended to return null (not VoidValue). So after 
mfo.setAttribute ("attr", null) should mfo.getAttribute ("attr") 
return null. But mfo delegates to mfo1 and mfo1 may delegate to mfo2. 
If you call mfo1/mfo2.getAttribute ("attr") you get VoidValue. This 
is current design. 

Documentation shouldn`t have such disclaimer. Everybody would 
probably prefer if null value would be returned instead of 
VoidValue :-).

Also I think that nobody should rely on type of attribute. Attributes 
are attached to FileObject (that is mostly shared) and not to some 
piece of code. Anybody who has access to your FileObject can change 
attribute and its type. 
Comment 7 Jan Becicka 2002-06-27 15:49:42 UTC
VERIFIED
Comment 8 Quality Engineering 2003-07-01 13:19:43 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.