public String ToString()
{
StringBuilder sb = new StringBuilder();
for (int i = 0; i < this.size(); i++)
{
sb.append(i + "\t" + this.get(i).toString() + "\n");
}
return sb.toString();
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getName() + " {\n");
for (CheckItem item : this) {
sb.append(" " + item.toString() + "\n");
}
sb.append(" }");
return sb.toString();
}
Clone fragments detected by clone detection tool
File path: /ArgoUML-0.34-src/argouml-csharp/src/org/argouml/language/csharp/importer/csparser/collections/ParseStateCollection.java
|
|
File path: /ArgoUML-0.34-src/argouml/src/argouml-app/src/org/argouml/cognitive/checklist/Checklist.java
|
Method name: String ToString()
|
|
Method name: String toString()
|
Number of AST nodes: 2
|
|
Number of AST nodes: 2
|
|
1 | public String ToString() | | 1 | @Override |
2 | { | | 2 | public String toString() { |
3 | StringBuilder sb = new StringBuilder(); | | 3 | StringBuilder sb = new StringBuilder(); |
4 | | | 4 | sb.append(getClass().getName() + " {\n"); |
5 | for (int i = 0; i < this.size(); i++) | | 5 | for (CheckItem item : this) { |
6 | { | | 6 | sb.append(" " + item.toString() + "\n"); |
7 | sb.append(i + "\t" + this.get(i).toString() + "\n"); | | 7 | } |
8 | } | | 8 | sb.append(" }"); |
9 | return sb.toString(); | | 9 | return sb.toString(); |
10 | } | | 10 | } |
See real code fragment |
|
See real code fragment |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 0.0 |
Similarity Score | 0.429 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
2 | for (int i = 0; i < this.size(); i++) | | 3 | for (CheckItem item : this) |
3 | sb.append(i + "\t" + this.get(i).toString() + "\n"); | | | |
| | | 4 | sb.append(" " + item.toString() + "\n"); |
Precondition Violations (4)
Row |
Violation |
1 | Type org.argouml.language.csharp.importer.csparser.collections.ParseStateCollection of variable this does not match with type org.argouml.cognitive.checklist.Checklist of variable this |
2 | Unmatched statement sb.append(i + "\t" + this.get(i).toString()+ "\n"); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement sb.append(" " + item.toString() + "\n"); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Clone fragment #1 returns variable i with type int , while Clone fragment #2 returns variable item with type org.argouml.cognitive.checklist.CheckItem |