db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kristian Waagan (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DERBY-5452) Possible NPE in NsTest.printException()
Date Mon, 10 Oct 2011 09:34:29 GMT

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

Kristian Waagan commented on DERBY-5452:
----------------------------------------

+1
                
> Possible NPE in NsTest.printException()
> ---------------------------------------
>
>                 Key: DERBY-5452
>                 URL: https://issues.apache.org/jira/browse/DERBY-5452
>             Project: Derby
>          Issue Type: Bug
>          Components: Test
>    Affects Versions: 10.9.0.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Knut Anders Hatlen
>            Priority: Minor
>         Attachments: d5452.diff
>
>
> NsTest.printException() contains the following piece of code:
> 		if (e.getMessage().equals(null)) {
> 			System.out.println("NULL error message detected");
> 			System.out.println("Here is the NULL exection - " + e.toString());
> 			System.out.println("Stack trace of the NULL exception - ");
> 			e.printStackTrace(System.out);
> 		}
> It's supposed to detect if e.getMessage() returns null. However, if it does return null,
calling equals() on the return value will result in a NullPointerException.
> The condition should be changed to (e.getMessage() == null).

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message