OpenJPA
  1. OpenJPA
  2. OPENJPA-403

LoadFetchGroup patch (OPENJPA-370) introduces NPE

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 1.0.1, 1.1.0
    • Fix Version/s: 1.0.1, 1.1.0
    • Component/s: None
    • Labels:
      None

      Description

      From the patch:

      // post process for the fetchGroup: if there is a
      // fetchgroup field, then go to the FetchConfiguration
      // to get the required fetch fields.
      if (fgs != null) {
      if (fields == null)
      fields = new BitSet(fmds.length);
      BitSet fgFields = fetch.requiresFetch(fgs, fmds);
      // merge the fetchgroup required fields to the original
      // fields only the fields are not already loaded and
      // are not in the original fields.
      for (int j = 0; j < fgFields.length(); j++)

      { if (fgFields.get(j) && !fields.get(j) && !_loaded.get(j)) fields.set(j); }

      }

      That code introduces an NPE if fetch is null. This is legal; see PNonTransState:108, for example.

        Issue Links

          Activity

          Hide
          Kevin Sutter added a comment -

          Now resolved for both 1.1.0 and 1.0.x branches. Thanks, Patrick and Teresa.

          Show
          Kevin Sutter added a comment - Now resolved for both 1.1.0 and 1.0.x branches. Thanks, Patrick and Teresa.
          Hide
          Teresa Kan added a comment -

          The 1.0.x branches need to be sync up with the 1.1.0 trunk..

          Show
          Teresa Kan added a comment - The 1.0.x branches need to be sync up with the 1.1.0 trunk..
          Hide
          Teresa Kan added a comment -

          Patrick,
          Yes, your patch looks good. I did not catch this situation before..Thanks for fixing it.

          Teresa

          Show
          Teresa Kan added a comment - Patrick, Yes, your patch looks good. I did not catch this situation before..Thanks for fixing it. Teresa
          Hide
          Patrick Linskey added a comment -

          This has been fixed in the 1.1.0 branch (trunk).

          Show
          Patrick Linskey added a comment - This has been fixed in the 1.1.0 branch (trunk).

            People

            • Assignee:
              Patrick Linskey
              Reporter:
              Patrick Linskey
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development