// Path: backport/src/java/io/UncheckedIOException.java
// public class UncheckedIOException extends RuntimeException {
//   private static final long serialVersionUID = -5719611140800825697L;
// 
//   public UncheckedIOException(IOException cause) {
//     super(cause);
//   }
// 
// }


import static org.objectweb.asm.Opcodes.*;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.UncheckedIOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.jar.JarFile;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassVisitor;
import org.objectweb.asm.MethodVisitor;
    /*
    if (args.length == 3) {
      Path jdkSig = Paths.get(args[2]);
      Files.lines(jdkSig)
           .forEach(line -> {
             String[] parts = line.split("\\.");
             if (parts.length != 2) {
               throw new IllegalStateException("line " + line + " " + Arrays.toString(parts));
             }
             String className = parts[0];
             String method = parts[1];
             ClassMirror classMirror =
                 compatibility.classMirrorMap.computeIfAbsent(className,
                     key -> compatibility.new ClassMirror(key, true));
             classMirror.methods.add(method);
           });
    }*/
    
    
    try(JarFile jarInput = new JarFile(input.toFile());
        BufferedWriter writer = Files.newBufferedWriter(output)) {
      jarInput.stream()
              .forEach(entry -> {
                 try(InputStream inputStream = jarInput.getInputStream(entry)) {
                   String name = entry.getName();
                   if (name.endsWith(".class")) {
                     ClassReader reader = new ClassReader(inputStream);
                     compatibility.parseClass(reader);
                   }
                 } catch (IOException e) {
// Path: backport/src/java/io/UncheckedIOException.java
// public class UncheckedIOException extends RuntimeException {
//   private static final long serialVersionUID = -5719611140800825697L;
// 
//   public UncheckedIOException(IOException cause) {
//     super(cause);
//   }
// 
// }


// Path: backport-build/src/com/github/forax/jrtfs/backport/Compatibility.java
import static org.objectweb.asm.Opcodes.*;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.UncheckedIOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.jar.JarFile;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassVisitor;
import org.objectweb.asm.MethodVisitor;

    /*
    if (args.length == 3) {
      Path jdkSig = Paths.get(args[2]);
      Files.lines(jdkSig)
           .forEach(line -> {
             String[] parts = line.split("\\.");
             if (parts.length != 2) {
               throw new IllegalStateException("line " + line + " " + Arrays.toString(parts));
             }
             String className = parts[0];
             String method = parts[1];
             ClassMirror classMirror =
                 compatibility.classMirrorMap.computeIfAbsent(className,
                     key -> compatibility.new ClassMirror(key, true));
             classMirror.methods.add(method);
           });
    }*/
    
    
    try(JarFile jarInput = new JarFile(input.toFile());
        BufferedWriter writer = Files.newBufferedWriter(output)) {
      jarInput.stream()
              .forEach(entry -> {
                 try(InputStream inputStream = jarInput.getInputStream(entry)) {
                   String name = entry.getName();
                   if (name.endsWith(".class")) {
                     ClassReader reader = new ClassReader(inputStream);
                     compatibility.parseClass(reader);
                   }
                 } catch (IOException e) {
                   throw new UncheckedIOException(e);