You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ofbiz.apache.org by "Jacques Le Roux (Jira)" <ji...@apache.org> on 2020/06/17 07:04:00 UTC

[jira] [Commented] (OFBIZ-11824) Clean code according to SpotBugs

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

Jacques Le Roux commented on OFBIZ-11824:
-----------------------------------------

By error I committed 488b9b6b9a914777f4e56bbac611c72159564b2b in OFBIZ-11822, here is the comment

{quote}
Commit 488b9b6b9a914777f4e56bbac611c72159564b2b in ofbiz-framework's branch refs/heads/trunk from Jacques Le Roux
[ https://gitbox.apache.org/repos/asf?p=ofbiz-framework.git;h=488b9b6 ]

Improved: Checks if the value passed to checkStringForHtmlSafe is not null (OFBIZ-11822)

This was reported by SpotBugs in Eclipse to prevent a possible NPE.

It seems to me that it's more complex than that because of the
PolicyFactory::sanitize methods signatures where @Nullable annotation is
used. So the SpotBugs warning remains, anyway can't hurt.

BTW found 92 issues reported by SpotBugs in Eclipse, among them 33 are "scary"

I had to add 1 to tasks.checkstyleMain.maxErrors because of
https://github.com/apache/ofbiz-framework/pull/203 that I pulled after the push
was rejected by the pre-push local Git hook
{quote}

I had a look at the @nullable annotation used by PolicyFactory::sanitize methods signatures and found that this is a conflict between Eclipse and SpotBugs plugin or can be considered a but in SpotBugs plugin: https://github.com/spotbugs/spotbugs/issues/471

So the 17 reported "Possible unreferencing -- null pointer" by Spotbugs are POSSIBLE false positive if there is a call to a method with @Nullable annotation  in the line (or block?) referenced by SpotBugs. 

> Clean code according to SpotBugs 
> ---------------------------------
>
>                 Key: OFBIZ-11824
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-11824
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: ALL COMPONENTS
>    Affects Versions: Trunk
>            Reporter: Jacques Le Roux
>            Priority: Major
>
> While working on OFBIZ-11822 I noticed a SpotBugs issue among 92 others with 33 "scary"
> That not's much and should be handled in this sole Jira separated by type of issues when necessary (eg there are 17 possible NPE to check)



--
This message was sent by Atlassian Jira
(v8.3.4#803005)