这是indexloc提供的服务,不要输入任何密码
Skip to content
This repository was archived by the owner on Mar 4, 2021. It is now read-only.

Conversation

@radonsky
Copy link
Contributor

@radonsky radonsky commented Dec 3, 2013

The source code contains many references of the Enum raw type. Using an Enum reference merely says that you're referring to an enumerated value. Because Enum is a raw type, it causes compiler warnings (or requires suppression) and creates a possibility of using an incorrect enumerated value, because the compiler cannot determine if an assignment is safe. We could eliminate the compiler warnings by using Enum<?> instead of Enum, but it won't prevent the possible "enum mismatch".

This pull request proposes a change that would introduce several marker interfaces - MonkeyType, EventType, GroupType and ResourceType. Enumerated types in Java can implement interfaces and therefore we can mark each existing enum with one of the marker interfaces to indicate their intended use. This makes enumeration safer to use while still maintaining the flexibility of using different enumerations in different contexts.

@cloudbees-pull-request-builder

SimianArmy-pull-requests #100 SUCCESS
This pull request looks good

@coryb
Copy link
Contributor

coryb commented Dec 3, 2013

Looks good, thanks Marek!
-Cory

coryb added a commit that referenced this pull request Dec 3, 2013
@coryb coryb merged commit ec22edb into Netflix:master Dec 3, 2013
@radonsky radonsky deleted the fix_enumerated_types branch December 3, 2013 18:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants