You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Benedikt Ritter (JIRA)" <ji...@apache.org> on 2015/05/05 19:28:59 UTC

[jira] [Commented] (LANG-1130) Fix Sonar warnings

    [ https://issues.apache.org/jira/browse/LANG-1130?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14528840#comment-14528840 ] 

Benedikt Ritter commented on LANG-1130:
---------------------------------------

I've fixed two of the five warnings:

* org.apache.commons.lang3.ClassUtils.<static initializer for ClassUtils>() makes inefficient use of keySet iterator instead of entrySet iterator.
* TypeUtils: The user-supplied array 'typeArguments' is stored directly.

Three issues remain: 
* in ObjectUtils we have the method {{public static boolean equals(Object, Object)}} which is "suspiciously close to equals(Object)". The same is true for the {{equals(StrBuilder)}} method overload in StrBuilder. Both cases are implemented intentionally.
* The third warning is in FastDatePrinter, where is complains, that the inner class TextField  stores the user-supplied array 'values' directly. Looking at the code which initialized new instances one can see, that only arrays retrieved from the various getters of {{java.util.DateFormatSymbols}} are passed to the constructor. The getters all make copies of their internal arrays. So my assessment is, that this is not a problem either.

> Fix Sonar warnings
> ------------------
>
>                 Key: LANG-1130
>                 URL: https://issues.apache.org/jira/browse/LANG-1130
>             Project: Commons Lang
>          Issue Type: Task
>    Affects Versions: 3.5
>            Reporter: Benedikt Ritter
>            Assignee: Benedikt Ritter
>             Fix For: 3.5
>
>
> The Apache SonarQube instance shows five critical warnings for Commons Lang: https://analysis.apache.org/dashboard/index/72046
> We should try to fix those.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)