checkpoint
[sbp.git] / src / edu / berkeley / sbp / util / Reflection.java
index 6a4361f..9d4837a 100644 (file)
@@ -3,6 +3,7 @@ import java.io.*;
 import java.lang.reflect.*;
 import java.lang.annotation.*;
 
+// FIXME: decent error reporting
 /** Random reflection-related utilities */
 public final class Reflection {
     
@@ -219,7 +220,6 @@ public final class Reflection {
                 if (f[i].getType() == String.class) tgt = stringify(tgt);
                 // FUGLY
                 tgt = coerce(tgt, f[i].getType());
-                System.err.println("setting a " + f[i].getType().getName() + " to " + Reflection.show(tgt));
                 f[i].set(ret, tgt);
             }
             return ret;
@@ -239,10 +239,8 @@ public final class Reflection {
                 if (argTypes[i] == String.class) tgt = Reflection.stringify(tgt);
                 // FUGLY
                 tgt = Reflection.coerce(tgt, argTypes[i]);
-                System.err.println("setting a " + argTypes[i].getName() + " to " + Reflection.show(tgt));
                 args[i] = tgt;
             }
-            //System.err.println("invoking " + _method + " with " + Reflection.show(args));
             return _method.invoke(null, args);
         } catch (Exception e) {
             throw new RuntimeException(e);
@@ -259,7 +257,6 @@ public final class Reflection {
                 if (argTypes[i] == String.class) tgt = Reflection.stringify(tgt);
                 // FUGLY
                 tgt = Reflection.coerce(tgt, argTypes[i]);
-                System.err.println("setting a " + argTypes[i].getName() + " to " + Reflection.show(tgt));
                 args[i] = tgt;
             }
             return _ctor.newInstance(args);
@@ -315,12 +312,10 @@ public final class Reflection {
             for(int i=0; i<((Object[])o).length; i++) {
                 Object ob = (((Object[])o)[i]);
                 if (ob != null) {
-                    //System.err.println("no hit with " + c.getComponentType().getName() + " on " + Reflection.show(((Object[])o)[i]));
                     ok = false;
                 }
             }
             if (ok) {
-                //System.err.println("hit with " + c.getComponentType().getName());
                 return Array.newInstance(c.getComponentType(), ((Object[])o).length);
             }
         }