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.
Please consider the attached patch for the next version of the clazz module (after the upcoming feature freeze that is). It affects *.ser files: in addition to showing the class hierarchy of the serialized bean (which I normally find pretty useless BTW, in contrast to *.class), it displays a structural view of the actual serialized contents. For this purpose there is a parser which understands the raw Java serialization format. This can be very helpful in debugging .ser files which would otherwise be "opaque". As an additional feature, NbMarshalledObject instances are shown as a substream (otherwise just a meaningless byte[] would be visible). Things missing from this patch: - check code for XXX comments; e.g. support for "exception" and "reset" typecodes not implemented; I'm not sure who uses these or what they are supposed to do; similarly missing support for serialized proxies and a couple of other rarer things - localization in a couple of places: "Serialized stream", "instance of ...". Most nodes names need no localization as they are designed to match Java language constructs. - nice icons for the nodes (currently no icons are used) - possibly, support for changing the structure and having the result written out to disk - reparsing after change of *.ser on disk - visual marking of shared object identities (references); currently node hierarchy shows duplicate trees when object references are used more than once, with no hint the objects are identical - more helpful error recovery - ability to try to really deserialize specific objects in the stream (perhaps by constructing a fresh stream rooted at that object with the proper object graph) so that e.g. Object.toString() could be added as information to the node; must be careful here for security reasons Despite the above bugs/limitations it is currently good enough to view regular NetBeans serialized settings and find out what is in them.
Created attachment 2664 [details] Suggested patch (-N, 3 new source files)
Created attachment 2665 [details] Build of clazz module with patch included, for convenience (JAR)
Just marking that this is not for 3.3.
Should be possible to put this in the trunk if you like it. Let me know if you want a more up-to-date patch, I have probably made a couple changes since it was filed.
Haven't heard any objections and it hasn't been applied, so I will deal with it if there are no problems. Getting sick of having the local patch in my CVS tree. :-)
Jesse, you can put it into trunk yourself. I had not time to do detailed review it, but at the first sight it looks fine to me. Thanks and sorry for letting you wait so long for approval.
OK, I will check for I18N and make a couple of placeholder icons and check it in. Also will add an entry for features list of clazz.
In directory clazz: committed * Up-To-Date 1.3 clazz/.cvsignore committed * Up-To-Date 1.23 clazz/build.xml In directory clazz/src: In directory clazz/src/org: In directory clazz/src/org/netbeans: In directory clazz/src/org/netbeans/modules: In directory clazz/src/org/netbeans/modules/clazz: committed * Up-To-Date 1.18 clazz/src/org/netbeans/modules/clazz/Bundle.properties committed * Up-To-Date 1.37 clazz/src/org/netbeans/modules/clazz/ClassDataNode.java committed * Up-To-Date 1.16 clazz/src/org/netbeans/modules/clazz/SerDataNode.java added * Up-To-Date 1.1 clazz/src/org/netbeans/modules/clazz/SerParser.java added * Up-To-Date 1.1 clazz/src/org/netbeans/modules/clazz/SerStructureNode.java added * Up-To-Date 1.1 clazz/src/org/netbeans/modules/clazz/SerTopChildren.java In directory clazz/src/org/netbeans/modules/clazz/resources: added * Up-To-Date 1.1 clazz/src/org/netbeans/modules/clazz/resources/serAlone.gif In directory clazz/www: In directory clazz/www/plans: added * Up-To-Date 1.1 clazz/www/plans/features.xml
Forgot to mention: did I18N and icons; other points not addressed yet. If I have any free time I may improve some things, e.g. reload stream when changed on disk.