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();
}
protected void TraceDottedIdent(String[] target, StringBuilder sb)
{
String dot = "";
for(String s:target)
{
sb.append(dot + s);
dot = ".";
}
}
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-csharp/src/org/argouml/language/csharp/importer/csparser/nodes/expressions/BaseNode.java
|
Method name: String ToString()
|
|
Method name: void TraceDottedIdent(String[], StringBuilder)
|
Number of AST nodes: 2
|
|
Number of AST nodes: 3
|
|
1 | public String ToString() | | 1 | protected void TraceDottedIdent(String[] target, StringBuilder sb) |
2 | { | | 2 | { |
3 | StringBuilder sb = new StringBuilder(); | | 3 | String dot = ""; |
4 | | | 4 | for(String s:target) |
5 | for (int i = 0; i < this.size(); i++) | | 5 | { |
6 | { | | 6 | sb.append(dot + s); |
7 | sb.append(i + "\t" + this.get(i).toString() + "\n"); | | 7 | dot = "."; |
8 | } | | 8 | } |
9 | return sb.toString(); | | 9 | } |
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 | 2 |
Time elapsed for statement mapping (ms) | 0.0 |
Similarity Score | 0.600 |
Clone type | Type 3 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
2 | for (int i = 0; i < this.size(); i++) | | 2 | for (String s : target) |
| | | 3 | |
3 | sb.append(i + "\t" + this.get(i).toString() + "\n"); | | | |
| | | 4 | |
Precondition Violations (5)
Row |
Violation |
1 | Type org.argouml.language.csharp.importer.csparser.collections.ParseStateCollection of variable this does not match with type java.lang.String[] of variable target |
2 | Unmatched statement sb.append(dot + s); 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(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 |
4 | Unmatched statement dot="."; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
5 | Clone fragment #1 returns variable i with type int , while Clone fragment #2 returns variable s with type java.lang.String |