Skip to content

Commit fa2176c

Browse files
committed
8231414: Mark various instance fields of javac internal types as transient
Reviewed-by: jjg
1 parent eb45b79 commit fa2176c

File tree

8 files changed

+16
-16
lines changed

8 files changed

+16
-16
lines changed

src/jdk.compiler/share/classes/com/sun/tools/doclint/DocLint.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public class BadArgs extends Exception {
112112
}
113113

114114
final String code;
115-
final Object[] args;
115+
final transient Object[] args;
116116
}
117117

118118
/**

src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2345,14 +2345,14 @@ default boolean isTerminal() {
23452345

23462346
public static class CompletionFailure extends RuntimeException {
23472347
private static final long serialVersionUID = 0;
2348-
public final DeferredCompletionFailureHandler dcfh;
2349-
public Symbol sym;
2348+
public final transient DeferredCompletionFailureHandler dcfh;
2349+
public transient Symbol sym;
23502350

23512351
/** A diagnostic object describing the failure
23522352
*/
2353-
private JCDiagnostic diag;
2353+
private transient JCDiagnostic diag;
23542354

2355-
private Supplier<JCDiagnostic> diagSupplier;
2355+
private transient Supplier<JCDiagnostic> diagSupplier;
23562356

23572357
public CompletionFailure(Symbol sym, Supplier<JCDiagnostic> diagSupplier, DeferredCompletionFailureHandler dcfh) {
23582358
this.dcfh = dcfh;

src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ public boolean isConvertible(Type t, Type s) {
639639
public static class FunctionDescriptorLookupError extends RuntimeException {
640640
private static final long serialVersionUID = 0;
641641

642-
JCDiagnostic diagnostic;
642+
transient JCDiagnostic diagnostic;
643643

644644
FunctionDescriptorLookupError() {
645645
this.diagnostic = null;
@@ -5002,7 +5002,7 @@ public static abstract class SignatureGenerator {
50025002
public static class InvalidSignatureException extends RuntimeException {
50035003
private static final long serialVersionUID = 0;
50045004

5005-
private final Type type;
5005+
private final transient Type type;
50065006

50075007
InvalidSignatureException(Type type) {
50085008
this.type = type;

src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ public Env<AttrContext> attribStatToTree(JCTree stmt, Env<AttrContext> env, JCTr
443443

444444
private static class BreakAttr extends RuntimeException {
445445
static final long serialVersionUID = -6924771130405446405L;
446-
private Env<AttrContext> env;
446+
private transient Env<AttrContext> env;
447447
private BreakAttr(Env<AttrContext> env) {
448448
this.env = env;
449449
}

src/jdk.compiler/share/classes/com/sun/tools/javac/comp/CompileStates.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -77,7 +77,7 @@ public static CompileState max(CompileState a, CompileState b) {
7777

7878
private static final long serialVersionUID = 1812267524140424433L;
7979

80-
protected Context context;
80+
protected transient Context context;
8181

8282
public CompileStates(Context context) {
8383
this.context = context;

src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Infer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ protected Infer(Context context) {
137137
public static class InferenceException extends InapplicableMethodException {
138138
private static final long serialVersionUID = 0;
139139

140-
List<JCDiagnostic> messages = List.nil();
140+
transient List<JCDiagnostic> messages = List.nil();
141141

142142
InferenceException() {
143143
super(null);
@@ -1321,7 +1321,7 @@ interface GraphStrategy {
13211321
public static class NodeNotFoundException extends RuntimeException {
13221322
private static final long serialVersionUID = 0;
13231323

1324-
InferenceGraph graph;
1324+
transient InferenceGraph graph;
13251325

13261326
public NodeNotFoundException(InferenceGraph graph) {
13271327
this.graph = graph;

src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -1387,7 +1387,7 @@ public MethodCheck mostSpecificCheck(List<Type> actuals) {
13871387
public static class InapplicableMethodException extends RuntimeException {
13881388
private static final long serialVersionUID = 0;
13891389

1390-
JCDiagnostic diagnostic;
1390+
transient JCDiagnostic diagnostic;
13911391

13921392
InapplicableMethodException(JCDiagnostic diag) {
13931393
this.diagnostic = diag;

src/jdk.compiler/share/classes/com/sun/tools/javac/file/Locations.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ private class SearchPath extends LinkedHashSet<Path> {
280280
private static final long serialVersionUID = 0;
281281

282282
private boolean expandJarClassPaths = false;
283-
private final Set<Path> canonicalValues = new HashSet<>();
283+
private final transient Set<Path> canonicalValues = new HashSet<>();
284284

285285
public SearchPath expandJarClassPaths(boolean x) {
286286
expandJarClassPaths = x;
@@ -290,7 +290,7 @@ public SearchPath expandJarClassPaths(boolean x) {
290290
/**
291291
* What to use when path element is the empty string
292292
*/
293-
private Path emptyPathDefault = null;
293+
private transient Path emptyPathDefault = null;
294294

295295
public SearchPath emptyPathDefault(Path x) {
296296
emptyPathDefault = x;

0 commit comments

Comments
 (0)