8231414: Mark various instance fields of javac internal types as transient
Reviewed-by: jjg
--- a/src/jdk.compiler/share/classes/com/sun/tools/doclint/DocLint.java Thu Sep 26 04:20:19 2019 +0200
+++ b/src/jdk.compiler/share/classes/com/sun/tools/doclint/DocLint.java Wed Sep 25 21:26:38 2019 -0700
@@ -112,7 +112,7 @@
}
final String code;
- final Object[] args;
+ final transient Object[] args;
}
/**
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java Thu Sep 26 04:20:19 2019 +0200
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java Wed Sep 25 21:26:38 2019 -0700
@@ -2345,14 +2345,14 @@
public static class CompletionFailure extends RuntimeException {
private static final long serialVersionUID = 0;
- public final DeferredCompletionFailureHandler dcfh;
- public Symbol sym;
+ public final transient DeferredCompletionFailureHandler dcfh;
+ public transient Symbol sym;
/** A diagnostic object describing the failure
*/
- private JCDiagnostic diag;
+ private transient JCDiagnostic diag;
- private Supplier<JCDiagnostic> diagSupplier;
+ private transient Supplier<JCDiagnostic> diagSupplier;
public CompletionFailure(Symbol sym, Supplier<JCDiagnostic> diagSupplier, DeferredCompletionFailureHandler dcfh) {
this.dcfh = dcfh;
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java Thu Sep 26 04:20:19 2019 +0200
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java Wed Sep 25 21:26:38 2019 -0700
@@ -639,7 +639,7 @@
public static class FunctionDescriptorLookupError extends RuntimeException {
private static final long serialVersionUID = 0;
- JCDiagnostic diagnostic;
+ transient JCDiagnostic diagnostic;
FunctionDescriptorLookupError() {
this.diagnostic = null;
@@ -5002,7 +5002,7 @@
public static class InvalidSignatureException extends RuntimeException {
private static final long serialVersionUID = 0;
- private final Type type;
+ private final transient Type type;
InvalidSignatureException(Type type) {
this.type = type;
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java Thu Sep 26 04:20:19 2019 +0200
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java Wed Sep 25 21:26:38 2019 -0700
@@ -443,7 +443,7 @@
private static class BreakAttr extends RuntimeException {
static final long serialVersionUID = -6924771130405446405L;
- private Env<AttrContext> env;
+ private transient Env<AttrContext> env;
private BreakAttr(Env<AttrContext> env) {
this.env = env;
}
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/CompileStates.java Thu Sep 26 04:20:19 2019 +0200
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/CompileStates.java Wed Sep 25 21:26:38 2019 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 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
@@ -77,7 +77,7 @@
private static final long serialVersionUID = 1812267524140424433L;
- protected Context context;
+ protected transient Context context;
public CompileStates(Context context) {
this.context = context;
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Infer.java Thu Sep 26 04:20:19 2019 +0200
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Infer.java Wed Sep 25 21:26:38 2019 -0700
@@ -137,7 +137,7 @@
public static class InferenceException extends InapplicableMethodException {
private static final long serialVersionUID = 0;
- List<JCDiagnostic> messages = List.nil();
+ transient List<JCDiagnostic> messages = List.nil();
InferenceException() {
super(null);
@@ -1321,7 +1321,7 @@
public static class NodeNotFoundException extends RuntimeException {
private static final long serialVersionUID = 0;
- InferenceGraph graph;
+ transient InferenceGraph graph;
public NodeNotFoundException(InferenceGraph graph) {
this.graph = graph;
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java Thu Sep 26 04:20:19 2019 +0200
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java Wed Sep 25 21:26:38 2019 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2018, 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
@@ -1387,7 +1387,7 @@
public static class InapplicableMethodException extends RuntimeException {
private static final long serialVersionUID = 0;
- JCDiagnostic diagnostic;
+ transient JCDiagnostic diagnostic;
InapplicableMethodException(JCDiagnostic diag) {
this.diagnostic = diag;
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/file/Locations.java Thu Sep 26 04:20:19 2019 +0200
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/file/Locations.java Wed Sep 25 21:26:38 2019 -0700
@@ -280,7 +280,7 @@
private static final long serialVersionUID = 0;
private boolean expandJarClassPaths = false;
- private final Set<Path> canonicalValues = new HashSet<>();
+ private final transient Set<Path> canonicalValues = new HashSet<>();
public SearchPath expandJarClassPaths(boolean x) {
expandJarClassPaths = x;
@@ -290,7 +290,7 @@
/**
* What to use when path element is the empty string
*/
- private Path emptyPathDefault = null;
+ private transient Path emptyPathDefault = null;
public SearchPath emptyPathDefault(Path x) {
emptyPathDefault = x;