Skip to content

Commit c86e4dd

Browse files
Closure Teamcopybara-github
Closure Team
authored andcommitted
Delete code containing java deserialization
PiperOrigin-RevId: 725354611
1 parent 49d9559 commit c86e4dd

File tree

2 files changed

+0
-35
lines changed

2 files changed

+0
-35
lines changed

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

-7
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
import com.google.javascript.rhino.Node;
4444
import com.google.javascript.rhino.SourcePosition;
4545
import java.io.IOException;
46-
import java.io.InputStream;
4746
import java.io.ObjectInputStream;
4847
import java.io.ObjectOutputStream;
4948
import java.io.OutputStream;
@@ -2783,12 +2782,6 @@ public void serialize(OutputStream objectOutputStream) throws IOException {
27832782
new ObjectOutputStream(objectOutputStream).writeObject(this);
27842783
}
27852784

2786-
/** Deserializes compiler options from a stream. */
2787-
public static CompilerOptions deserialize(InputStream objectInputStream)
2788-
throws IOException, ClassNotFoundException {
2789-
return (CompilerOptions) new ObjectInputStream(objectInputStream).readObject();
2790-
}
2791-
27922785
public void setStrictMessageReplacement(boolean strictMessageReplacement) {
27932786
this.strictMessageReplacement = strictMessageReplacement;
27942787
}

test/com/google/javascript/jscomp/CompilerOptionsTest.java

-28
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
package com.google.javascript.jscomp;
1818

1919
import static com.google.common.truth.Truth.assertThat;
20-
import static java.nio.charset.StandardCharsets.US_ASCII;
2120

2221
import com.google.common.collect.ImmutableMap;
2322
import com.google.javascript.jscomp.CompilerOptions.BrowserFeaturesetYear;
@@ -26,8 +25,6 @@
2625
import com.google.javascript.jscomp.parsing.parser.FeatureSet.Feature;
2726
import com.google.javascript.rhino.Node;
2827
import com.google.javascript.rhino.Token;
29-
import java.io.ByteArrayInputStream;
30-
import java.io.ByteArrayOutputStream;
3128
import java.util.regex.Pattern;
3229
import org.junit.Test;
3330
import org.junit.runner.RunWith;
@@ -157,31 +154,6 @@ public void testEmitUseStrictWorksInEs3() {
157154
assertThat(options.shouldEmitUseStrict()).isTrue();
158155
}
159156

160-
@Test
161-
public void testSerialization() throws Exception {
162-
CompilerOptions options = new CompilerOptions();
163-
options.setDefineToBooleanLiteral("trueVar", true);
164-
options.setDefineToBooleanLiteral("falseVar", false);
165-
options.setDefineToNumberLiteral("threeVar", 3);
166-
options.setDefineToStringLiteral("strVar", "str");
167-
options.setAmbiguateProperties(false);
168-
options.setOutputCharset(US_ASCII);
169-
170-
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
171-
options.serialize(byteArrayOutputStream);
172-
173-
options =
174-
CompilerOptions.deserialize(new ByteArrayInputStream(byteArrayOutputStream.toByteArray()));
175-
176-
ImmutableMap<String, Node> actual = options.getDefineReplacements();
177-
assertEquivalent(new Node(Token.TRUE), actual.get("trueVar"));
178-
assertEquivalent(new Node(Token.FALSE), actual.get("falseVar"));
179-
assertEquivalent(Node.newNumber(3), actual.get("threeVar"));
180-
assertEquivalent(Node.newString("str"), actual.get("strVar"));
181-
assertThat(options.shouldAmbiguateProperties()).isFalse();
182-
assertThat(options.getOutputCharset()).isEqualTo(US_ASCII);
183-
}
184-
185157
@Test
186158
public void testRemoveRegexFromPath() {
187159
CompilerOptions options = new CompilerOptions();

0 commit comments

Comments
 (0)