You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@edgent.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/03/19 03:37:33 UTC
[jira] [Commented] (QUARKS-47) Remove unnecessary null check in
ConnectorStream.split(enumClass, splitter)
[ https://issues.apache.org/jira/browse/QUARKS-47?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15202524#comment-15202524 ]
ASF GitHub Bot commented on QUARKS-47:
--------------------------------------
GitHub user Cazen opened a pull request:
https://github.com/apache/incubator-quarks/pull/29
[QUARKS-47] Remove unnecessary null check in ConnectorStream.split(enumClass, splitter)
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/Cazen/incubator-quarks QUARKS-47
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/incubator-quarks/pull/29.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #29
----
commit 98e1b88e062949375ff4044a890fff14fc94fadc
Author: Cazen Lee <ca...@korea.com>
Date: 2016-03-19T02:14:42Z
Merge pull request #1 from apache/master
init
commit d512a9c26a6864c153be3d6742205ed6809af5a3
Author: Cazen <ca...@korea.com>
Date: 2016-03-19T02:34:28Z
Remove unnecessary null check
----
> 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)