package com.github.rschmitt.dynamicobject;

import clojure.java.api.Clojure;
import clojure.lang.IFn;

import java.io.IOException;
import java.io.Writer;

import static java.lang.String.format;

public final class RecordPrinter {
    private static final IFn WITH_META = Clojure.var("clojure.core", "with-meta");

    private RecordPrinter() {
    }

    /**
     * For use by print-method only. Do not call directly.
     */
    public static Object printRecord(Object obj, Writer writer, String tag) {
        obj = WITH_META.invoke(obj, null);
        try {
            writer.write(format("#%s%s", tag, obj.toString()));
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        return null;
    }
}

@@ -50,320 +50,205 @@
 ort 
-clojure.java.api.Clojure;%0D%0Aimport clojure.lang.IFn;%0D%0A%0D%0Aimport java.io.IOException;%0D%0Aimport java.io.Writer;%0D%0A%0D%0Aimport static java.lang.String.format;%0D%0A%0D%0Apublic final class RecordPrinter %7B%0D%0A    private static final IFn WITH_META = Clojure.var(%22clojure.core%22, %22with-meta%22);%0D%0A%0D%0A    private RecordPrinter() %7B%0D%0A    %7D%0D%0A
+java.io.IOException;%0D%0Aimport java.io.Writer;%0D%0A%0D%0Aimport static com.github.rschmitt.dynamicobject.ClojureStuff.WITH_META;%0D%0Aimport static java.lang.String.format;%0D%0A%0D%0Apublic final class RecordPrinter %7B
 %0D%0A  
@@ -398,16 +398,35 @@
 ing tag)
+ throws IOException
  %7B%0D%0A    
@@ -469,27 +469,8 @@
 );%0D%0A
-        try %7B%0D%0A    
     
@@ -530,98 +530,8 @@
 );%0D%0A
-        %7D catch (IOException e) %7B%0D%0A            throw new RuntimeException(e);%0D%0A        %7D%0D%0A
     

Simplify RecordPrinter