@Override
    public Boolean call() throws Exception {
      try {
        ClassDefItem clazz = futureClazz.get();
        if (clazz != null) {
          addClassToDex(clazz);
          updateStatus(true);
        }
        return true;
      } catch (ExecutionException ex) {
        // Rethrow previously uncaught translation exceptions.
        // These, as well as any exceptions from addClassToDex,
        // are handled and reported in processAllFiles().
        Throwable t = ex.getCause();
        throw (t instanceof Exception) ? (Exception) t : ex;
      } finally {
        if (args.multiDex) {
          // Having added our actual indicies to the dex file,
          // we subtract our original estimate from the total estimate,
          // and signal the translation phase, which may be paused
          // waiting to determine if more classes can be added to the
          // current dex file, or if a new dex file must be created.
          synchronized (dexRotationLock) {
            maxMethodIdsInProcess -= maxMethodIdsInClass;
            maxFieldIdsInProcess -= maxFieldIdsInClass;
            dexRotationLock.notifyAll();
          }
        }
      }
    }
Callable helper class used to collect the results of the parallel translation phase, adding the
translated classes to the current dex file in correct (deterministic) file order. This class is
also responsible for coordinating dex file rotation with the DirectClassFileConsumer class.
android/android_framework/dex-maker/src/main/java/com/android/dx/command/dexer/Main.java