commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r429413 - in /jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang: builder/ exception/ math/ time/
Date Mon, 07 Aug 2006 17:57:26 GMT
Author: ggregory
Date: Mon Aug  7 10:57:25 2006
New Revision: 429413

URL: http://svn.apache.org/viewvc?rev=429413&view=rev
Log:
Adds missing serialVersionUID to Serializable classes. 

A note from http://wiki.eclipse.org/index.php/FAQ_Why_does_the_Eclipse_compiler_create_a_different_serialVersionUID_from_javac%3F:

If you don’t explicitly define a serialVersionUID, the language requires that the VM generate
one, using some function of all field and method names in the class. The problem is, the compiler
generates some synthetic methods that you never see in your source file, and there is no clear
specification for how these synthetic method names are generated. Any two compilers are likely
to generate different method names, and so the serialVersionUID will be different. Bottom
line: Always define the serialVersionUID explicitly in your source files.

Modified:
    jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/StandardToStringStyle.java
    jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/ToStringStyle.java
    jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/NestableDelegate.java
    jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/NestableError.java
    jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/NestableException.java
    jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/NestableRuntimeException.java
    jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/math/JVMRandom.java
    jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/FastDateFormat.java

Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/StandardToStringStyle.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/StandardToStringStyle.java?rev=429413&r1=429412&r2=429413&view=diff
==============================================================================
--- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/StandardToStringStyle.java
(original)
+++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/StandardToStringStyle.java
Mon Aug  7 10:57:25 2006
@@ -32,6 +32,8 @@
  */
 public class StandardToStringStyle extends ToStringStyle {
     
+    private static final long serialVersionUID = 1L;
+
     /**
      * <p>Constructor.</p>
      */

Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/ToStringStyle.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/ToStringStyle.java?rev=429413&r1=429412&r2=429413&view=diff
==============================================================================
--- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/ToStringStyle.java
(original)
+++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/ToStringStyle.java
Mon Aug  7 10:57:25 2006
@@ -1981,6 +1981,8 @@
      */
     private static final class DefaultToStringStyle extends ToStringStyle {
 
+        private static final long serialVersionUID = 1L;
+
         /**
          * <p>Constructor.</p>
          *
@@ -2012,6 +2014,8 @@
      */
     private static final class NoFieldNameToStringStyle extends ToStringStyle {
 
+        private static final long serialVersionUID = 1L;
+
         /**
          * <p>Constructor.</p>
          *
@@ -2044,6 +2048,8 @@
      */
     private static final class ShortPrefixToStringStyle extends ToStringStyle {
 
+        private static final long serialVersionUID = 1L;
+
         /**
          * <p>Constructor.</p>
          *
@@ -2074,6 +2080,8 @@
      */
     private static final class SimpleToStringStyle extends ToStringStyle {
 
+        private static final long serialVersionUID = 1L;
+
         /**
          * <p>Constructor.</p>
          *
@@ -2107,6 +2115,8 @@
      * <code>StandardToStringStyle</code> to ensure its immutability.</p>
      */
     private static final class MultiLineToStringStyle extends ToStringStyle {
+
+        private static final long serialVersionUID = 1L;
 
         /**
          * <p>Constructor.</p>

Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/NestableDelegate.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/NestableDelegate.java?rev=429413&r1=429412&r2=429413&view=diff
==============================================================================
--- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/NestableDelegate.java
(original)
+++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/NestableDelegate.java
Mon Aug  7 10:57:25 2006
@@ -45,6 +45,8 @@
  */
 public class NestableDelegate implements Serializable {
 
+    private static final long serialVersionUID = 1L;
+
     /**
      * Constructor error message.
      */

Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/NestableError.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/NestableError.java?rev=429413&r1=429412&r2=429413&view=diff
==============================================================================
--- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/NestableError.java
(original)
+++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/NestableError.java
Mon Aug  7 10:57:25 2006
@@ -28,6 +28,8 @@
  */
 public class NestableError extends Error implements Nestable {
 
+    private static final long serialVersionUID = 1L;
+
     /**
      * The helper instance which contains much of the code which we
      * delegate to.

Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/NestableException.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/NestableException.java?rev=429413&r1=429412&r2=429413&view=diff
==============================================================================
--- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/NestableException.java
(original)
+++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/NestableException.java
Mon Aug  7 10:57:25 2006
@@ -88,6 +88,8 @@
  */
 public class NestableException extends Exception implements Nestable {
     
+    private static final long serialVersionUID = 1L;
+
     /**
      * The helper instance which contains much of the code which we
      * delegate to.

Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/NestableRuntimeException.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/NestableRuntimeException.java?rev=429413&r1=429412&r2=429413&view=diff
==============================================================================
--- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/NestableRuntimeException.java
(original)
+++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/NestableRuntimeException.java
Mon Aug  7 10:57:25 2006
@@ -32,6 +32,8 @@
  */
 public class NestableRuntimeException extends RuntimeException implements Nestable {
     
+    private static final long serialVersionUID = 1L;
+
     /**
      * The helper instance which contains much of the code which we
      * delegate to.

Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/math/JVMRandom.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/math/JVMRandom.java?rev=429413&r1=429412&r2=429413&view=diff
==============================================================================
--- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/math/JVMRandom.java
(original)
+++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/math/JVMRandom.java
Mon Aug  7 10:57:25 2006
@@ -28,6 +28,8 @@
  */
 public final class JVMRandom extends Random {
 
+    private static final long serialVersionUID = 1L;
+
     /**
      * Ensures that only the constructor can call reseed.
      */

Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/FastDateFormat.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/FastDateFormat.java?rev=429413&r1=429412&r2=429413&view=diff
==============================================================================
--- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/FastDateFormat.java
(original)
+++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/FastDateFormat.java
Mon Aug  7 10:57:25 2006
@@ -78,6 +78,8 @@
     // taking the value and adding (mathematically) the ASCII value for '0'.
     // So, don't change this code! It works and is very fast.
     
+    private static final long serialVersionUID = 1L;
+
     /**
      * FULL locale dependent date or time style.
      */



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message