Null Pointer Dereference Rule is strange

CodePro AnalytiX (Audit & Test), includes over 1000 audit rules and metrics, JUnit test generation & editing, code coverage, and duplicate code analysis

Moderators: gnebling, jwren, Eric Clayberg, Dan Rubel, Brian Wilkerson, dcarew

Null Pointer Dereference Rule is strange

Postby Nicht » Tue Sep 28, 2010 12:20 am

At the following code snippet Null Pointer Dereference Rule points to the line with exception throw. It looks inconsistent with rule description.

Code: Select all
public class RunTest {

   /**
    * @param args
    */
   public static void main(String[] args) {
      doSome();
   }

   /**
    * @return
    */
   public static int doSome() {
      throw new IllegalArgumentException("Some"); //Null Pointer Dereference
   }
}
Nicht
 
Posts: 3
Joined: Tue Sep 28, 2010 12:14 am

Re: Null Pointer Dereference Rule is strange

Postby Brian Wilkerson » Tue Sep 28, 2010 7:45 am

You're right. The rule is reporting a false positive at this point. We'll have a fix for this in the next build.
Brian Wilkerson
Google, Inc.
http://www.google.com
Brian Wilkerson
Moderator
 
Posts: 32
Joined: Fri Apr 28, 2006 9:37 am


Return to CodePro AnalytiX & PlusPak. EclipsePro Audit & Test

Who is online

Users browsing this forum: No registered users and 1 guest

cron