Github user ddebrunner commented on a diff in the pull request:
https://github.com/apache/incubator-quarks/pull/11#discussion_r56332292
--- Diff:
spi/topology/src/main/java/quarks/topology/spi/graph/ConnectorStream.java ---
@@ -96,6 +97,28 @@ protected Graph graph() {
}
@Override
+ public <E extends Enum<E>> EnumMap<E,TStream<T>> split(Class<E>
enumClass, Function<T, E> splitter) {
+
+ E[] es = enumClass.getEnumConstants();
+ if(es == null) {
--- End diff --
I'm merging this pull request but I'm not sure I understand this code:
E is declared as an enum so the message the exception throws is not valid.
I see there is a test `testSplitWithEnumForZeroSizeClass` , is that what
this check is for? (Nice job adding the test, I didn't realize that there could
be empty enums).
If the check is for that then maybe the message should be changed? Just
from reading the code I'd be tempted to remove the check as it appears as
though it can't happen since E is always an enum.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---