Menu

False positives in Java code

2014-07-01
2014-07-09
  • Rodrigo Ruiz

    Rodrigo Ruiz - 2014-07-01

    Hi,

    First things first, thanks for this tool. It is a great work.

    Now, I think I have found two false positives in the generated reports for my code:

    First:

    I am getting the following result in several interfaces:

    STANDARD: Class Contains Public Variable: ModelException
    

    In java, fields declared in an interface are always static and final, so this warning should not apply, even if they are not explicitly declared to be so.

    Second:

    Another result that I assume should not appear, is the following one:

    LOW: Operation on Primitive Data Type
    The code appears to be carrying out a mathematical operation on...
    Line XXX: ...
    

    For non-mathematical operations, and also for some inherently bounded ones. Some examples would be:

    private static final long serialVersionUID = -3438008780609201699L;
    log.error ("Error analysing item " + i);
    for (int i = 0; i < totalServices; i++) {
    
     
  • N1ckDunn

    N1ckDunn - 2014-07-09

    Thanks for the information Rodrigo. I'm currently working on bug-fixes and new features so I'll take a look at this.

    Nick

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.