|
|
Should the "Include debug info" switch affect the serialVersionUID? |
| John McGrath wrote:
It should not, but I can tell you what is happening. When the class is compiled with debug, JBuilder generates code to initialize member variables that are initialized to compile-time constants. This affects the Serialization Version UID for the class, since it creates a static initializer block. This will only occur for classes where all of the static final variables are initialized with compile-time constants. I have a work-around that will eliminate the problem for you. If you create a static, non-final variable with an initializer, it should always create the static initializer, so the Serialization Version UID will be the same whether or not you compile with debug information. For example, add the the following to your class.
private static int DUMMY = 1;
The other thing you can do is to explicitly specify the Serialization
Version UID for the class. Although I am not that familiar with the
issues concerning serialization in CORBA, doing this is critical when
you store serialized versions of classes and may need to deserialize
them with a modified version of the class.
| |
| See also: 2001-Jul-09 2:28pm gyles19@visi.com | |
See also this Borland FAQ:http://community.borland.com/article/0,1410,27558,00.html 2001-Aug-09 6:58pm gyles19@visi.com | |
| [Append to This Answer] | |
| 2001-Aug-09 6:58pm |
| Previous: |
|
| Next: |
|
| ||||||||
|
Java Community
Java Tools |
Code Central JB OpenTools |
Community Recent Threads |
Borland Chat Chat FAQ |
||||||||||||||
|
Feature Matrices 3.0 | 3.5 | 4.0 5.0 | 6.0 | 7.0 |
Shop for JBuilder |
JBuilder Downloads and reg keys |
Report Piracy | ||||||||||||||
|
Online Manuals 4.0 | 5.0 | 6.0 7.0 |
Borland DevSupport's Bug/RFE Form Quality Central Client |
JB Patches & Updates |
JBuilder FAQs TIs | ||||||||||||||
|
JBuilder Newsgroups |
Tamaracka's News Archive |
Mr. Haki's JBuilder Machine |
JGuru's JBuilder FAQ |
||||||||||||||
|
Sun's Bug Parade |
|||||||||||||||||
|
|||||||||||||||||