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.
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)
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.
Reassigning to java module.
Radek, what's a "VoidValue" ? getAttribute() is supposed to return null if there's no attribute or error deserializing it, isn't it ?
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() ?
Supposedly fixed in trunk: /cvs/java/src/org/netbeans/modules/java/JavaDataObject.java,v <-- JavaDataObject.java new revision: 1.148; previous revision: 1.147
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.
VERIFIED
Resolved for 3.4.x or earlier, no new info since then -> closing.