// Path: src/main/java/org/pantsbuild/jarjar/misplaced/MisplacedClassProcessorFactory.java
// public class MisplacedClassProcessorFactory {
// 
//   public enum Strategy {
//     /** Strategy which fails-fast with an exception upon hitting misplaced class. */
//     FATAL,
// 
//     /** Strategy which skips past misplaced classes, excluding them from shading. */
//     SKIP,
// 
//     /** Strategy which omits misplaced classes from the output. */
//     OMIT,
// 
//     /**
//      * Strategy which renames misplaced classes to their "proper" location based on their
//      * fully-qualified class name.
//      */
//     MOVE,
//   };
// 
//   private static MisplacedClassProcessorFactory me;
// 
//   public static synchronized MisplacedClassProcessorFactory getInstance() {
//     if (me == null) {
//       me = new MisplacedClassProcessorFactory();
//     }
//     return me;
//   }
// 
//   private MisplacedClassProcessorFactory() {}
// 
//   /**
//    * Returns the default misplaced class processor, which is "omit".
//    */
//   public MisplacedClassProcessor getDefaultProcessor() {
//     return new OmitMisplacedClassProcessor();
//   }
// 
//   /**
//    * Creates a MisplacedClassProcessor according for the given strategy name.
//    *
//    * @param name The case-insensitive user-level strategy name (see the STRATEGY_* constants).
//    * @return The MisplacedClassProcessor corresponding to the strategy name, or the result of
//    * getDefaultProcessor() if name is null.
//    * @throws IllegalArgumentException if an unrecognized non-null strategy name is specified.
//    */
//   public MisplacedClassProcessor getProcessorForName(String name) {
//     if (name == null) {
//       return getDefaultProcessor();
//     }
// 
//     switch (Strategy.valueOf(name.toUpperCase())) {
//       case FATAL: return new FatalMisplacedClassProcessor();
//       case MOVE: return new MoveMisplacedClassProcessor();
//       case OMIT: return new OmitMisplacedClassProcessor();
//       case SKIP: return new SkipMisplacedClassProcessor();
//     }
// 
//     throw new IllegalArgumentException("Unrecognized strategy name \"" + name + "\".");
//   }
// 
// }


import org.pantsbuild.jarjar.misplaced.MisplacedClassProcessorFactory;
import org.pantsbuild.jarjar.util.*;
import java.io.File;
import java.io.IOException;
import java.util.*;
     * @param verbose Whether to verbosely log information.
     * @param skipManifest If true, omits the manifest file from the processed jar.
     * @param misplacedClassStrategy The strategy to use when processing class files that are in the
     * wrong package (see MisplacedClassProcessorFactory.STRATEGY_* constants).
     */
    public MainProcessor(List<PatternElement> patterns, boolean verbose, boolean skipManifest,
                         String misplacedClassStrategy) {
        this.verbose = verbose;
        List<Zap> zapList = new ArrayList<Zap>();
        List<Rule> ruleList = new ArrayList<Rule>();
        List<Keep> keepList = new ArrayList<Keep>();
        for (PatternElement pattern : patterns) {
            if (pattern instanceof Zap) {
                zapList.add((Zap) pattern);
            } else if (pattern instanceof Rule) {
                ruleList.add((Rule) pattern);
            } else if (pattern instanceof Keep) {
                keepList.add((Keep) pattern);
            }
        }

        PackageRemapper pr = new PackageRemapper(ruleList, verbose);
        kp = keepList.isEmpty() ? null : new KeepProcessor(keepList);

        List<JarProcessor> processors = new ArrayList<JarProcessor>();
        if (skipManifest)
            processors.add(ManifestProcessor.getInstance());
        if (kp != null)
            processors.add(kp);

// Path: src/main/java/org/pantsbuild/jarjar/misplaced/MisplacedClassProcessorFactory.java
// public class MisplacedClassProcessorFactory {
// 
//   public enum Strategy {
//     /** Strategy which fails-fast with an exception upon hitting misplaced class. */
//     FATAL,
// 
//     /** Strategy which skips past misplaced classes, excluding them from shading. */
//     SKIP,
// 
//     /** Strategy which omits misplaced classes from the output. */
//     OMIT,
// 
//     /**
//      * Strategy which renames misplaced classes to their "proper" location based on their
//      * fully-qualified class name.
//      */
//     MOVE,
//   };
// 
//   private static MisplacedClassProcessorFactory me;
// 
//   public static synchronized MisplacedClassProcessorFactory getInstance() {
//     if (me == null) {
//       me = new MisplacedClassProcessorFactory();
//     }
//     return me;
//   }
// 
//   private MisplacedClassProcessorFactory() {}
// 
//   /**
//    * Returns the default misplaced class processor, which is "omit".
//    */
//   public MisplacedClassProcessor getDefaultProcessor() {
//     return new OmitMisplacedClassProcessor();
//   }
// 
//   /**
//    * Creates a MisplacedClassProcessor according for the given strategy name.
//    *
//    * @param name The case-insensitive user-level strategy name (see the STRATEGY_* constants).
//    * @return The MisplacedClassProcessor corresponding to the strategy name, or the result of
//    * getDefaultProcessor() if name is null.
//    * @throws IllegalArgumentException if an unrecognized non-null strategy name is specified.
//    */
//   public MisplacedClassProcessor getProcessorForName(String name) {
//     if (name == null) {
//       return getDefaultProcessor();
//     }
// 
//     switch (Strategy.valueOf(name.toUpperCase())) {
//       case FATAL: return new FatalMisplacedClassProcessor();
//       case MOVE: return new MoveMisplacedClassProcessor();
//       case OMIT: return new OmitMisplacedClassProcessor();
//       case SKIP: return new SkipMisplacedClassProcessor();
//     }
// 
//     throw new IllegalArgumentException("Unrecognized strategy name \"" + name + "\".");
//   }
// 
// }


// Path: src/main/java/org/pantsbuild/jarjar/MainProcessor.java
import org.pantsbuild.jarjar.misplaced.MisplacedClassProcessorFactory;
import org.pantsbuild.jarjar.util.*;
import java.io.File;
import java.io.IOException;
import java.util.*;

     * @param verbose Whether to verbosely log information.
     * @param skipManifest If true, omits the manifest file from the processed jar.
     * @param misplacedClassStrategy The strategy to use when processing class files that are in the
     * wrong package (see MisplacedClassProcessorFactory.STRATEGY_* constants).
     */
    public MainProcessor(List<PatternElement> patterns, boolean verbose, boolean skipManifest,
                         String misplacedClassStrategy) {
        this.verbose = verbose;
        List<Zap> zapList = new ArrayList<Zap>();
        List<Rule> ruleList = new ArrayList<Rule>();
        List<Keep> keepList = new ArrayList<Keep>();
        for (PatternElement pattern : patterns) {
            if (pattern instanceof Zap) {
                zapList.add((Zap) pattern);
            } else if (pattern instanceof Rule) {
                ruleList.add((Rule) pattern);
            } else if (pattern instanceof Keep) {
                keepList.add((Keep) pattern);
            }
        }

        PackageRemapper pr = new PackageRemapper(ruleList, verbose);
        kp = keepList.isEmpty() ? null : new KeepProcessor(keepList);

        List<JarProcessor> processors = new ArrayList<JarProcessor>();
        if (skipManifest)
            processors.add(ManifestProcessor.getInstance());
        if (kp != null)
            processors.add(kp);

        JarProcessor misplacedClassProcessor = MisplacedClassProcessorFactory.getInstance()