public LocalList finish() {
      aboutToProcess(Integer.MAX_VALUE, 0);

      int resultSz = result.size();
      int finalSz = resultSz - nullResultCount;

      if (finalSz == 0) {
        return EMPTY;
      }

      /*
       * Collect an array of only the non-null entries, and then
       * sort it to get a consistent order for everything: Local
       * ends and starts for a given address could come in any
       * order, but we want ends before starts as well as
       * registers in order (within ends or starts).
       */

      Entry[] resultArr = new Entry[finalSz];

      if (resultSz == finalSz) {
        result.toArray(resultArr);
      } else {
        int at = 0;
        for (Entry e : result) {
          if (e != null) {
            resultArr[at++] = e;
          }
        }
      }

      Arrays.sort(resultArr);

      LocalList resultList = new LocalList(finalSz);

      for (int i = 0; i < finalSz; i++) {
        resultList.set(i, resultArr[i]);
      }

      resultList.setImmutable();
      return resultList;
    }
Finishes processing altogether and gets the result.

@return {@code non-null;} the result list
android/android_framework/dex-maker/src/main/java/com/android/dx/dex/code/LocalList.java