-
Notifications
You must be signed in to change notification settings - Fork 916
Enforce that enum names must be singular, not plural. #520
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
} | ||
|
||
private boolean isPlural(String className) { | ||
return DISALLOWED_ENDINGS.stream().anyMatch(className::endsWith) && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's kind of confusing to name them allowed/disallowed since it depends more on the context in which they are used whether they are allowed or not. Perhaps just PLURAL_ENDINGS and NON_PLURAL_ENDINGS or something along those lines?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
} | ||
|
||
private boolean isPluralDisallowed(DetailAST ast) { | ||
return !isEnum(ast) && !hasPublicStaticField(ast); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this right? It seems backwards to me but perhaps my brain is at reduced capacity right now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I changed it elsewhere and forgot to change it here. Good catch.
@@ -28,15 +28,15 @@ | |||
|
|||
public final class DocumentationUtils { | |||
|
|||
public static final String DEFAULT_SETTER = "Sets the value of the %s property for this object."; | |||
private static final String DEFAULT_SETTER = "Sets the value of the %s property for this object."; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm this feels like cheating... ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, a little :)
@@ -24,7 +24,7 @@ | |||
import software.amazon.awssdk.utils.http.SdkHttpUtils; | |||
|
|||
@SdkProtectedApi | |||
public final class PathMarshallers { | |||
public abstract class PathMarshaller { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this still be an interface? Or does it have something to do with the private static classes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing can be private in an interface (before Java 9).
*/ | ||
public enum KnownJavaVersions { | ||
public enum KnownJavaVersion { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This probably needs to go. Can you add a review before release?
@@ -22,7 +22,7 @@ | |||
* Default configuration values. | |||
*/ | |||
@ReviewBeforeRelease("These values") | |||
public final class Defaults { | |||
public final class Default { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe rename to DefaultConfiguration or DefaultSetting
842bc8f
to
b63ea14
Compare
b63ea14
to
cd06399
Compare
…e6f1604b Pull request: release <- staging/42a93eca-9b2f-49b8-a049-4ad6e6f1604b
Reviewer notes: New checkstyle rule implemented in "PluralEnumNames.java". This does not apply to modeled objects.