Factoring out code common to if/else makes it slightly shorter and less redundant:

               int outputDepId = -1;
               // two fragments
               if (stmt.collector != null) {
                   outputDepId = m_txnState.getNextDependencyId() | DtxnConstants.MULTIPARTITION_DEPENDENCY;
               }
               m_depsForLocalTask[index] = outputDepId;
               if (stmt.inCatalog) {
                   // Add the local fragment data.
                   m_localTask.addFragment(stmt.aggregator.planHash, m_depsToResume[index], params);
                   // Add distributed fragment.
                   if (stmt.collector != null) {
                       m_distributedTask.addFragment(stmt.collector.planHash, outputDepId, params);
                   }
               }
               else {
                   // Add the local fragment data.
                   byte[] planBytes = site.planForFragmentId(stmt.aggregator.id);
                   m_localTask.addCustomFragment(stmt.aggregator.planHash, m_depsToResume[index], params, planBytes);
                   // Add distributed fragment.
                   if (stmt.collector != null) {
                       m_distributedTask.addCustomFragment(stmt.collector.planHash, outputDepId, params, planBytes);
                   }
               }