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 15827 - Patch permitting viewing of serialized structure
Summary: Patch permitting viewing of serialized structure
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 3.x
Hardware: PC Linux
: P3 blocker (vote)
Assignee: Jesse Glick
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-09-23 17:14 UTC by Jesse Glick
Modified: 2002-01-16 13:21 UTC (History)
0 users

See Also:
Issue Type: TASK
Exception Reporter:


Attachments
Suggested patch (-N, 3 new source files) (37.68 KB, patch)
2001-09-23 17:15 UTC, Jesse Glick
Details | Diff
Build of clazz module with patch included, for convenience (JAR) (178.23 KB, application/octet-stream)
2001-09-23 17:22 UTC, Jesse Glick
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2001-09-23 17:14:29 UTC
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.
Comment 1 Jesse Glick 2001-09-23 17:15:05 UTC
Created attachment 2664 [details]
Suggested patch (-N, 3 new source files)
Comment 2 Jesse Glick 2001-09-23 17:22:11 UTC
Created attachment 2665 [details]
Build of clazz module with patch included, for convenience (JAR)
Comment 3 Jesse Glick 2001-11-13 15:38:19 UTC
Just marking that this is not for 3.3.
Comment 4 Jesse Glick 2001-11-23 15:09:02 UTC
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.
Comment 5 Jesse Glick 2002-01-11 18:31:58 UTC
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. :-)
Comment 6 Tomas Hurka 2002-01-16 10:30:56 UTC
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.  
Comment 7 Jesse Glick 2002-01-16 11:44:35 UTC
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.
Comment 8 Jesse Glick 2002-01-16 13:18:50 UTC
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
Comment 9 Jesse Glick 2002-01-16 13:21:00 UTC
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.