8231414: Mark various instance fields of javac internal types as transient
Reviewed-by: jjg
diff --git a/src/jdk.compiler/share/classes/com/sun/tools/doclint/DocLint.java b/src/jdk.compiler/share/classes/com/sun/tools/doclint/DocLint.java
index b491736..f0e5769 100644
--- a/src/jdk.compiler/share/classes/com/sun/tools/doclint/DocLint.java
+++ b/src/jdk.compiler/share/classes/com/sun/tools/doclint/DocLint.java
@@ -112,7 +112,7 @@
}
final String code;
- final Object[] args;
+ final transient Object[] args;
}
/**
diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java
index e423f12..7e77dc5 100644
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java
@@ -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;
diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java
index 54012a6..8ca281c 100644
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java
@@ -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;
diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java
index 0fc6264..429bb30 100644
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java
@@ -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;
}
diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/CompileStates.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/CompileStates.java
index 686dd9f..12ef97d 100644
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/CompileStates.java
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/CompileStates.java
@@ -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;
diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Infer.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Infer.java
index c317a59..a5cff44 100644
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Infer.java
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Infer.java
@@ -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;
diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java
index f0de66d..686f623 100644
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java
@@ -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;
diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/file/Locations.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/file/Locations.java
index 8c40582..2a14060 100644
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/file/Locations.java
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/file/Locations.java
@@ -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;