test/jdk/java/io/Serializable/sanityCheck/SanityCheck.java
changeset 58565 baa5969ecf34
parent 47216 71c04702a3d5
--- a/test/jdk/java/io/Serializable/sanityCheck/SanityCheck.java	Fri Oct 11 09:43:41 2019 -0700
+++ b/test/jdk/java/io/Serializable/sanityCheck/SanityCheck.java	Fri Oct 11 13:11:56 2019 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -31,6 +31,7 @@
 import java.util.*;
 
 class Item implements Serializable {
+    private static final long serialVersionUID = 1L;
 
     static final int ARRAYLEN = 1000;
     static final int STRLEN = 1000;
@@ -55,6 +56,7 @@
     double[] dary;
 
     String str;
+    @SuppressWarnings("serial")  /* Incorrect declarations are being tested */
     Object[] oary;
 
     Item() {
@@ -86,7 +88,7 @@
             fary[i] = rand.nextFloat();
             jary[i] = rand.nextLong();
             dary[i] = rand.nextDouble();
-            oary[i] = new Integer(rand.nextInt());
+            oary[i] = rand.nextInt();
         }
 
         char[] strChars = new char[STRLEN];
@@ -126,6 +128,11 @@
 
         return true;
     }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(i, j);
+    }
 }
 
 public class SanityCheck {