[jira] Commented: (LANG-568) @SuppressWarnings("unchecked") is used too generally
[ https://issues.apache.org/jira/browse/LANG-568?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12792581#action_12792581 ] Sebb commented on LANG-568: --- URL: http://svn.apache.org/viewvc?rev=892343&view=rev Log: LANG-568 - @SuppressWarnings("unchecked") is used too generally I think all the warnings that can be safely suppressed have now been suppressed (and documented). There are two warnings that remain cannot be suppressed safely; see LANG-571 > @SuppressWarnings("unchecked") is used too generally > > > Key: LANG-568 > URL: https://issues.apache.org/jira/browse/LANG-568 > Project: Commons Lang > Issue Type: Bug > Components: General >Reporter: Sebb >Assignee: Sebb > Fix For: 3.0 > > > @SuppressWarnings("unchecked") is used in several places on entire methods. > Mostly there is no documentation as to why it is safe to ignore the warnings. > Seems to me the annotation should be used as close as possible to the site of > the warning, and the reason should be documented, so it can be revisited if > there is a code change later. > In fact, at least one of the warnings is NOT safe to ignore: > String[] s = ArrayUtils.add((String[])null, null); > generates a ClassCastException, which should not happen if the warning is OK > to ignore. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Commented: (LANG-568) @SuppressWarnings("unchecked") is used too generally
[ https://issues.apache.org/jira/browse/LANG-568?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12792345#action_12792345 ] Sebb commented on LANG-568: --- URL: http://svn.apache.org/viewvc?rev=892135&view=rev Log: LANG-568 - @SuppressWarnings("unchecked") is used too generally Partial fix - some warnings remain to be addressed URL: http://svn.apache.org/viewvc?rev=892136&view=rev Log: LANG-568 - @SuppressWarnings("unchecked") is used too generally Partial fix - some warnings remain to be addressed Note: this exercise has discovered two places where the casts were not safe - see LANG-571 > @SuppressWarnings("unchecked") is used too generally > > > Key: LANG-568 > URL: https://issues.apache.org/jira/browse/LANG-568 > Project: Commons Lang > Issue Type: Bug > Components: General >Reporter: Sebb >Assignee: Sebb > Fix For: 3.0 > > > @SuppressWarnings("unchecked") is used in several places on entire methods. > Mostly there is no documentation as to why it is safe to ignore the warnings. > Seems to me the annotation should be used as close as possible to the site of > the warning, and the reason should be documented, so it can be revisited if > there is a code change later. > In fact, at least one of the warnings is NOT safe to ignore: > String[] s = ArrayUtils.add((String[])null, null); > generates a ClassCastException, which should not happen if the warning is OK > to ignore. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Commented: (LANG-568) @SuppressWarnings("unchecked") is used too generally
[ https://issues.apache.org/jira/browse/LANG-568?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12791762#action_12791762 ] Henri Yandell commented on LANG-568: Seems good. I count 11 in the main source, so not that painful to fix. ./ArrayUtils.java:@SuppressWarnings("unchecked") ./ArrayUtils.java:@SuppressWarnings("unchecked") ./ArrayUtils.java:@SuppressWarnings("unchecked") ./ArrayUtils.java:@SuppressWarnings("unchecked") ./ArrayUtils.java:@SuppressWarnings("unchecked") ./builder/CompareToBuilder.java:@SuppressWarnings("unchecked") ./Range.java:@SuppressWarnings("unchecked") // OK because we checked the class above ./Range.java:@SuppressWarnings("unchecked") ./Range.java:@SuppressWarnings("unchecked") ./text/StrBuilder.java:@SuppressWarnings("null") // str cannot be null ./text/StrLookup.java:@SuppressWarnings("unchecked") // System property keys and values are always Strings > @SuppressWarnings("unchecked") is used too generally > > > Key: LANG-568 > URL: https://issues.apache.org/jira/browse/LANG-568 > Project: Commons Lang > Issue Type: Bug > Components: General >Reporter: Sebb > Fix For: 3.0 > > > @SuppressWarnings("unchecked") is used in several places on entire methods. > Mostly there is no documentation as to why it is safe to ignore the warnings. > Seems to me the annotation should be used as close as possible to the site of > the warning, and the reason should be documented, so it can be revisited if > there is a code change later. > In fact, at least one of the warnings is NOT safe to ignore: > String[] s = ArrayUtils.add((String[])null, null); > generates a ClassCastException, which should not happen if the warning is OK > to ignore. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.