You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gary D. Gregory (Jira)" <ji...@apache.org> on 2019/12/10 15:08:00 UTC
[jira] [Resolved] (COLLECTIONS-739) Wrong @throws comments in
DefaultedMap
[ https://issues.apache.org/jira/browse/COLLECTIONS-739?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Gary D. Gregory resolved COLLECTIONS-739.
-----------------------------------------
Fix Version/s: 4.5
Resolution: Fixed
In git master, please verify and close.
> Wrong @throws comments in DefaultedMap
> --------------------------------------
>
> Key: COLLECTIONS-739
> URL: https://issues.apache.org/jira/browse/COLLECTIONS-739
> Project: Commons Collections
> Issue Type: Improvement
> Components: Map
> Reporter: Pengyu Nie
> Priority: Major
> Fix For: 4.5
>
> Time Spent: 1h
> Remaining Estimate: 0h
>
> I found some @throws comments in DefaultedMap are inconsistent with the code or missing. For examples:
> 1. The comment for defaultedMap(Map<K,V>, Factory<? extends V>) has wrong exception type:
> Line 108:
> {code:java}
> /** ... @throws NullPointerException if map or factory is null ... */
> {code}
> Line 112-114:
> {code:java}
> if (factory == null) {
> throw new IllegalArgumentException("Factory must not be null");
> }
> {code}
> 2. For defaultMap(Map<K, V>, Transformer<? super K, ? extends V>, this null checking does not have corresponding @throws comment:
> Line 135-137:
> {code:java}
> if (transformer == null) {
> throw new IllegalArgumentException("Transformer must not be null");
> }
> {code}
> I suggest adding:
> {code:java}
> @throws IllegalArgumentException if transformer is null.
> {code}
> I'll submit a PR for these suggested changes.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)