protected static Object primitiveInstance(Class type) {
        Object r = null;

        if (type.equals(Boolean.TYPE)) {
            r = false;
        } else if (type.equals(Integer.TYPE)) {
            r = 0;
        } else if (type.equals(Short.TYPE)) {
            r = 0;
        } else if (type.equals(Byte.TYPE)) {
            r = new Byte("0");
        } else if (type.equals(Float.TYPE)) {
            r = 0.0f;
        } else if (type.equals(Double.TYPE)) {
            r = 0.0d;
        } else if (type.equals(Character.TYPE)) {
            r = ' ';
        } else if (type.equals(Long.TYPE)) {
            r = 0L;
        }
        return r;
    }