public void ToSource(StringBuilder sb) {
sb.append("[");
if (Modifiers != Modifier.Empty) {
this.TraceModifiers(this.Modifiers, sb);
sb.append(": ");
}
Name.ToSource(sb);
if (Arguments != null) {
sb.append("(");
String comma = "";
for (int i = 0; i < Arguments.size(); i++) {
sb.append(comma);
Arguments.get(i).ToSource(sb);
comma = ", ";
}
sb.append(")");
}
sb.append("]");
}
public void ToSource(StringBuilder sb)
{
if (attributes != null)
{
attributes.ToSource(sb);
this.NewLine(sb);
}
TraceModifiers(Modifiers, sb);
sb.append("interface ");
Name.ToSource(sb);
sb.append(" ");
if (BaseClasses != null && BaseClasses.size() > 1)
{
sb.append(": ");
String comma = "";
for (TypeNode bcls:BaseClasses)
{
sb.append(comma);
comma = ", ";
bcls.ToSource(sb);
}
}
this.NewLine(sb);
sb.append("{");
indent++;
this.NewLine(sb);
if (Properties != null)
{
Properties.ToSource(sb);
}
if (Methods != null)
{
Methods.ToSource(sb);
}
if (Indexers != null)
{
Indexers.ToSource(sb);
}
if (Events != null)
{
Events.ToSource(sb);
}
indent--;
this.NewLine(sb);
sb.append("}");
this.NewLine(sb);
}
Clone fragments detected by clone detection tool
File path: /ArgoUML-0.34-src/argouml-csharp/src/org/argouml/language/csharp/importer/csparser/structural/AttributeNode.java
|
|
File path: /ArgoUML-0.34-src/argouml-csharp/src/org/argouml/language/csharp/importer/csparser/types/InterfaceNode.java
|
Method name: void ToSource(StringBuilder)
|
|
Method name: void ToSource(StringBuilder)
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | public void ToSource(StringBuilder sb) { | | 1 | public void ToSource(StringBuilder sb) |
2 | sb.append("["); | | 2 | { |
3 | if (Modifiers != Modifier.Empty) { | | 3 | if (attributes != null) |
4 | this.TraceModifiers(this.Modifiers, sb); | | 4 | { |
5 | sb.append(": "); | | 5 | attributes.ToSource(sb); |
6 | } | | 6 | this.NewLine(sb); |
7 | Name.ToSource(sb); | | 7 | } |
8 | | | 8 | TraceModifiers(Modifiers, sb); |
9 | if (Arguments != null) { | | 9 | |
10 | sb.append("("); | | 10 | sb.append("interface "); |
11 | String comma = ""; | | 11 | Name.ToSource(sb); |
12 | for (int i = 0; i < Arguments.size(); i++) { | | 12 | sb.append(" "); |
13 | sb.append(comma); | | 13 | |
14 | Arguments.get(i).ToSource(sb); | | 14 | if (BaseClasses != null && BaseClasses.size() > 1) |
15 | comma = ", "; | | 15 | { |
16 | } | | 16 | sb.append(": "); |
17 | sb.append(")"); | | 17 | String comma = ""; |
18 | } | | 18 | for (TypeNode bcls:BaseClasses) |
19 | sb.append("]"); | | 19 | { |
20 | } | | 20 | sb.append(comma); |
| | | 21 | comma = ", "; |
| | | 22 | bcls.ToSource(sb); |
| | | 23 | } |
| | | 24 | } |
| | | 25 | |
| | | 26 | this.NewLine(sb); |
| | | 27 | sb.append("{"); |
| | | 28 | indent++; |
| | | 29 | this.NewLine(sb); |
| | | 30 | |
| | | 31 | if (Properties != null) |
| | | 32 | { |
| | | 33 | Properties.ToSource(sb); |
| | | 34 | } |
| | | 35 | if (Methods != null) |
| | | 36 | { |
| | | 37 | Methods.ToSource(sb); |
| | | 38 | } |
| | | 39 | if (Indexers != null) |
| | | 40 | { |
| | | 41 | Indexers.ToSource(sb); |
| | | 42 | } |
| | | 43 | if (Events != null) |
| | | 44 | { |
| | | 45 | Events.ToSource(sb); |
| | | 46 | } |
| | | 47 | |
| | | 48 | indent--; |
| | | 49 | this.NewLine(sb); |
| | | 50 | sb.append("}"); |
| | | 51 | this.NewLine(sb); |
| | | 52 | |
| | | 53 | } |
See real code fragment |
|
See real code fragment |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 5 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 0.0 |
Similarity Score | 0.429 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
9 | for (int i = 0; i < Arguments.size(); i++) | | 11 | for (TypeNode bcls : BaseClasses) |
10 | | | 12 | |
11 | Arguments.get(i).ToSource(sb); | | 14 | |
12 | | | 13 | |
Precondition Violations (3)
Row |
Violation |
1 | Type org.argouml.language.csharp.importer.csparser.collections.NodeCollection<org.argouml.language.csharp.importer.csparser.structural.AttributeArgumentNode> of variable Arguments does not match with type java.util.List<org.argouml.language.csharp.importer.csparser.nodes.expressions.TypeNode> of variable BaseClasses |
2 | Type org.argouml.language.csharp.importer.csparser.collections.NodeCollection<org.argouml.language.csharp.importer.csparser.structural.AttributeArgumentNode> of variable Arguments does not match with type java.util.List<org.argouml.language.csharp.importer.csparser.nodes.expressions.TypeNode> of variable BaseClasses |
3 | Expression bcls cannot be parameterized, because it has dependencies to/from statements that will be extracted |