Skip to content

Commit 15bca9d

Browse files
lauraharkercopybara-github
authored andcommitted
Remove java.io.Serializable from CompilerOptions.
This isn't used internally at Google and we don't really want to support it - we plan to do any new serialization via other formats like proto, instead of relying on the Java serializer. PiperOrigin-RevId: 727090850
1 parent c0193c4 commit 15bca9d

File tree

1 file changed

+1
-24
lines changed

1 file changed

+1
-24
lines changed

src/com/google/javascript/jscomp/CompilerOptions.java

+1-24
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,6 @@
4242
import com.google.javascript.rhino.IR;
4343
import com.google.javascript.rhino.Node;
4444
import com.google.javascript.rhino.SourcePosition;
45-
import java.io.IOException;
46-
import java.io.ObjectInputStream;
47-
import java.io.ObjectOutputStream;
48-
import java.io.OutputStream;
49-
import java.io.Serializable;
5045
import java.nio.charset.Charset;
5146
import java.nio.file.Path;
5247
import java.util.ArrayList;
@@ -58,7 +53,7 @@
5853
import org.jspecify.annotations.Nullable;
5954

6055
/** Compiler options */
61-
public class CompilerOptions implements Serializable {
56+
public class CompilerOptions {
6257
// The number of characters after which we insert a line break in the code
6358
static final int DEFAULT_LINE_LENGTH_THRESHOLD = 500;
6459

@@ -2777,11 +2772,6 @@ public void setChunkOutputType(ChunkOutputType chunkOutputType) {
27772772
this.chunkOutputType = chunkOutputType;
27782773
}
27792774

2780-
/** Serializes compiler options to a stream. */
2781-
public void serialize(OutputStream objectOutputStream) throws IOException {
2782-
new ObjectOutputStream(objectOutputStream).writeObject(this);
2783-
}
2784-
27852775
public void setStrictMessageReplacement(boolean strictMessageReplacement) {
27862776
this.strictMessageReplacement = strictMessageReplacement;
27872777
}
@@ -3360,19 +3350,6 @@ public char[] getPropertyReservedNamingNonFirstChars() {
33603350
return reservedChars;
33613351
}
33623352

3363-
private void writeObject(ObjectOutputStream out) throws IOException {
3364-
out.defaultWriteObject();
3365-
out.writeObject(outputCharset == null ? null : outputCharset.name());
3366-
}
3367-
3368-
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
3369-
in.defaultReadObject();
3370-
String outputCharsetName = (String) in.readObject();
3371-
if (outputCharsetName != null) {
3372-
outputCharset = Charset.forName(outputCharsetName);
3373-
}
3374-
}
3375-
33763353
boolean shouldOptimize() {
33773354
return !skipNonTranspilationPasses
33783355
&& !checksOnly

0 commit comments

Comments
 (0)