Use EnumSet instead of HashSet

This commit is contained in:
Sam Harwell 2012-12-11 08:40:40 -06:00
parent 70360a4ce8
commit 1411a561ab
2 changed files with 3 additions and 2 deletions

View File

@ -7,6 +7,7 @@ December 11, 2012
* Listen for issues reported by StringTemplate, report them as warnings * Listen for issues reported by StringTemplate, report them as warnings
* Fix template issues * Fix template issues
* GrammarASTWithOptions.getOptions never returns null * GrammarASTWithOptions.getOptions never returns null
* Use EnumSet instead of HashSet
December 2, 2012 December 2, 2012

View File

@ -40,7 +40,7 @@ import org.stringtemplate.v4.misc.STMessage;
import java.net.URL; import java.net.URL;
import java.util.Collection; import java.util.Collection;
import java.util.HashSet; import java.util.EnumSet;
import java.util.Locale; import java.util.Locale;
import java.util.Set; import java.util.Set;
@ -52,7 +52,7 @@ public class ErrorManager {
public int warnings; public int warnings;
/** All errors that have been generated */ /** All errors that have been generated */
public Set<ErrorType> errorTypes = new HashSet<ErrorType>(); public Set<ErrorType> errorTypes = EnumSet.noneOf(ErrorType.class);
/** The group of templates that represent the current message format. */ /** The group of templates that represent the current message format. */
STGroup format; STGroup format;