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

        Tim McConnell created issue -
        Tim McConnell made changes -
        Field Original Value New Value
        Fix Version/s 2.0.0 [ 12314019 ]
        Affects Version/s 2.0.0 [ 12314019 ]
        Priority Major [ 3 ] Minor [ 4 ]
        Tim McConnell made changes -
        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.
        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.
        Tim McConnell made changes -
        Attachment OPENJPA-1315.patch [ 12420238 ]
        Donald Woods made changes -
        Assignee Tim McConnell [ mcconne ] Donald Woods [ drwoods ]
        Fix Version/s 2.0.0-M3 [ 12314148 ]
        Fix Version/s 2.0.0 [ 12314019 ]
        Affects Version/s 2.0.0-M2 [ 12313483 ]
        Affects Version/s 1.2.1 [ 12313328 ]
        Affects Version/s 1.1.0 [ 12312344 ]
        Affects Version/s 1.0.3 [ 12312969 ]
        Affects Version/s 1.3.0 [ 12313326 ]
        Affects Version/s 2.0.0 [ 12314019 ]
        Donald Woods made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        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.
        Donald Woods made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Fix Version/s 1.3.0 [ 12313326 ]
        Resolution Fixed [ 1 ]
        Donald Woods made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open In Progress In Progress
        3d 17h 5m 1 Donald Woods 23/Sep/09 19:43
        In Progress In Progress Resolved Resolved
        5m 16s 1 Donald Woods 23/Sep/09 19:48
        Resolved Resolved Closed Closed
        166d 23h 42m 1 Donald Woods 09/Mar/10 18:31

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development