Discussion:
[GitHub] commons-collections pull request #64: [COLLECTIONS 706] Add set utils.as set...
reckart
2018-12-03 15:47:11 UTC
Permalink
GitHub user reckart opened a pull request:

https://github.com/apache/commons-collections/pull/64

[COLLECTIONS 706] Add set utils.as set method

PR adds the method described in https://issues.apache.org/jira/projects/COLLECTIONS/issues/COLLECTIONS-706 .

Could be discussed how to handle this case:

```
SetUtils.asSet(null)
```

The compile will warn (at least in Eclipse) that this actually means passing a null array as the var-args argument.

* Right now, I implemented it such that in this case, the method will return `null`.
* It might be arguable to better return an empty set in this case.
* It could even be argued to return a set with the value `null` in this case.

Opinions?

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/reckart/commons-collections feature/COLLECTIONS-706-Add-SetUtils.asSet-method

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/commons-collections/pull/64.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 #64

----
commit dc9510d3550c4ea2b700414287944ee02f9db21c
Author: Richard Eckart de Castilho <***@...>
Date: 2018-12-03T15:42:55Z

[COLLECTIONS-706] Add SetUtils.asSet(T... items) method

- Added asSet() method
- Added unit test

commit 221aaf037ec5f67f4d282d64a244cf358c829582
Author: Richard Eckart de Castilho <***@...>
Date: 2018-12-03T15:44:10Z

[COLLECTIONS-706] Add SetUtils.asSet(T... items) method

- Made JavaDoc more precise.

----


---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-***@commons.apache.org
For additional commands, e-mail: dev-***@commons.apache.org

Loading...