public static int finalizerPos(JCTree tree) {
        if (tree.getTag() == JCTree.TRY) {
            JCTry t = (JCTry) tree;
            assert t.finalizer != null;
            return firstStatPos(t.finalizer);
        } else if (tree.getTag() == JCTree.SYNCHRONIZED) {
            return endPos(((JCSynchronized) tree).body);
        } else {
            throw new AssertionError();
        }
    }