writer.write(" {};");
} else if (DEFAULT_TYPE_MAP.contains(tp.fullName())) {
writeDefaultType(writer, tp, path);
writer.write(";");
} else if (tp instanceof JDefinedClass) {
JDefinedClass jdc = (JDefinedClass)tp;
if (jdc.getClassType() == ClassType.ENUM) {
//no way to get the field list as it's private with
//no accessors :-(
try {
Field f = jdc.getClass().getDeclaredField("enumConstantsByName");
ReflectionUtil.setAccessible(f);
Map<?, ?> map = (Map<?, ?>)f.get(jdc);
Set<String> values = CastUtils.cast(map.keySet());
String first = defaultValues.chooseEnumValue(path, values);
writer.write(tp.fullName());
writer.write(".");
writer.write(first);
writer.write(";");
} catch (Exception e) {
IOException ex = new IOException(e.getMessage());
ex.initCause(e);
throw ex;
}
} else if (jdc.isAbstract()) {
writer.write("null;");
} else {
writer.write("new ");
writer.write(tp.fullName());
writer.write("();");