Summary: | SerialVersionUID generated by Eclipse is different than by JDK/javac | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | edwin steiner <edwin.steiner> |
Component: | Core | Assignee: | JDT-Core-Inbox <jdt-core-inbox> |
Status: | RESOLVED DUPLICATE | QA Contact: | |
Severity: | major | ||
Priority: | P3 | ||
Version: | 2.1 | ||
Target Milestone: | 3.0 M2 | ||
Hardware: | PC | ||
OS: | All | ||
Whiteboard: |
Description
edwin steiner
2003-06-25 08:39:59 EDT
This is normal. Javac generates an extra method to handle the class literal (.class syntax) and the Eclipse compiler doesn't do that. This extra method has a side-effect on the serialVersionUID. This is a known issue between compiler and cannot be fixed. The proper way is to set the serialVersionUID inside the classes that you want to serialize. You can get the same problem between different versions of the same compiler. I will try to find the link that points to this issue on the Sun web site. I would close as WONTFIX. Here is the link. It clearly states that the serialVersionUID should be set http://java.sun.com/j2se/1.3/docs/guide/serialization/spec/class.doc6.html when a class is using inner classes. In your case, it is similar. The class literal code generation generates a new method if you use javac. You can see it by disassembling the resulting .class file. |