Skip to content

Commit 697931f

Browse files
committed
Clean up now unnecessary @GwtIncompatible from JSCompiler codebase
PiperOrigin-RevId: 707612432
1 parent f465cd7 commit 697931f

19 files changed

+0
-44
lines changed

src/com/google/javascript/jscomp/bundle/CachedTransformer.java

-2
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,11 @@
1616

1717
package com.google.javascript.jscomp.bundle;
1818

19-
import com.google.common.annotations.GwtIncompatible;
2019
import com.google.common.cache.CacheBuilder;
2120
import com.google.common.cache.CacheLoader;
2221
import com.google.common.cache.LoadingCache;
2322

2423
/** A Transformer that caches output from a delegate transformer. */
25-
@GwtIncompatible
2624
public class CachedTransformer implements Source.Transformer {
2725

2826
private static final String DEFAULT_CACHE_SPEC = "maximumSize=10000";

src/com/google/javascript/jscomp/bundle/CompilerBasedTransformer.java

-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
import static com.google.common.base.Preconditions.checkNotNull;
2020

21-
import com.google.common.annotations.GwtIncompatible;
2221
import com.google.common.collect.ImmutableList;
2322
import com.google.errorprone.annotations.Immutable;
2423
import com.google.javascript.jscomp.CheckLevel;
@@ -42,7 +41,6 @@
4241
* A source transformer base class. May also include a runtime that needs to
4342
* be shipped with the final bundle.
4443
*/
45-
@GwtIncompatible
4644
@Immutable
4745
public abstract class CompilerBasedTransformer implements Source.Transformer {
4846

src/com/google/javascript/jscomp/bundle/CoverageInstrumenter.java

-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
package com.google.javascript.jscomp.bundle;
1818

19-
import com.google.common.annotations.GwtIncompatible;
2019
import com.google.errorprone.annotations.Immutable;
2120
import com.google.javascript.jscomp.CompilerOptions;
2221
import com.google.javascript.jscomp.CompilerOptions.InstrumentOption;
@@ -27,7 +26,6 @@
2726
/**
2827
* A source transformer for instrmenting code for coverage data collection.
2928
*/
30-
@GwtIncompatible
3129
@Immutable
3230
public class CoverageInstrumenter extends CompilerBasedTransformer {
3331

src/com/google/javascript/jscomp/bundle/Source.java

-4
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919

2020
import com.google.auto.value.AutoValue;
21-
import com.google.common.annotations.GwtIncompatible;
2221
import com.google.common.base.Supplier;
2322
import com.google.common.base.Suppliers;
2423
import com.google.common.collect.ImmutableMap;
@@ -33,7 +32,6 @@
3332

3433
/** An abstract representation of a source file. */
3534
@AutoValue
36-
@GwtIncompatible
3735
@Immutable
3836
public abstract class Source {
3937

@@ -94,7 +92,6 @@ public static Builder builder() {
9492

9593
/** Builder for Source instances. */
9694
@AutoValue.Builder
97-
@GwtIncompatible
9895
public abstract static class Builder {
9996
public abstract Builder setPath(Path path);
10097
public abstract Builder setSourceMap(String sourceMap);
@@ -179,7 +176,6 @@ default Transformer compose(Transformer before) {
179176
}
180177

181178
/** Essentially the same as Supplier, but wraps equals and hashCode. */
182-
@GwtIncompatible
183179
@Immutable
184180
abstract static class Lazy<T> implements Supplier<T> {
185181

src/com/google/javascript/jscomp/bundle/TranspilationException.java

-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
package com.google.javascript.jscomp.bundle;
1818

19-
import com.google.common.annotations.GwtIncompatible;
2019
import com.google.common.collect.ImmutableList;
2120
import com.google.javascript.jscomp.ErrorFormat;
2221
import com.google.javascript.jscomp.JSError;
@@ -28,7 +27,6 @@
2827
* An unchecked exception thrown when transpilation fails due to one or
2928
* more errors in the input script.
3029
*/
31-
@GwtIncompatible
3230
public class TranspilationException extends RuntimeException {
3331

3432
private final ImmutableList<JSError> errors;

src/com/google/javascript/jscomp/bundle/Transpiler.java

-2
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,13 @@
1818

1919
import static com.google.common.base.Preconditions.checkNotNull;
2020

21-
import com.google.common.annotations.GwtIncompatible;
2221
import com.google.errorprone.annotations.Immutable;
2322
import java.util.Optional;
2423

2524
/**
2625
* A source transformer for lowering JS language versions. May also include a runtime that needs to
2726
* be shipped with the final bundle.
2827
*/
29-
@GwtIncompatible
3028
@Immutable
3129
public class Transpiler extends CompilerBasedTransformer {
3230

src/com/google/javascript/jscomp/instrumentation/BranchCoverageInstrumentationCallback.java

-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
import static com.google.common.base.Preconditions.checkNotNull;
1919

20-
import com.google.common.annotations.GwtIncompatible;
2120
import com.google.javascript.jscomp.AbstractCompiler;
2221
import com.google.javascript.jscomp.ControlFlowGraph;
2322
import com.google.javascript.jscomp.NodeTraversal;
@@ -31,7 +30,6 @@
3130
import java.util.Objects;
3231

3332
/** Instrument branch coverage for javascript. */
34-
@GwtIncompatible("FileInstrumentationData")
3533
public class BranchCoverageInstrumentationCallback extends NodeTraversal.AbstractCfgCallback {
3634
private final AbstractCompiler compiler;
3735
private final Map<String, FileInstrumentationData> instrumentationData;

src/com/google/javascript/jscomp/instrumentation/CoverageInstrumentationCallback.java

-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
import static com.google.common.base.Preconditions.checkNotNull;
2020

21-
import com.google.common.annotations.GwtIncompatible;
2221
import com.google.javascript.jscomp.NodeTraversal;
2322
import com.google.javascript.jscomp.NodeUtil;
2423
import com.google.javascript.jscomp.instrumentation.CoverageInstrumentationPass.CoverageReach;
@@ -27,7 +26,6 @@
2726
import java.util.Map;
2827

2928
/** This class implements a traversal to instrument an AST for code coverage. */
30-
@GwtIncompatible("FileInstrumentationData")
3129
class CoverageInstrumentationCallback implements NodeTraversal.Callback {
3230

3331
private final Map<String, FileInstrumentationData> instrumentationData;

src/com/google/javascript/jscomp/instrumentation/CoverageInstrumentationPass.java

-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
import static com.google.common.base.Preconditions.checkState;
2020

21-
import com.google.common.annotations.GwtIncompatible;
2221
import com.google.errorprone.annotations.InlineMe;
2322
import com.google.javascript.jscomp.AbstractCompiler;
2423
import com.google.javascript.jscomp.CompilerOptions.InstrumentOption;
@@ -32,7 +31,6 @@
3231
import java.util.Map;
3332

3433
/** This code implements the instrumentation pass over the AST (returned by JSCompiler). */
35-
@GwtIncompatible("FileInstrumentationData")
3634
public class CoverageInstrumentationPass implements CompilerPass {
3735

3836
final AbstractCompiler compiler;

src/com/google/javascript/jscomp/instrumentation/FileInstrumentationData.java

-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
package com.google.javascript.jscomp.instrumentation;
1818

19-
import com.google.common.annotations.GwtIncompatible;
2019
import com.google.common.base.Preconditions;
2120
import com.google.common.base.Strings;
2221
import com.google.common.primitives.UnsignedBytes;
@@ -29,7 +28,6 @@
2928
* Holds instrumentation details related to a file, namely, the filename, the array name used in
3029
* instrumentation, and the lines which were instrumented (in encoded form).
3130
*/
32-
@GwtIncompatible("com.google.common.primitives.UnsignedBytes")
3331
class FileInstrumentationData {
3432
private final BitSet instrumentedBits; // Instrumented lines, a bit per line
3533
private final String arrayName;

src/com/google/javascript/jscomp/instrumentation/ProductionCoverageInstrumentationCallback.java

-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
import static com.google.common.base.Preconditions.checkNotNull;
2020

21-
import com.google.common.annotations.GwtIncompatible;
2221
import com.google.common.collect.ImmutableMap;
2322
import com.google.debugging.sourcemap.Base64VLQ;
2423
import com.google.gson.Gson;
@@ -45,7 +44,6 @@
4544
* it can be run on client browsers with the goal of better detecting dead code. The callback will
4645
* instrument by pushing a string onto an array which identifies what piece of code was executed.
4746
*/
48-
@GwtIncompatible
4947
final class ProductionCoverageInstrumentationCallback implements NodeTraversal.Callback {
5048

5149
/**

test/com/google/javascript/jscomp/bundle/CachedTransformerTest.java

-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import static org.mockito.Mockito.verify;
2121
import static org.mockito.Mockito.when;
2222

23-
import com.google.common.annotations.GwtIncompatible;
2423
import com.google.common.cache.CacheBuilder;
2524
import java.util.function.Function;
2625
import org.junit.Before;
@@ -31,7 +30,6 @@
3130
import org.mockito.MockitoAnnotations;
3231

3332
/** Tests for {@link Source} and its nested classes. */
34-
@GwtIncompatible
3533
@RunWith(JUnit4.class)
3634
public final class CachedTransformerTest {
3735

test/com/google/javascript/jscomp/bundle/CoverageInstrumenterTest.java

-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import static org.mockito.Answers.RETURNS_SMART_NULLS;
2121
import static org.mockito.Mockito.when;
2222

23-
import com.google.common.annotations.GwtIncompatible;
2423
import com.google.common.base.Joiner;
2524
import com.google.common.collect.ImmutableList;
2625
import com.google.debugging.sourcemap.SourceMapConsumerV3;
@@ -36,7 +35,6 @@
3635
import org.mockito.MockitoAnnotations;
3736

3837
/** Tests for {@link CoverageInstrumenter}. */
39-
@GwtIncompatible
4038
@RunWith(JUnit4.class)
4139
public final class CoverageInstrumenterTest {
4240

test/com/google/javascript/jscomp/bundle/SourceTest.java

-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
import static com.google.common.truth.Truth.assertThat;
2020

21-
import com.google.common.annotations.GwtIncompatible;
2221
import com.google.common.base.Suppliers;
2322
import com.google.common.collect.ImmutableMap;
2423
import com.google.common.collect.ImmutableSet;
@@ -29,7 +28,6 @@
2928
import org.junit.runners.JUnit4;
3029

3130
/** Tests for {@link Source} and its nested classes. */
32-
@GwtIncompatible
3331
@RunWith(JUnit4.class)
3432
public final class SourceTest {
3533

test/com/google/javascript/jscomp/bundle/TranspilerTest.java

-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import static org.mockito.Answers.RETURNS_SMART_NULLS;
2121
import static org.mockito.Mockito.when;
2222

23-
import com.google.common.annotations.GwtIncompatible;
2423
import com.google.common.collect.ImmutableList;
2524
import com.google.javascript.jscomp.JSError;
2625
import java.nio.file.Path;
@@ -32,7 +31,6 @@
3231
import org.mockito.MockitoAnnotations;
3332

3433
/** Tests for {@link Transpiler}. */
35-
@GwtIncompatible
3634
@RunWith(JUnit4.class)
3735
public final class TranspilerTest {
3836

test/com/google/javascript/jscomp/integration/AdvancedOptimizationsIntegrationTest.java

-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import static com.google.javascript.jscomp.base.JSCompStrings.lines;
2222
import static com.google.javascript.rhino.testing.NodeSubject.assertNode;
2323

24-
import com.google.common.annotations.GwtIncompatible;
2524
import com.google.common.base.Joiner;
2625
import com.google.common.collect.ImmutableList;
2726
import com.google.common.collect.ImmutableSet;
@@ -1535,7 +1534,6 @@ public void testSuppressEs5StrictWarning() {
15351534
test(options, "/** @suppress{es5Strict} */ function f() { var arguments; }", "");
15361535
}
15371536

1538-
@GwtIncompatible // b/63595345
15391537
@Test
15401538
public void testBrokenNameSpace() {
15411539
CompilerOptions options = createCompilerOptions();
@@ -1727,7 +1725,6 @@ public void testGoogDefineClass4() {
17271725
// DefaultCodingConvention due to it throwing on methods such as extractIsModuleFile which is
17281726
// needed in {@link CompilerInput$DepsFinder#visitSubtree}. Disable this test in the JsVersion.
17291727
// TODO(tdeegan): DepsFinder should error out early if run with DefaultCodingConvention.
1730-
@GwtIncompatible
17311728
@Test
17321729
public void testES6UnusedClassesAreRemovedDefaultCodingConvention() {
17331730
testES6UnusedClassesAreRemoved(CodingConventions.getDefault());

test/com/google/javascript/jscomp/integration/ClosureIntegrationTest.java

-4
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import static com.google.javascript.jscomp.base.JSCompStrings.lines;
2323
import static com.google.javascript.rhino.testing.NodeSubject.assertNode;
2424

25-
import com.google.common.annotations.GwtIncompatible;
2625
import com.google.common.collect.ImmutableList;
2726
import com.google.javascript.jscomp.CheckLevel;
2827
import com.google.javascript.jscomp.ClosureCodingConvention;
@@ -542,7 +541,6 @@ public void testForwardDeclaredTypeInTemplate() {
542541
"var x;var y");
543542
}
544543

545-
@GwtIncompatible // b/63595345
546544
@Test
547545
public void testClosurePassOff() {
548546
CompilerOptions options = createCompilerOptions();
@@ -551,7 +549,6 @@ public void testClosurePassOff() {
551549
testSame(options, "goog.getCssName = function(x) {};" + "goog.getCssName('foo');");
552550
}
553551

554-
@GwtIncompatible // b/63595345
555552
@Test
556553
public void testClosurePassOn() {
557554
CompilerOptions options = createCompilerOptions();
@@ -993,7 +990,6 @@ public void testGoogModuleGet_notAllowedInGlobalScope() {
993990
DiagnosticGroups.CLOSURE_DEP_METHOD_USAGE_CHECKS);
994991
}
995992

996-
@GwtIncompatible // b/63595345
997993
@Test
998994
public void testProvideRequireSameFile() {
999995
CompilerOptions options = createCompilerOptions();

test/com/google/javascript/jscomp/integration/IntegrationTest.java

-3
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import static com.google.javascript.rhino.testing.NodeSubject.assertNode;
2323
import static org.junit.Assert.assertThrows;
2424

25-
import com.google.common.annotations.GwtIncompatible;
2625
import com.google.common.collect.ImmutableList;
2726
import com.google.common.collect.ImmutableMap;
2827
import com.google.common.collect.ImmutableSet;
@@ -4294,7 +4293,6 @@ public void testNoSpuriousWarningsOnGeneratedTypedef() {
42944293
}
42954294

42964295
@Test
4297-
@GwtIncompatible("AbstractCommandLineRunner.getBuiltinExterns()")
42984296
public void testEs6ModuleEntryPoint() throws Exception {
42994297
ImmutableList<SourceFile> inputs =
43004298
ImmutableList.of(
@@ -4320,7 +4318,6 @@ public void testEs6ModuleEntryPoint() throws Exception {
43204318
}
43214319

43224320
@Test
4323-
@GwtIncompatible("AbstractCommandLineRunner.getBuiltinExterns()")
43244321
public void testEs6ModuleEntryPointWithSquareBracketsInFilename() throws Exception {
43254322
ImmutableList<SourceFile> inputs =
43264323
ImmutableList.of(

test/com/google/javascript/jscomp/integration/ProductionCoverageInstrumentationPassIntegrationTest.java

-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import static com.google.javascript.jscomp.base.JSCompStrings.lines;
2222
import static org.junit.Assert.assertThrows;
2323

24-
import com.google.common.annotations.GwtIncompatible;
2524
import com.google.common.base.Strings;
2625
import com.google.common.collect.ImmutableList;
2726
import com.google.common.collect.ImmutableMap;
@@ -37,7 +36,6 @@
3736
import org.junit.runners.JUnit4;
3837

3938
@RunWith(JUnit4.class)
40-
@GwtIncompatible("FileInstrumentationData")
4139
public final class ProductionCoverageInstrumentationPassIntegrationTest
4240
extends IntegrationTestCase {
4341

0 commit comments

Comments
 (0)