mirror of
https://github.com/google/nomulus.git
synced 2025-05-13 16:07:15 +02:00
Use Immutable types for static final fields
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 ([] This change replaces constants (static final CONSTNAT_CASE) declaration type which use the general collection interface (e.g. List) with an immutable type (e.g. ImmutableList). For more info, see: [] Cleanup change automatically generated by javacflume/refactory Refactoring: //third_party/java_src/error_prone/project/core/src/main/java/com/google/errorprone/bugpatterns:MutableConstantField_refactoring Tested: TAP --sample for global presubmit queue [] ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=149010021
This commit is contained in:
parent
f61f1373df
commit
fa5607c3e1
2 changed files with 2 additions and 4 deletions
|
@ -93,7 +93,6 @@ import google.registry.model.registry.Registry;
|
|||
import google.registry.model.registry.Registry.TldState;
|
||||
import google.registry.model.reporting.HistoryEntry;
|
||||
import google.registry.tmch.LordnTask;
|
||||
import java.util.Set;
|
||||
import javax.inject.Inject;
|
||||
import org.joda.time.DateTime;
|
||||
|
||||
|
@ -153,7 +152,7 @@ import org.joda.time.DateTime;
|
|||
|
||||
public class DomainCreateFlow implements TransactionalFlow {
|
||||
|
||||
private static final Set<TldState> SUNRISE_STATES =
|
||||
private static final ImmutableSet<TldState> SUNRISE_STATES =
|
||||
Sets.immutableEnumSet(TldState.SUNRISE, TldState.SUNRUSH);
|
||||
|
||||
@Inject ExtensionManager extensionManager;
|
||||
|
|
|
@ -20,7 +20,6 @@ import com.google.common.collect.ImmutableMap;
|
|||
import com.google.common.net.HostAndPort;
|
||||
import com.google.common.net.InternetDomainName;
|
||||
import java.nio.file.Path;
|
||||
import java.util.Map;
|
||||
import java.util.logging.Level;
|
||||
import javax.annotation.Nullable;
|
||||
import org.joda.money.Money;
|
||||
|
@ -41,7 +40,7 @@ public final class ParameterFactory implements IStringConverterFactory {
|
|||
return (Class<? extends IStringConverter<T>>) CONVERTERS.get(type);
|
||||
}
|
||||
|
||||
private static final Map<Class<?>, Class<? extends IStringConverter<?>>> CONVERTERS =
|
||||
private static final ImmutableMap<Class<?>, Class<? extends IStringConverter<?>>> CONVERTERS =
|
||||
new ImmutableMap.Builder<Class<?>, Class<? extends IStringConverter<?>>>()
|
||||
.put(DateTime.class, DateTimeParameter.class)
|
||||
.put(Duration.class, DurationParameter.class)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue