Skip to content

Commit

Permalink
Make parsing.Config even more immutable!
Browse files Browse the repository at this point in the history
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123773716
  • Loading branch information
blickly committed Jun 1, 2016
1 parent 58a09c8 commit 1c968e5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/com/google/javascript/jscomp/parsing/Config.java
Expand Up @@ -17,8 +17,8 @@
package com.google.javascript.jscomp.parsing; package com.google.javascript.jscomp.parsing;


import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;


import java.util.Map;
import java.util.Set; import java.util.Set;


/** /**
Expand Down Expand Up @@ -75,12 +75,12 @@ public enum RunMode {
* Recognized JSDoc annotations, mapped from their name to their internal * Recognized JSDoc annotations, mapped from their name to their internal
* representation. * representation.
*/ */
final Map<String, Annotation> annotationNames; final ImmutableMap<String, Annotation> annotationNames;


/** /**
* Recognized names in a {@code @suppress} tag. * Recognized names in a {@code @suppress} tag.
*/ */
final Set<String> suppressionNames; final ImmutableSet<String> suppressionNames;


/** /**
* Accept ECMAScript5 syntax, such as getter/setter. * Accept ECMAScript5 syntax, such as getter/setter.
Expand Down Expand Up @@ -108,15 +108,15 @@ public enum RunMode {
this.parseJsDocDocumentation = parseJsDocDocumentation; this.parseJsDocDocumentation = parseJsDocDocumentation;
this.preserveDetailedSourceInfo = preserveDetailedSourceInfo; this.preserveDetailedSourceInfo = preserveDetailedSourceInfo;
this.keepGoing = keepGoing; this.keepGoing = keepGoing;
this.suppressionNames = suppressionNames; this.suppressionNames = ImmutableSet.copyOf(suppressionNames);
this.languageMode = languageMode; this.languageMode = languageMode;
} }


/** /**
* Create the annotation names from the user-specified * Create the annotation names from the user-specified
* annotation whitelist. * annotation whitelist.
*/ */
private static Map<String, Annotation> buildAnnotationNames( private static ImmutableMap<String, Annotation> buildAnnotationNames(
Set<String> annotationWhitelist) { Set<String> annotationWhitelist) {
ImmutableMap.Builder<String, Annotation> annotationBuilder = ImmutableMap.Builder<String, Annotation> annotationBuilder =
ImmutableMap.builder(); ImmutableMap.builder();
Expand Down

0 comments on commit 1c968e5

Please sign in to comment.