creating a .class file

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • andthen

    creating a .class file

    If I have a Class object, serialized or somehow stored, is there any way I
    can use it to create a .class file?


  • Jolly Roger

    #2
    Re: creating a .class file

    No: look at Class.java source. Even if Class object is serializable, it is
    not really serialized:

    /**
    * Class Class is special cased within the Serialization Stream
    Protocol.
    *
    * A Class instance is written intially into an ObjectOutputStr eam in
    the
    * following format:
    * <pre>
    * <code>TC_CLAS S</code> ClassDescriptor
    * A ClassDescriptor is a special cased serialization of
    * a <code>java.io.O bjectStreamClas s</code> instance.
    * </pre>
    * A new handle is generated for the initial time the class descriptor
    * is written into the stream. Future references to the class descriptor
    * are written as references to the initial class descriptor instance.
    *
    * @see java.io.ObjectS treamClass
    */
    private static final ObjectStreamFie ld[] serialPersisten tFields =
    ObjectStreamCla ss.NO_FIELDS;

    You still need the .class file.

    regards,
    ~Luigi

    +#if defined(__alpha __) && defined(CONFIG_ PCI)
    + /*
    + * The meaning of life, the universe, and everything. Plus
    + * this makes the year come out right.
    + */
    + year -= 42;
    +#endif
    (From the patch for 1.3.2: (kernel/time.c), submitted by Marcus Meissner)

    "andthen" <a@n.d> ha scritto nel messaggio
    news:cV%wc.4369 $IQ2.3150006@ne ws4.srv.hcvlny. cv.net...[color=blue]
    > If I have a Class object, serialized or somehow stored, is there any way I
    > can use it to create a .class file?
    >
    >[/color]


    Comment

    Working...