private static void findEdgesLeaving(Statement curr, Statement check, Set<StatEdge> edges, boolean allowExit, Map<Statement, Set<Statement>> found) {
    for (StatEdge edge : curr.getAllSuccessorEdges()) {
      if (!check.containsStatement(edge.getDestination()) && (allowExit || !(edge.getDestination() instanceof DummyExitStatement))) {
        // Check if the edge is either explicit or isn't implicit to an already found edge
        if (edge.explicit || found.entrySet().stream().allMatch(e -> !e.getKey().containsStatement(curr) || !e.getValue().contains(edge.getDestination()))) {
          edges.add(edge);
          found.computeIfAbsent(curr, stat -> new HashSet<>()).add(edge.getDestination());
        }
      }
    }

    for (Statement stat : curr.getStats()) {
      findEdgesLeaving(stat, check, edges, allowExit, found);
    }
  }
Processes try catch statements to turns them into try-with-resources statements wherever possible.
Including the entire classpath is generally needed for this to work as it needs to know which classes implement AutoCloseable.

@author ForgeFlower devs, SuperCoder79
src/org/jetbrains/java/decompiler/modules/decompiler/TryWithResourcesProcessor.java