You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Knut Anders Hatlen (Created) (JIRA)" <ji...@apache.org> on 2011/10/15 18:11:12 UTC

[jira] [Created] (DERBY-5465) Broken null checks in NsTest

Broken null checks in NsTest
----------------------------

                 Key: DERBY-5465
                 URL: https://issues.apache.org/jira/browse/DERBY-5465
             Project: Derby
          Issue Type: Bug
    Affects Versions: 10.8.2.2
            Reporter: Knut Anders Hatlen
            Assignee: Knut Anders Hatlen
            Priority: Minor


NsTest contains more occurrences of the broken null checking pattern found in DERBY-5442.

Initializer.java:

		if (e.getMessage().equals(null)) {
			e.printStackTrace(System.out);
		}

DbSetup.java:

		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);
		}

DbUtil.java:

		if (e.getMessage().equals(null)) {
			System.out.println(getThreadName()
					+ " dbUtil --> NULL error message detected");
			System.out
			.println(getThreadName()
					+ " dbUtil --> Here is the NULL exection - "
					+ e.toString());
			System.out.println(getThreadName()
					+ " dbUtil --> Stack trace of the NULL exception - ");
			e.printStackTrace(System.out);
		}

If getMessage() returns null, the null checks will throw a NullPointerException instead of evaluating to true.

--
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

        

[jira] [Updated] (DERBY-5465) Broken null checks in NsTest

Posted by "Knut Anders Hatlen (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-5465?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Knut Anders Hatlen updated DERBY-5465:
--------------------------------------

    Attachment: null.diff

Attaching a patch which replaces the broken equals() calls with ==.
                
> Broken null checks in NsTest
> ----------------------------
>
>                 Key: DERBY-5465
>                 URL: https://issues.apache.org/jira/browse/DERBY-5465
>             Project: Derby
>          Issue Type: Bug
>          Components: Test
>    Affects Versions: 10.8.2.2
>            Reporter: Knut Anders Hatlen
>            Assignee: Knut Anders Hatlen
>            Priority: Minor
>         Attachments: null.diff
>
>
> NsTest contains more occurrences of the broken null checking pattern found in DERBY-5452.
> Initializer.java:
> 		if (e.getMessage().equals(null)) {
> 			e.printStackTrace(System.out);
> 		}
> DbSetup.java:
> 		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);
> 		}
> DbUtil.java:
> 		if (e.getMessage().equals(null)) {
> 			System.out.println(getThreadName()
> 					+ " dbUtil --> NULL error message detected");
> 			System.out
> 			.println(getThreadName()
> 					+ " dbUtil --> Here is the NULL exection - "
> 					+ e.toString());
> 			System.out.println(getThreadName()
> 					+ " dbUtil --> Stack trace of the NULL exception - ");
> 			e.printStackTrace(System.out);
> 		}
> If getMessage() returns null, the null checks will throw a NullPointerException instead of evaluating to true.

--
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

        

[jira] [Updated] (DERBY-5465) Broken null checks in NsTest

Posted by "Knut Anders Hatlen (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-5465?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Knut Anders Hatlen updated DERBY-5465:
--------------------------------------

    Description: 
NsTest contains more occurrences of the broken null checking pattern found in DERBY-5452.

Initializer.java:

		if (e.getMessage().equals(null)) {
			e.printStackTrace(System.out);
		}

DbSetup.java:

		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);
		}

DbUtil.java:

		if (e.getMessage().equals(null)) {
			System.out.println(getThreadName()
					+ " dbUtil --> NULL error message detected");
			System.out
			.println(getThreadName()
					+ " dbUtil --> Here is the NULL exection - "
					+ e.toString());
			System.out.println(getThreadName()
					+ " dbUtil --> Stack trace of the NULL exception - ");
			e.printStackTrace(System.out);
		}

If getMessage() returns null, the null checks will throw a NullPointerException instead of evaluating to true.

  was:
NsTest contains more occurrences of the broken null checking pattern found in DERBY-5442.

Initializer.java:

		if (e.getMessage().equals(null)) {
			e.printStackTrace(System.out);
		}

DbSetup.java:

		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);
		}

DbUtil.java:

		if (e.getMessage().equals(null)) {
			System.out.println(getThreadName()
					+ " dbUtil --> NULL error message detected");
			System.out
			.println(getThreadName()
					+ " dbUtil --> Here is the NULL exection - "
					+ e.toString());
			System.out.println(getThreadName()
					+ " dbUtil --> Stack trace of the NULL exception - ");
			e.printStackTrace(System.out);
		}

