public String toJSON() {
final StringBuilder b = new StringBuilder();
b.append("{");
b.append(" \"repo\" : \"").append(this.repo).append("\",");
if(this.repoPath!=null) b.append(" \"repoPath\" : \"").append(this.repoPath).append("\",");
b.append(" \"constructId\" : ").append(this.getConstruct().getId().toJSON()).append(",");
if(this.commit!=null) b.append(" \"commit\" : \"").append(this.commit).append("\",");
b.append(" \"constructChangeType\":\"").append(this.getType().toString()).append("\",");
if(this.committedAt!=null) b.append(" \"committedAt\" : \"").append(StringUtil.formatDate(Long.parseLong(this.getCommittedAt()))).append("\"");
if(this.getType() == ConstructChangeType.MOD ){
if(this.fixSignature != null)
b.append(",\"fixedBody\":").append(JsonBuilder.escape(this.fixSignature.toJson().toString()));
if(this.defSignature != null)
b.append(",\"buggyBody\":").append(JsonBuilder.escape(this.defSignature.toJson().toString()));
if(signatureChange != null)
b.append(",\"bodyChange\":").append(JsonBuilder.escape(signatureChange.toJSON().toString()));
}
b.append("}");
return b.toString();
}