gt:             if (cInJar != null)
context: package cpw.mods.fml.common.asm.transformers;
  
  import java.io.BufferedOutputStream;
  import java.io.BufferedReader;
  import java.io.ByteArrayOutputStream;
  import java.io.DataInputStream;
  import java.io.File;
  import java.io.FileInputStream;
  import java.io.FileNotFoundException;
  import java.io.FileOutputStream;
  import java.io.IOException;
  import java.io.InputStream;
  import java.io.InputStreamReader;
  import java.util.ArrayList;
  import java.util.Collections;
  import java.util.Enumeration;
  import java.util.HashSet;
  import java.util.Hashtable;
  import java.util.LinkedHashSet;
  import java.util.List;
  import java.util.Map.Entry;
  import java.util.zip.ZipEntry;
  import java.util.zip.ZipFile;
  import java.util.zip.ZipOutputStream;
  
  import org.objectweb.asm.ClassReader;
  import org.objectweb.asm.ClassWriter;
  import org.objectweb.asm.Type;
  import org.objectweb.asm.tree.AnnotationNode;
  import org.objectweb.asm.tree.ClassNode;
  import org.objectweb.asm.tree.FieldNode;
  import org.objectweb.asm.tree.MethodNode;
  
  import com.google.common.base.Objects;
  import com.google.common.collect.Lists;
  import com.google.common.collect.Sets;
  
  import cpw.mods.fml.relauncher.Side;
  import cpw.mods.fml.relauncher.SideOnly;
  
  public class MCPMerger
  {
      private static Hashtable<String, ClassInfo> clients = new Hashtable<String, ClassInfo>();
      private static Hashtable<String, ClassInfo> shared  = new Hashtable<String, ClassInfo>();
      private static Hashtable<String, ClassInfo> servers = new Hashtable<String, ClassInfo>();
      private static HashSet<String> copyToServer = new HashSet<String>();
      private static HashSet<String> copyToClient = new HashSet<String>();
      private static HashSet<String> dontAnnotate = new HashSet<String>();
      private static final boolean DEBUG = false;
  
      public static void main(String[] args)
      {
          if (args.length != 3)
          {
              System.out.println("Usage: MCPMerger <MapFile> <minecraft.jar> <minecraft_server.jar>");
              System.exit(1);
          }
  
          File map_file = new File(args[0]);
          File client_jar = new File(args[1]);
          File server_jar = new File(args[2]);
          File client_jar_tmp = new File(args[1] + ".MergeBack");
          File server_jar_tmp = new File(args[2] + ".MergeBack");
  
  
          if (client_jar_tmp.exists() && !client_jar_tmp.delete())
          {
              System.out.println("Could not delete temp file: " + client_jar_tmp);
          }
  
          if (server_jar_tmp.exists() && !server_jar_tmp.delete())
          {
              System.out.println("Could not delete temp file: " + server_jar_tmp);
          }
  
          if (!client_jar.exists())
          {
              System.out.println("Could not find minecraft.jar: " + client_jar);
              System.exit(1);
          }
  
          if (!server_jar.exists())
          {
              System.out.println("Could not find minecraft_server.jar: " + server_jar);
              System.exit(1);
          }
  
          if (!client_jar.renameTo(client_jar_tmp))
          {
              System.out.println("Could not rename file: " + client_jar + " -> " + client_jar_tmp);
              System.exit(1);
          }
  
          if (!server_jar.renameTo(server_jar_tmp))
          {
              System.out.println("Could not rename file: " + server_jar + " -> " + server_jar_tmp);
              System.exit(1);
          }
  
          if (!readMapFile(map_file))
          {
              System.out.println("Could not read map file: " + map_file);
              System.exit(1);
          }
  
          try
          {
              processJar(client_jar_tmp, server_jar_tmp, client_jar, server_jar);
          }
          catch (IOException e)
          {
              e.printStackTrace();
              System.exit(1);
          }
  
          if (!client_jar_tmp.delete())
          {
              System.out.println("Could not delete temp file: " + client_jar_tmp);
          }
  
          if (!server_jar_tmp.delete())
          {
              System.out.println("Could not delete temp file: " + server_jar_tmp);
          }
      }
  
      private static boolean readMapFile(File mapFile)
      {
          try
          {
              FileInputStream fstream = new FileInputStream(mapFile);
              DataInputStream in = new DataInputStream(fstream);
              BufferedReader br = new BufferedReader(new InputStreamReader(in));
  
              String line;
              while ((line = br.readLine()) != null)
              {
                  line = line.split("#")[0];
                  char cmd = line.charAt(0);
                  line = line.substring(1).trim();
                  
                  switch (cmd)
                  {
                      case '!': dontAnnotate.add(line); break;
                      case '<': copyToClient.add(line); break;
                      case '>': copyToServer.add(line); break; 
                  }
              }
  
              in.close();
              return true;
          }
          catch (Exception e)
          {
              System.err.println("Error: " + e.getMessage());
              return false;
          }
      }
  
      public static void processJar(File clientInFile, File serverInFile, File clientOutFile, File serverOutFile) throws IOException
      {
          ZipFile cInJar = null;
          ZipFile sInJar = null;
          ZipOutputStream cOutJar = null;
          ZipOutputStream sOutJar = null;
  
          try
          {
              try
              {
                  cInJar = new ZipFile(clientInFile);
                  sInJar = new ZipFile(serverInFile);
              }
              catch (FileNotFoundException e)
              {
                  throw new FileNotFoundException("Could not open input file: " + e.getMessage());
              }
              try
              {
                  cOutJar = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(clientOutFile)));
                  sOutJar = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(serverOutFile)));
              }
              catch (FileNotFoundException e)
              {
                  throw new FileNotFoundException("Could not open output file: " + e.getMessage());
              }
              Hashtable<String, ZipEntry> cClasses = getClassEntries(cInJar, cOutJar);
              Hashtable<String, ZipEntry> sClasses = getClassEntries(sInJar, sOutJar);
              HashSet<String> cAdded = new HashSet<String>();
              HashSet<String> sAdded = new HashSet<String>();
  
              for (Entry<String, ZipEntry> entry : cClasses.entrySet())
              {
                  String name = entry.getKey();
                  ZipEntry cEntry = entry.getValue();
                  ZipEntry sEntry = sClasses.get(name);
  
                  if (sEntry == null)
                  {
                      if (!copyToServer.contains(name))
                      {
                          copyClass(cInJar, cEntry, cOutJar, null, true);
                          cAdded.add(name);
                      }
                      else
                      {
                          if (DEBUG)
                          {
                              System.out.println("Copy class c->s : " + name);
                          }
                          copyClass(cInJar, cEntry, cOutJar, sOutJar, true);
                          cAdded.add(name);
                          sAdded.add(name);
                      }
                      continue;
                  }
  
                  sClasses.remove(name);
                  ClassInfo info = new ClassInfo(name);
                  shared.put(name, info);
  
                  byte[] cData = readEntry(cInJar, entry.getValue());
                  byte[] sData = readEntry(sInJar, sEntry);
                  byte[] data = processClass(cData, sData, info);
  
                  ZipEntry newEntry = new ZipEntry(cEntry.getName());
                  cOutJar.putNextEntry(newEntry);
                  cOutJar.write(data);
                  sOutJar.putNextEntry(newEntry);
                  sOutJar.write(data);
                  cAdded.add(name);
                  sAdded.add(name);
              }
  
              for (Entry<String, ZipEntry> entry : sClasses.entrySet())
              {
                  if (DEBUG)
                  {
                      System.out.println("Copy class s->c : " + entry.getKey());
                  }
                  copyClass(sInJar, entry.getValue(), cOutJar, sOutJar, false);
              }
  
              for (String name : new String[]{SideOnly.class.getName(), Side.class.getName()})
              {
                  String eName = name.replace(".", "/");
                  byte[] data = getClassBytes(name);
                  ZipEntry newEntry = new ZipEntry(name.replace(".", "/").concat(".class"));
                  if (!cAdded.contains(eName))
                  {
                      cOutJar.putNextEntry(newEntry);
                      cOutJar.write(data);
                  }
                  if (!sAdded.contains(eName))
                  {
                      sOutJar.putNextEntry(newEntry);
                      sOutJar.write(data);
                  }
              }
  
          }
          finally
          {
  