Cazen Lee created QUARKS-47:
-------------------------------
Summary: Remove unnecessary null check in
ConnectorStream.split(enumClass, splitter)
Key: QUARKS-47
URL: https://issues.apache.org/jira/browse/QUARKS-47
Project: Quarks
Issue Type: Improvement
Reporter: Cazen Lee
Assignee: Cazen Lee
Priority: Minor
There are unnecessary null check in split method of ConnectorStream.java
I thought there are posibillity to return a null in getEnumConstants() so
created null check logic.
{code:title=ConnectorStream.java|borderStyle=solid}
public <E extends Enum<E>> EnumMap<E,TStream<T>> split(Class<E> enumClass,
Function<T, E> splitter) {
E[] es = enumClass.getEnumConstants();
if(es == null) {
throw new IllegalArgumentException("Class object does not represent
an enum type");
}
{code}
But the argument defined that enumClass is alway enum<E>. It's my mistake. The
null checker is not necessary.
It's simple change but create a jira issue because I believe it is important to
leave a record of the changes and mapping 1-1(or 1-N) to github PR.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)