If getMessage() returns null, the null checks will throw a NullPointerException instead of evaluating to true.

    
> Broken null checks in NsTest
> ----------------------------
>
>                 Key: DERBY-5465
>                 URL: https://issues.apache.org/jira/browse/DERBY-5465
>             Project: Derby
>          Issue Type: Bug
>          Components: Test
>    Affects Versions: 10.8.2.2
>            Reporter: Knut Anders Hatlen
>            Assignee: Knut Anders Hatlen
>            Priority: Minor
>
> NsTest contains more occurrences of the broken null checking pattern found in DERBY-5452.
> Initializer.java:
> 		if (e.getMessage().equals(null)) {
> 			e.printStackTrace(System.out);
> 		}
> DbSetup.java:
> 		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);
> 		}
> DbUtil.java:
> 		if (e.getMessage().equals(null)) {
> 			System.out.println(getThreadName()
> 					+ " dbUtil --> NULL error message detected");
> 			System.out
> 			.println(getThreadName()
> 					+ " dbUtil --> Here is the NULL exection - "
> 					+ e.toString());
> 			System.out.println(getThreadName()
> 					+ " dbUtil --> Stack trace of the NULL exception - ");
> 			e.printStackTrace(System.out);
> 		}
> If getMessage() returns null, the null checks will throw a NullPointerException instead of evaluating to true.

--
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

        

[jira] [Updated] (DERBY-5465) Broken null checks in NsTest

Posted by "Knut Anders Hatlen (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-5465?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Knut Anders Hatlen updated DERBY-5465:
--------------------------------------

    Component/s: Test
    
> Broken null checks in NsTest
> ----------------------------
>
>                 Key: DERBY-5465
>                 URL: https://issues.apache.org/jira/browse/DERBY-5465
>             Project: Derby
>          Issue Type: Bug
>          Components: Test
>    Affects Versions: 10.8.2.2
>            Reporter: Knut Anders Hatlen
>            Assignee: Knut Anders Hatlen
>            Priority: Minor
>
> NsTest contains more occurrences of the broken null checking pattern found in DERBY-5442.
> Initializer.java:
> 		if (e.getMessage().equals(null)) {
> 			e.printStackTrace(System.out);
> 		}
> DbSetup.java:
> 		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);
> 		}
> DbUtil.java:
> 		if (e.getMessage().equals(null)) {
> 			System.out.println(getThreadName()
> 					+ " dbUtil --> NULL error message detected");
> 			System.out
> 			.println(getThreadName()
> 					+ " dbUtil --> Here is the NULL exection - "
> 					+ e.toString());
> 			System.out.println(getThreadName()
> 					+ " dbUtil --> Stack trace of the NULL exception - ");
> 			e.printStackTrace(System.out);
> 		}
> If getMessage() returns null, the null checks will throw a NullPointerException instead of evaluating to true.

--
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

        

[jira] [Closed] (DERBY-5465) Broken null checks in NsTest

Posted by "Knut Anders Hatlen (Closed) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-5465?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Knut Anders Hatlen closed DERBY-5465.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: 10.9.0.0
                   10.8.2.3

Committed to trunk, revision 1183671.
Committed to 10.8, revision 1183672.
                
> Broken null checks in NsTest
> ----------------------------
>
>                 Key: DERBY-5465
>                 URL: https://issues.apache.org/jira/browse/DERBY-5465
>             Project: Derby
>          Issue Type: Bug
>          Components: Test
>    Affects Versions: 10.8.2.2
>            Reporter: Knut Anders Hatlen
>            Assignee: Knut Anders Hatlen
>            Priority: Minor
>             Fix For: 10.8.2.3, 10.9.0.0
>
>         Attachments: null.diff
>
>
> NsTest contains more occurrences of the broken null checking pattern found in DERBY-5452.
> Initializer.java:
> 		if (e.getMessage().equals(null)) {
> 			e.printStackTrace(System.out);
> 		}
> DbSetup.java:
> 		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);
> 		}
> DbUtil.java:
> 		if (e.getMessage().equals(null)) {
> 			System.out.println(getThreadName()
> 					+ " dbUtil --> NULL error message detected");
> 			System.out
> 			.println(getThreadName()
> 					+ " dbUtil --> Here is the NULL exection - "
> 					+ e.toString());
> 			System.out.println(getThreadName()
> 					+ " dbUtil --> Stack trace of the NULL exception - ");
> 			e.printStackTrace(System.out);
> 		}
> If getMessage() returns null, the null checks will throw a NullPointerException instead of evaluating to true.

--
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