Skip to content

Commit 5cfd2ec

Browse files
graememorganError Prone Team
authored andcommitted
Work around a JDK head crash.
PiperOrigin-RevId: 780588828
1 parent 1eb5a71 commit 5cfd2ec

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

check_api/src/main/java/com/google/errorprone/JavacErrorDescriptionListener.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import com.sun.tools.javac.util.Log;
3333
import java.io.IOException;
3434
import java.io.UncheckedIOException;
35+
import java.util.EnumSet;
3536
import java.util.HashMap;
3637
import java.util.List;
3738
import java.util.Map;
@@ -119,7 +120,8 @@ public void onDescribed(Description description) {
119120
factory.create(
120121
type,
121122
/* lintCategory */ null,
122-
DIAGNOSTIC_FLAGS,
123+
// Make a defensive copy, as JDK at head mutates its arguments.
124+
EnumSet.copyOf(DIAGNOSTIC_FLAGS),
123125
log.currentSource(),
124126
pos,
125127
MESSAGE_BUNDLE_KEY,

0 commit comments

Comments
 (0)