test/jdk/java/io/Serializable/skipToEndOfBlockData/SkipToEndOfBlockData.java
changeset 58565 baa5969ecf34
parent 47216 71c04702a3d5
--- a/test/jdk/java/io/Serializable/skipToEndOfBlockData/SkipToEndOfBlockData.java	Fri Oct 11 09:43:41 2019 -0700
+++ b/test/jdk/java/io/Serializable/skipToEndOfBlockData/SkipToEndOfBlockData.java	Fri Oct 11 13:11:56 2019 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,6 +32,8 @@
 import java.io.*;
 
 class MismatchedRead implements Serializable {
+    private static final long serialVersionUID = 1L;
+
     int i;
     float f;
 
@@ -59,9 +61,15 @@
         MismatchedRead other = (MismatchedRead) obj;
         return (i == other.i && f == other.f);
     }
+
+    public int hashCode() {
+        return i;
+    }
 }
 
 class MismatchedReadExternal implements Externalizable {
+    private static final long serialVersionUID = 1L;
+
     int i;
     float f;
 
@@ -91,9 +99,15 @@
         MismatchedReadExternal other = (MismatchedReadExternal) obj;
         return (i == other.i && f == other.f);
     }
+
+    public int hashCode() {
+        return i;
+    }
 }
 
 class InnocentBystander implements Serializable {
+    private static final long serialVersionUID = 1L;
+
     String s;
 
     InnocentBystander(String s) {
@@ -108,6 +122,10 @@
             return s.equals(other.s);
         return (s == other.s);
     }
+
+    public int hashCode() {
+        return s.hashCode();
+    }
 }
 
 public class SkipToEndOfBlockData {