8231557: Suppress warnings on non-serializable instance fields in jdk.scripting.nashorn module
authordarcy
Fri, 27 Sep 2019 08:57:25 -0700
changeset 58379 8511c662083b
parent 58378 98ea90226198
child 58384 9a3a700ca571
8231557: Suppress warnings on non-serializable instance fields in jdk.scripting.nashorn module Reviewed-by: jlaskey
src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/Property.java
src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/RecompilableScriptFunctionData.java
src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/SharedPropertyMap.java
src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/StoredScript.java
--- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/Property.java	Fri Sep 27 14:43:35 2019 +0100
+++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/Property.java	Fri Sep 27 08:57:25 2019 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 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
@@ -103,6 +103,7 @@
     public static final int IS_ACCESSOR_PROPERTY    = 1 << 12;
 
     /** Property key. */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     private final Object key;
 
     /** Property flags. */
--- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/RecompilableScriptFunctionData.java	Fri Sep 27 14:43:35 2019 +0100
+++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/RecompilableScriptFunctionData.java	Fri Sep 27 08:57:25 2019 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 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
@@ -118,11 +118,13 @@
      * Opaque object representing parser state at the end of the function. Used when reparsing outer function
      * to help with skipping parsing inner functions.
      */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     private final Object endParserState;
 
     /** Code installer used for all further recompilation/specialization of this ScriptFunction */
     private transient CodeInstaller installer;
 
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     private final Map<Integer, RecompilableScriptFunctionData> nestedFunctions;
 
     /** Id to parent function if one exists */
@@ -135,8 +137,10 @@
 
     private transient DebugLogger log;
 
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     private final Map<String, Integer> externalScopeDepths;
 
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     private final Set<String> internalSymbols;
 
     private static final int GET_SET_PREFIX_LENGTH = "*et ".length();
--- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/SharedPropertyMap.java	Fri Sep 27 14:43:35 2019 +0100
+++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/SharedPropertyMap.java	Fri Sep 27 08:57:25 2019 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -40,6 +40,7 @@
  */
 public final class SharedPropertyMap extends PropertyMap {
 
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     private SwitchPoint switchPoint;
 
     private static final long serialVersionUID = 2166297719721778876L;
--- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/StoredScript.java	Fri Sep 27 14:43:35 2019 +0100
+++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/StoredScript.java	Fri Sep 27 08:57:25 2019 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 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
@@ -42,12 +42,15 @@
     private final String mainClassName;
 
     /** Map of class names to class bytes. */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     private final Map<String, byte[]> classBytes;
 
     /** Constants array. */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     private final Object[] constants;
 
     /** Function initializers */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     private final Map<Integer, FunctionInitializer> initializers;
 
     private static final long serialVersionUID = 2958227232195298340L;