Details

    • Type: Sub-task Sub-task
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.0.3, 1.1.0, 1.2.1, 1.3.0, 2.0.0-M2
    • Fix Version/s: 1.3.0, 2.0.0-M3
    • Component/s: None
    • Labels:
      None
    • Patch Info:
      Patch Available

      Description

      The org.apache.openjpa.persistence.QueryImpl hashcode() implementation does not ensure that recursive invocations of hashcode() on object(s) in that method will not result in a NullPointerException. I.e., in this specific case it does not check whether _query is null, and it should since there is no guarantee that _query will always be non-null.

      1. OPENJPA-1315.patch
        0.8 kB
        Tim McConnell

        Activity

        Hide
        Tim McConnell added a comment -

        Added check to hashcode() method to ensure that _query is not null prior to invoking its hashcode method.
        Again, no testcase is provided in this case as it can be easily reproduced while debugging in Eclipse, or adding println() statements to QueryImpl instantiation of _query (which is what I did for expediency), which will invoke the toString() method, which will invoke the hashcode() method, which will cause a NullPointerException. If a testcase is preferred though please let me know.

        Show
        Tim McConnell added a comment - Added check to hashcode() method to ensure that _query is not null prior to invoking its hashcode method. Again, no testcase is provided in this case as it can be easily reproduced while debugging in Eclipse, or adding println() statements to QueryImpl instantiation of _query (which is what I did for expediency), which will invoke the toString() method, which will invoke the hashcode() method, which will cause a NullPointerException. If a testcase is preferred though please let me know.
        Hide
        Donald Woods added a comment -

        Applied to trunk as r818195 and 1.3.0 as r818198.

        Show
        Donald Woods added a comment - Applied to trunk as r818195 and 1.3.0 as r818198.

          People

          • Assignee:
            Donald Woods
            Reporter:
            Tim McConnell
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development