Fri, 12 Sep 2014 16:07:44 +0200
8058304: Non-serializable fields in serializable classes
Reviewed-by: lagergren, sundar
1.1 --- a/src/jdk/nashorn/internal/parser/Parser.java Fri Sep 12 16:06:12 2014 +0200 1.2 +++ b/src/jdk/nashorn/internal/parser/Parser.java Fri Sep 12 16:07:44 2014 +0200 1.3 @@ -54,6 +54,7 @@ 1.4 import static jdk.nashorn.internal.parser.TokenType.TERNARY; 1.5 import static jdk.nashorn.internal.parser.TokenType.WHILE; 1.6 1.7 +import java.io.Serializable; 1.8 import java.util.ArrayDeque; 1.9 import java.util.ArrayList; 1.10 import java.util.Collections; 1.11 @@ -2977,11 +2978,13 @@ 1.12 * Encapsulates part of the state of the parser, enough to reconstruct the state of both parser and lexer 1.13 * for resuming parsing after skipping a function body. 1.14 */ 1.15 - private static class ParserState { 1.16 + private static class ParserState implements Serializable { 1.17 private final int position; 1.18 private final int line; 1.19 private final int linePosition; 1.20 1.21 + private static final long serialVersionUID = -2382565130754093694L; 1.22 + 1.23 ParserState(final int position, final int line, final int linePosition) { 1.24 this.position = position; 1.25 this.line = line;
2.1 --- a/src/jdk/nashorn/internal/runtime/AccessorProperty.java Fri Sep 12 16:06:12 2014 +0200 2.2 +++ b/src/jdk/nashorn/internal/runtime/AccessorProperty.java Fri Sep 12 16:07:44 2014 +0200 2.3 @@ -119,7 +119,7 @@ 2.4 * produce different boun method handles wrapping the same access mechanism 2.5 * depending on callsite 2.6 */ 2.7 - private MethodHandle[] GETTER_CACHE = new MethodHandle[NOOF_TYPES]; 2.8 + private transient MethodHandle[] GETTER_CACHE = new MethodHandle[NOOF_TYPES]; 2.9 2.10 /** 2.11 * Create a new accessor property. Factory method used by nasgen generated code.
3.1 --- a/src/jdk/nashorn/internal/runtime/Property.java Fri Sep 12 16:06:12 2014 +0200 3.2 +++ b/src/jdk/nashorn/internal/runtime/Property.java Fri Sep 12 16:07:44 2014 +0200 3.3 @@ -101,7 +101,7 @@ 3.4 private final int slot; 3.5 3.6 /** SwitchPoint that is invalidated when property is changed, optional */ 3.7 - protected SwitchPoint changeCallback; 3.8 + protected transient SwitchPoint changeCallback; 3.9 3.10 private static final long serialVersionUID = 2099814273074501176L; 3.11