mirror of
https://github.com/google/nomulus.git
synced 2025-05-14 08:27:14 +02:00
Fix some statically detected code issues
This includes: unnecessary semicolons, suppress warnings, switch statements, final/private qualifiers, Optional wrapping, conditionals, both inline and non-inline variables, ternaries, Collection putAll() calls, StringBuilders, and throws declarations. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=244182539
This commit is contained in:
parent
9f360587ff
commit
24bb78bd16
54 changed files with 107 additions and 158 deletions
|
@ -53,7 +53,6 @@ import google.registry.model.tmch.TmchCrl;
|
|||
public final class EntityClasses {
|
||||
|
||||
/** Set of entity classes. */
|
||||
@SuppressWarnings("unchecked") // varargs
|
||||
public static final ImmutableSet<Class<? extends ImmutableObject>> ALL_CLASSES =
|
||||
ImmutableSet.of(
|
||||
AllocationToken.class,
|
||||
|
|
|
@ -140,7 +140,7 @@ public abstract class ImmutableObject implements Cloneable {
|
|||
}
|
||||
|
||||
/** Helper function to recursively hydrate an ImmutableObject. */
|
||||
private static final Object hydrate(Object value) {
|
||||
private static Object hydrate(Object value) {
|
||||
if (value instanceof Key) {
|
||||
return hydrate(ofy().load().key((Key<?>) value).now());
|
||||
} else if (value instanceof Map) {
|
||||
|
|
|
@ -608,7 +608,6 @@ public abstract class BillingEvent extends ImmutableObject
|
|||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public Modification build() {
|
||||
Modification instance = getInstance();
|
||||
checkNotNull(instance.reason);
|
||||
|
|
|
@ -53,7 +53,7 @@ public class DesignatedContact extends ImmutableObject {
|
|||
@XmlEnumValue("tech")
|
||||
TECH,
|
||||
/** The registrant type is not reflected in XML and exists only for internal use. */
|
||||
REGISTRANT;
|
||||
REGISTRANT
|
||||
}
|
||||
|
||||
public static DesignatedContact create(Type type, Key<ContactResource> contact) {
|
||||
|
|
|
@ -60,7 +60,7 @@ public class LaunchCheckExtension extends ImmutableObject implements CommandExte
|
|||
|
||||
/** A check to see if there are matching trademarks on the specified domain names. */
|
||||
@XmlEnumValue("claims")
|
||||
CLAIMS;
|
||||
CLAIMS
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -72,7 +72,7 @@ public class LaunchCreateExtension extends LaunchExtension implements CommandExt
|
|||
* uses a "first-come, first-served" model.
|
||||
*/
|
||||
@XmlEnumValue("registration")
|
||||
REGISTRATION;
|
||||
REGISTRATION
|
||||
}
|
||||
|
||||
@XmlAttribute
|
||||
|
|
|
@ -28,7 +28,7 @@ public class RestoreCommand {
|
|||
REQUEST,
|
||||
|
||||
@XmlEnumValue("report")
|
||||
REPORT;
|
||||
REPORT
|
||||
}
|
||||
|
||||
/** The restore operation. */
|
||||
|
|
|
@ -151,14 +151,10 @@ public class EppInput extends ImmutableObject {
|
|||
|
||||
/** Get the extension based on type, or null. If there are multiple, it chooses the first. */
|
||||
public <E extends CommandExtension> Optional<E> getSingleExtension(Class<E> clazz) {
|
||||
return Optional.ofNullable(
|
||||
getCommandWrapper()
|
||||
.getExtensions()
|
||||
.stream()
|
||||
.filter(clazz::isInstance)
|
||||
.map(clazz::cast)
|
||||
.findFirst()
|
||||
.orElse(null));
|
||||
return getCommandWrapper().getExtensions().stream()
|
||||
.filter(clazz::isInstance)
|
||||
.map(clazz::cast)
|
||||
.findFirst();
|
||||
}
|
||||
|
||||
/** A tag that goes inside of an EPP {@literal <command>}. */
|
||||
|
@ -225,7 +221,7 @@ public class EppInput extends ImmutableObject {
|
|||
REJECT,
|
||||
|
||||
@XmlEnumValue("request")
|
||||
REQUEST;
|
||||
REQUEST
|
||||
}
|
||||
|
||||
@XmlAttribute(name = "op")
|
||||
|
@ -251,7 +247,7 @@ public class EppInput extends ImmutableObject {
|
|||
|
||||
/** Request the next poll message. */
|
||||
@XmlEnumValue("req")
|
||||
REQUEST;
|
||||
REQUEST
|
||||
}
|
||||
|
||||
@XmlAttribute
|
||||
|
|
|
@ -31,7 +31,7 @@ public class MarkContact extends CommonMarkContactFields {
|
|||
AGENT,
|
||||
|
||||
@XmlEnumValue("thirdParty")
|
||||
THIRD_PARTY;
|
||||
THIRD_PARTY
|
||||
}
|
||||
|
||||
@XmlAttribute
|
||||
|
|
|
@ -31,7 +31,7 @@ public class MarkHolder extends CommonMarkContactFields {
|
|||
ASSIGNEE,
|
||||
|
||||
@XmlEnumValue("licensee")
|
||||
LICENSEE;
|
||||
LICENSEE
|
||||
}
|
||||
|
||||
@XmlAttribute
|
||||
|
|
|
@ -165,7 +165,7 @@ public class Registrar extends ImmutableObject implements Buildable, Jsonifiable
|
|||
* This registrar is completely disabled and cannot perform any EPP actions whatsoever, nor log
|
||||
* in to the registrar console.
|
||||
*/
|
||||
DISABLED;
|
||||
DISABLED
|
||||
}
|
||||
|
||||
/** Regex for E.164 phone number format specified by {@code contact.xsd}. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue