Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4147326
Votes 0
Synopsis Doclet API: Need serialVersionUID to be included in Serialized Form page
Category java:javadoctool
Reported Against 1.2beta4
Release Fixed
State 11-Closed, duplicate of 4422788, request for enhancement
Priority: 5-Very Low
Related Bugs 4422788 , 4525039
Submit Date 10-JUN-1998
Description
The serialVersionUID should be in the Serialized Form generated by 
javadoc standard doclet.

The following method is missing from javadoc.ClassDoc.

  /** 
   * Returns the serialVersionUID for the class represented by ClassDoc.
   * The serialVersionUID is 0L if the class is not Serializable.
   */
  long serialVersionUID();

This capability was not originally implemented due to the complexity involved
in computing the serialVersionUID.  The serialVersionUID is simply the
the special static final member serialVersionUID OR it is computed based on
a complex hash including the signatures of almost all the members of the
class. (Actual computation is in java.io.ObjectStreamClass.computeSerialVersionUID() and it is described
in the Object Serialization Specification.)

Initial attempts to access the static final member serialVersIonUID within
javadoc context were not successful in accessing the value of the static final member serialVersionUID. There exists a chance that the static final members
are not initialized yet in the stage of compilation that javadoc has completed.

This bug report is a record that this feature was not implemented originally.
Work Around
N/A
Evaluation
Robert Field writes:
 > 
 > Joe,
 > 
 > Is this something that must be fixed for 1.2?

Robert,

I am not sure how critical it is or not. My customer for this is
QA. They are just starting to write the serialization tests based on
the generated serialized forms, they might become more insistent that
this be investigated further to see if it really is not doable with
undo performance impact..  I recorded the bug to document this missing
feature and do not have a feel yet on whether it must be fixed or not.
I have a lot of documentation changes, in serialization javadoc and in
the serialization specification, before considering whether there is a
fix for this.

Do you think it is possible to get the value of the special
serialization member, serialVersionUID, a private static final member
within javadoc? It might be good enough if we could implement this
part of serialVersionUID computation for now. I tried once to get the
value using sun.tools.java.MemberDefinition.getValue() and I was not
able to get the value when the class defined a serialVersionUID
member. I assumed that there was a good chance that not enough
of the compilation has taken place to be retrieving constant
values within javadoc, I wanted to confirm this suspicion with you.
I never attempted to research it on my own. 

-Joe


Only the first passes of compilation are done to extract the information
supplied to the javadoc API.  I do not believe that compilation has
progressed far enough to be able to compute this information.

  xxxxx@xxxxx   1998-06-16

Its not clear that this will be any different in the new compiler.

  xxxxx@xxxxx   2000-12-13
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang