Details

    • Type: Sub-task Sub-task
    • Status: Closed
    • Priority: Major Major
    • 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: jpa
    • Labels:
      None
    • Patch Info:
      Patch Available
    1. OPENJPA-1319.patch
      0.9 kB
      Tim McConnell

      Activity

      Hide
      Tim McConnell added a comment - - edited

      Same problem(s) as in OPENJPA-1301 and the same resolution is provided in this patch. Again, no testcase is provided in this case as it can be easily reproduced while debugging in Eclipse, or adding println() statements to EntityManagerImpl prior to the instantiation of _broker (which is what I did), which will invoke the toString() method, which will invoke the hashcode() method, which will cause a NullPointerException.

      Show
      Tim McConnell added a comment - - edited Same problem(s) as in OPENJPA-1301 and the same resolution is provided in this patch. Again, no testcase is provided in this case as it can be easily reproduced while debugging in Eclipse, or adding println() statements to EntityManagerImpl prior to the instantiation of _broker (which is what I did), which will invoke the toString() method, which will invoke the hashcode() method, which will cause a NullPointerException.
      Hide
      Michael Dick added a comment -

      Hi Tim,

      Can you reproduce the NPE without instrumenting OpenJPA code? It looks like this problem can only be triggered if you add diagnostic info.. Just making sure I'm reading this issue correctly.

      Show
      Michael Dick added a comment - Hi Tim, Can you reproduce the NPE without instrumenting OpenJPA code? It looks like this problem can only be triggered if you add diagnostic info.. Just making sure I'm reading this issue correctly.
      Hide
      Donald Woods added a comment -

      Committed to trunk as r817273 and 1.3.x as r817274.

      Show
      Donald Woods added a comment - Committed to trunk as r817273 and 1.3.x as r817274.
      Hide
      Tim McConnell added a comment -

      Hi Mike, these problems can be easily reproduced in the Eclipse debugger without adding any diagnostics to the OpenJPA code, which is how I initially uncovered the problem. When you set a breakpoint and interrogate an instance of one of these classes, Eclipse will invoke the toString() method for that class on your behalf, which will in turn invoke the hashcode() method which may cause a NPE based on the state of the object when it is interrogated. At least for me I find this behavior to be extremely distracting especially when I'm trying to find and fix other problems.

      I'm only adding diagnostic info code for the sake of efficiency to quickly uncover all these problems since it emulates what will happen in Eclipse (i.e., toString() invoking hashcode()), and is much faster for me. If you'd prefer actual testcases I can provide them as well, but it will take me much longer to reproduce and fix them. Thanks

      Show
      Tim McConnell added a comment - Hi Mike, these problems can be easily reproduced in the Eclipse debugger without adding any diagnostics to the OpenJPA code, which is how I initially uncovered the problem. When you set a breakpoint and interrogate an instance of one of these classes, Eclipse will invoke the toString() method for that class on your behalf, which will in turn invoke the hashcode() method which may cause a NPE based on the state of the object when it is interrogated. At least for me I find this behavior to be extremely distracting especially when I'm trying to find and fix other problems. I'm only adding diagnostic info code for the sake of efficiency to quickly uncover all these problems since it emulates what will happen in Eclipse (i.e., toString() invoking hashcode()), and is much faster for me. If you'd prefer actual testcases I can provide them as well, but it will take me much longer to reproduce and fix them. Thanks
      Hide
      Michael Dick added a comment -

      Got it, thanks for the explanation. No worries about the testcases just read the issue quickly and didn't grok why there weren't any.

      Show
      Michael Dick added a comment - Got it, thanks for the explanation. No worries about the testcases just read the issue quickly and didn't grok why there weren't any.

        People

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

          Dates

          • Created:
            Updated:
            Resolved:

            Development