You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2019/12/04 22:13:00 UTC

[jira] [Work logged] (COLLECTIONS-739) Wrong @throws comments in DefaultedMap

     [ https://issues.apache.org/jira/browse/COLLECTIONS-739?focusedWorklogId=353846&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-353846 ]

ASF GitHub Bot logged work on COLLECTIONS-739:
----------------------------------------------

                Author: ASF GitHub Bot
            Created on: 04/Dec/19 22:12
            Start Date: 04/Dec/19 22:12
    Worklog Time Spent: 10m 
      Work Description: Prodigysov commented on pull request #123: [COLLECTIONS-739] Fix inconsistent @throws comments in DefaultedMap
URL: https://github.com/apache/commons-collections/pull/123
 
 
   See [COLLECTIONS-739](https://issues.apache.org/jira/browse/COLLECTIONS-739).
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Issue Time Tracking
-------------------

            Worklog Id:     (was: 353846)
    Remaining Estimate: 0h
            Time Spent: 10m

> 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
>          Time Spent: 10m
>  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)