public String toJSON() { final StringBuilder b = new StringBuilder(); // Key information 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("\","); // Other information b.append(" \"constructChangeType\":\"").append(this.getType().toString()).append("\","); if(this.committedAt!=null) b.append(" \"committedAt\" : \"").append(StringUtil.formatDate(Long.parseLong(this.getCommittedAt()))).append("\""); // Buggy method body, fixed one and applied changes if(this.getType() == ConstructChangeType.MOD ){ if(this.fixSignature != null) //b.append(" \"description\" : ").append(JsonBuilder.escape(this.bugDescription)).append(", "); b.append(",\"fixedBody\":").append(JsonBuilder.escape(this.fixSignature.toJson().toString())); //b.append(getFixConstructASTSignature().toJson().toString()).append(" ,"); if(this.defSignature != null) b.append(",\"buggyBody\":").append(JsonBuilder.escape(this.defSignature.toJson().toString())); //b.append(getDefConstructASTSignature().toJson().toString()).append(" ,"); if(signatureChange != null) //b.append(" \"signatureChange\" : ").append(astDiff.toJSON().toString()).append(" ,"); //b.append("\"sigchg \" :[").append(JsonBuilder.escape(astDiff.toJSON().toString())).append("]").append(" ,"); b.append(",\"bodyChange\":").append(JsonBuilder.escape(signatureChange.toJSON().toString())); //b.append(astDiff.toJSON().toString()).append(" ,"); } b.append("}"); return b.toString(); }
if ( (m++)>0 ) json.append(","); json.append("{"); json.append("\"constructId\":").append(cid.getConstructId().toJSON());
public String toJSON() { final JsonBuilder jb = new JsonBuilder(); jb.startObject(); jb.appendObjectProperty("id", this.id.toJSON(), false); jb.appendObjectProperty("cd", this.contentDigest); jb.endObject(); return jb.getJson(); } @Override
public String toJSON() { final JsonBuilder jb = new JsonBuilder(); jb.startObject(); jb.appendObjectProperty("tracedAt", StringUtil.formatDate(this.t)); jb.appendObjectProperty("count", new Integer(this.counter)); jb.appendObjectProperty("executionId", this.executionId); if(this.appContext!=null) jb.appendObjectProperty("app", JacksonUtil.asJsonString(this.appContext), false); if(this.archiveFileName!=null && this.archiveDigest!=null) { jb.appendObjectProperty("lib", this.archiveDigest); jb.appendObjectProperty("filename", this.archiveFileName); } if(this.junitContexts!=null && this.junitContexts.size()>0) { jb.startArrayProperty("junits"); for(ConstructId junit: this.junitContexts) jb.appendJsonToArray(junit.toJSON()); jb.endArray(); } //if(this.loader!=null) b.append(", \"loader\" : ").append(this.loader.toJSON()).append(""); jb.appendObjectProperty("constructId", c.toJSON(), false); jb.endObject(); return jb.toString(); } public void merge(ConstructUsage _other) {