Skip to content

Commit

Permalink
Replace constants (static final CONSTANT_CASE) declaration type which…
Browse files Browse the repository at this point in the history
… use the general collection interface (e.g. List) with an immutable type (e.g. ImmutableList).

For constant field declarations, you should use the immutable type (such as ImmutableList) instead of the general collection interface type (such as List). This communicates to your callers important semantic guarantees

Cleanup change automatically generated

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=149229658
  • Loading branch information
dorireuv authored and dimvar committed Mar 6, 2017
1 parent 6df616f commit 08a5696
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/com/google/javascript/jscomp/J2clChecksPass.java
Expand Up @@ -21,7 +21,6 @@
import com.google.javascript.rhino.Node;
import com.google.javascript.rhino.Token;
import com.google.javascript.rhino.TypeI;
import java.util.Map;

/**
* Performs correctness checks which are specific to J2CL-generated patterns.
Expand All @@ -34,10 +33,11 @@ public class J2clChecksPass extends AbstractPostOrderCallback implements Compile
"Reference equality may not be used with the specified type: {0}");

/** Types for which using reference equality is an error. Mapped from name to filename. */
static final Map<String, String> REFERENCE_EQUALITY_TYPE_PATTERNS = ImmutableMap.of(
"java.lang.Integer", "java/lang/Integer.impl.java.js",
"java.lang.Float", "java/lang/Float.impl.java.js",
"goog.math.Long", "javascript/closure/math/long.js");
static final ImmutableMap<String, String> REFERENCE_EQUALITY_TYPE_PATTERNS =
ImmutableMap.of(
"java.lang.Integer", "java/lang/Integer.impl.java.js",
"java.lang.Float", "java/lang/Float.impl.java.js",
"goog.math.Long", "javascript/closure/math/long.js");

private final AbstractCompiler compiler;

Expand Down

0 comments on commit 08a5696

Please sign in to comment.