@Override public final int compareTo(ConstructChange _cc) { final int id_comparison_result = this.getConstruct().getId().compareTo(_cc.getConstruct().getId()); if (id_comparison_result==0 && this.commit!=null) return this.commit.compareTo(_cc.commit); else return id_comparison_result; } }
public String toString() { final StringBuffer buffer = new StringBuffer(); buffer.append(this.getType().toString()); buffer.append(" "); buffer.append(this.getConstruct()); buffer.append(System.getProperty("line.separator")); //If there is a signature for the construct //Note : It will not be generated for these constructs (CLASS, CLASSINIT, PACKAGE) but these types are collected as a construct if(fixSignature != null){ buffer.append("F_AST :" + fixSignature.toJson() + System.getProperty("line.separator")); buffer.append(System.getProperty("line.separator")); } if( defSignature != null){ //buffer.append("D_AST :" + defSignature.toJson()); buffer.append("D_AST :" + this.defSignature.toJson()); buffer.append(System.getProperty("line.separator")); } if(signatureChange != null){ buffer.append(System.getProperty("line.separator") + "AST_Diff_json : " + signatureChange.toJSON()); buffer.append(System.getProperty("line.separator")); } return buffer.toString(); }
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(); }
ConstructId tocheck = c.getConstruct().getId(); boolean toDelete = true; if(tocheck.getSharedType()==ConstructType.CLAS) { for(ConstructChange in : ch_array) { if(tocheck.equals(in.getConstruct().getId().getDefinitionContext())) { toDelete = false; break;