public void ToSource(StringBuilder sb) { if (attributes != null) { attributes.ToSource(sb); this.NewLine(sb); } this.TraceModifiers(this.modifiers, sb); sb.append("const "); this.type.ToSource(sb); sb.append(" "); String comma = ""; for (int i = 0; i < this.names.size(); i++) { sb.append(comma); comma = ", "; this.names.get(i).ToSource(sb); } if (this.Value != null) { sb.append(" = "); this.Value.ToSource(sb); } sb.append(";"); this.NewLine(sb); }
public void ToSource(StringBuilder sb) { if (attributes != null) { attributes.ToSource(sb); this.NewLine(sb); } TraceModifiers(Modifiers, sb); sb.append("delegate "); Type.ToSource(sb); sb.append(" "); Name.ToSource(sb); sb.append("("); if (Params != null) { String comma = ""; for(ParamDeclNode pdn:Params) { sb.append(comma); comma = ", "; pdn.ToSource(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/members/ConstantNode.java File path: /ArgoUML-0.34-src/argouml-csharp/src/org/argouml/language/csharp/importer/csparser/types/DelegateNode.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
		{
2
		{
3
			if (attributes != null)
3
			if (attributes != null)
4
			{
4
			{
5
				attributes.ToSource(sb);
5
				attributes.ToSource(sb);
6
				this.NewLine(sb);
6
				this.NewLine(sb);
7
			}
7
			}
8
			this.TraceModifiers(this.modifiers, sb);
8
			TraceModifiers(Modifiers, sb);
9
			sb.append("const ");
9
10
10
			sb.append("delegate ");
11
			this.type.ToSource(sb);
11
			Type.ToSource(sb);
12
			sb.append(" ");
12
			sb.append(" ");
13
13
			Name.ToSource(sb);
14
			String comma = "";
14
15
			for (int i = 0; i < this.names.size(); i++)
15
			sb.append("(");
16
			{
16
			if (Params != null)
17
				sb.append(comma);
17
			{
18
				comma = ", ";
18
				String comma = "";
19
				this.names.get(i).ToSource(sb);
19
				for(ParamDeclNode pdn:Params)
20
			}
20
				{
21
21
					sb.append(comma);
22
			if (this.Value != null)
22
					comma = ", ";
23
			{
23
					pdn.ToSource(sb);
24
				sb.append(" = ");
24
				}
25
				this.Value.ToSource(sb);
25
			}
26
			}
26
			sb.append(");");
27
27
			this.NewLine(sb);
28
			sb.append(";");
28
29
			this.NewLine(sb);
29
		}
30
31
        }
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.0
    Similarity Score0.500
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    9
    for (int i = 0; i < this.names.size(); i++)
    9
    for (int i = 0; i < this.names.size(); i++)
    12
    for (ParamDeclNode pdn : Params)
    Differences
    Expression1Expression2Difference
    java.util.Listorg.argouml.language.csharp.importer.csparser.collections.NodeCollectionVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.util.List<org.argouml.language.csharp.importer.csparser.nodes.expressions.IdentifierExpression> of variable this.names does not match with type org.argouml.language.csharp.importer.csparser.collections.NodeCollection<org.argouml.language.csharp.importer.csparser.members.ParamDeclNode> of variable Params
    • Make classes java.util.List and org.argouml.language.csharp.importer.csparser.collections.NodeCollection extend a common superclass
    12
    for (ParamDeclNode pdn : Params)
    10
    sb.append(comma);
    13
    sb.append(comma);
    11
    comma = ", ";
    14
    comma = ", ";
    12
    this.names.get(i).ToSource(sb);
    12
    this.names.get(i).ToSource(sb);
    15
    pdn.ToSource(sb);
    Differences
    Expression1Expression2Difference
    this.names.get(i)pdnTYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression this.names.get(i) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression pdn cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15
    pdn.ToSource(sb);
    Precondition Violations (3)
    Row Violation
    1Type java.util.List<org.argouml.language.csharp.importer.csparser.nodes.expressions.IdentifierExpression> of variable this.names does not match with type org.argouml.language.csharp.importer.csparser.collections.NodeCollection<org.argouml.language.csharp.importer.csparser.members.ParamDeclNode> of variable Params
    2Expression this.names.get(i) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression pdn cannot be parameterized, because it has dependencies to/from statements that will be extracted