g.setColor(color3); g.fillRect(x,y,width,SPLITTER_WIDTH); for(int i = 0; i < width / 4 - 1; i++) { g.setColor(color1); g.drawLine(x + i * 4 + 2,y + 3, x + i * 4 + 2,y + 3); g.setColor(color2); g.drawLine(x + i * 4 + 3,y + 4, x + i * 4 + 3,y + 4); g.setColor(color1); g.drawLine(x + i * 4 + 4,y + 5, x + i * 4 + 4,y + 5); g.setColor(color2); g.drawLine(x + i * 4 + 5,y + 6, x + i * 4 + 5,y + 6); }
g.setColor(color3); g.fillRect(x,y,SPLITTER_WIDTH,height); for(int i = 0; i < height / 4 - 1; i++) { g.setColor(color1); g.drawLine(x + 3,y + i * 4 + 2, x + 3,y + i * 4 + 2); g.setColor(color2); g.drawLine(x + 4,y + i * 4 + 3, x + 4,y + i * 4 + 3); g.setColor(color1); g.drawLine(x + 5,y + i * 4 + 4, x + 5,y + i * 4 + 4); g.setColor(color2); g.drawLine(x + 6,y + i * 4 + 5, x + 6,y + i * 4 + 5); }
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/gui/PanelWindowContainer.java File path: /jEdit-4.2/src/org/gjt/sp/jedit/gui/PanelWindowContainer.java
Method name: void paintHorizBorder(Graphics, int, int, int) Method name: void paintVertBorder(Graphics, int, int, int)
Number of AST nodes: 11 Number of AST nodes: 11
1
g.setColor(color3);
1
g.setColor(color3);
2
			g.fillRect(x,y,width,SPLITTER_WIDTH);
2
			g.fillRect(x,y,SPLITTER_WIDTH,height);
3
			for(int i = 0; i < width / 4 - 1; i++)
3
			for(int i = 0; i < height / 4 - 1; i++)
4
			{
4
			{
5
				g.setColor(color1);
5
				g.setColor(color1);
6
				g.drawLine(x + i * 4 + 2,y + 3,
6
				g.drawLine(x + 3,y + i * 4 + 2,
7
					x + i * 4 + 2,y + 3);
7
					x + 3,y + i * 4 + 2);
8
				g.setColor(color2);
8
				g.setColor(color2);
9
				g.drawLine(x + i * 4 + 3,y + 4,
9
				g.drawLine(x + 4,y + i * 4 + 3,
10
					x + i * 4 + 3,y + 4);
10
					x + 4,y + i * 4 + 3);
11
				g.setColor(color1);
11
				g.setColor(color1);
12
				g.drawLine(x + i * 4 + 4,y + 5,
12
				g.drawLine(x + 5,y + i * 4 + 4,
13
					x + i * 4 + 4,y + 5);
13
					x + 5,y + i * 4 + 4);
14
				g.setColor(color2);
14
				g.setColor(color2);
15
				g.drawLine(x + i * 4 + 5,y + 6,
15
				g.drawLine(x + 6,y + i * 4 + 5,
16
					x + i * 4 + 5,y + 6);
16
					x + 6,y + i * 4 + 5);
17
			}
17
			}
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.3
Clones locationClones are declared in the same class
Number of node comparisons85
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements11
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)23.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    g.setColor(color3);
    1
    g.setColor(color3);
    2
    g.fillRect(x, y, width, SPLITTER_WIDTH);
    2
    g.fillRect(x, y, width, SPLITTER_WIDTH);
    2
    g.fillRect(x, y, SPLITTER_WIDTH, height);
    Differences
    Expression1Expression2Difference
    widthSPLITTER_WIDTHVARIABLE_NAME_MISMATCH
    SPLITTER_WIDTHheightVARIABLE_NAME_MISMATCH
    2
    g.fillRect(x, y, SPLITTER_WIDTH, height);
    3
    for (int i = 0; i < width / 4 - 1; i++)
    3
    for (int i = 0; i < width / 4 - 1; i++)
    3
    for (int i = 0; i < height / 4 - 1; i++)
    Differences
    Expression1Expression2Difference
    widthheightVARIABLE_NAME_MISMATCH
    3
    for (int i = 0; i < height / 4 - 1; i++)
    4
    g.setColor(color1);
    4
    g.setColor(color1);
    5
    g.drawLine(x + i * 4 + 2, y + 3, x + i * 4 + 2, y + 3);
    5
    g.drawLine(x + i * 4 + 2, y + 3, x + i * 4 + 2, y + 3);
    8
    g.setColor(color1);
    Differences
    Expression1Expression2Difference
    drawLinesetColorMETHOD_INVOCATION_NAME_MISMATCH
    g.drawLine(x + i * 4 + 2,y + 3,x + i * 4 + 2,y + 3)g.setColor(color1)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression g.drawLine(x + i * 4 + 2,y + 3,x + i * 4 + 2,y + 3) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression g.drawLine(x + i * 4 + 2,y + 3,x + i * 4 + 2,y + 3) is a void method call, and thus it cannot be parameterized
    Expression g.setColor(color1) is a void method call, and thus it cannot be parameterized
    Expression g.drawLine(x + i * 4 + 2,y + 3,x + i * 4 + 2,y + 3) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression g.drawLine(x + i * 4 + 2,y + 3,x + i * 4 + 2,y + 3) is a void method call, and thus it cannot be parameterized
    Expression g.setColor(color1) is a void method call, and thus it cannot be parameterized
    8
    g.setColor(color1);
    6
    g.setColor(color2);
    6
    g.setColor(color2);
    7
    g.drawLine(x + i * 4 + 3, y + 4, x + i * 4 + 3, y + 4);
    7
    g.drawLine(x + i * 4 + 3, y + 4, x + i * 4 + 3, y + 4);
    5
    g.drawLine(x + 3, y + i * 4 + 2, x + 3, y + i * 4 + 2);
    Differences
    Expression1Expression2Difference
    x + i * 4xINFIX_LEFT_OPERAND_MISMATCH
    42LITERAL_VALUE_MISMATCH
    yy + i * 4INFIX_LEFT_OPERAND_MISMATCH
    x + i * 4xINFIX_LEFT_OPERAND_MISMATCH
    42LITERAL_VALUE_MISMATCH
    yy + i * 4INFIX_LEFT_OPERAND_MISMATCH
    Preondition Violations
    Expression x + i * 4 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression y + i * 4 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression x + i * 4 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression y + i * 4 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5
    g.drawLine(x + 3, y + i * 4 + 2, x + 3, y + i * 4 + 2);
    8
    g.setColor(color1);
    8
    g.setColor(color1);
    7
    g.drawLine(x + 4, y + i * 4 + 3, x + 4, y + i * 4 + 3);
    Differences
    Expression1Expression2Difference
    setColordrawLineMETHOD_INVOCATION_NAME_MISMATCH
    g.setColor(color1)g.drawLine(x + 4,y + i * 4 + 3,x + 4,y + i * 4 + 3)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression g.drawLine(x + 4,y + i * 4 + 3,x + 4,y + i * 4 + 3) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression g.setColor(color1) is a void method call, and thus it cannot be parameterized
    Expression g.drawLine(x + 4,y + i * 4 + 3,x + 4,y + i * 4 + 3) is a void method call, and thus it cannot be parameterized
    Expression g.drawLine(x + 4,y + i * 4 + 3,x + 4,y + i * 4 + 3) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression g.setColor(color1) is a void method call, and thus it cannot be parameterized
    Expression g.drawLine(x + 4,y + i * 4 + 3,x + 4,y + i * 4 + 3) is a void method call, and thus it cannot be parameterized
    7
    g.drawLine(x + 4, y + i * 4 + 3, x + 4, y + i * 4 + 3);
    9
    g.drawLine(x + i * 4 + 4, y + 5, x + i * 4 + 4, y + 5);
    9
    g.drawLine(x + i * 4 + 4, y + 5, x + i * 4 + 4, y + 5);
    11
    g.drawLine(x + 6, y + i * 4 + 5, x + 6, y + i * 4 + 5);
    Differences
    Expression1Expression2Difference
    46LITERAL_VALUE_MISMATCH
    x + i * 4xINFIX_LEFT_OPERAND_MISMATCH
    yy + i * 4INFIX_LEFT_OPERAND_MISMATCH
    46LITERAL_VALUE_MISMATCH
    x + i * 4xINFIX_LEFT_OPERAND_MISMATCH
    yy + i * 4INFIX_LEFT_OPERAND_MISMATCH
    Preondition Violations
    Expression x + i * 4 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression y + i * 4 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression x + i * 4 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression y + i * 4 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11
    g.drawLine(x + 6, y + i * 4 + 5, x + 6, y + i * 4 + 5);
    10
    g.setColor(color2);
    10
    g.setColor(color2);
    11
    g.drawLine(x + i * 4 + 5, y + 6, x + i * 4 + 5, y + 6);
    11
    g.drawLine(x + i * 4 + 5, y + 6, x + i * 4 + 5, y + 6);
    9
    g.drawLine(x + 5, y + i * 4 + 4, x + 5, y + i * 4 + 4);
    Differences
    Expression1Expression2Difference
    x + i * 4xINFIX_LEFT_OPERAND_MISMATCH
    64LITERAL_VALUE_MISMATCH
    yy + i * 4INFIX_LEFT_OPERAND_MISMATCH
    x + i * 4xINFIX_LEFT_OPERAND_MISMATCH
    64LITERAL_VALUE_MISMATCH
    yy + i * 4INFIX_LEFT_OPERAND_MISMATCH
    Preondition Violations
    Expression x + i * 4 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression y + i * 4 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression x + i * 4 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression y + i * 4 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9
    g.drawLine(x + 5, y + i * 4 + 4, x + 5, y + i * 4 + 4);
    Precondition Violations (24)
    Row Violation
    1Expression g.drawLine(x + i * 4 + 2,y + 3,x + i * 4 + 2,y + 3) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression g.drawLine(x + i * 4 + 2,y + 3,x + i * 4 + 2,y + 3) is a void method call, and thus it cannot be parameterized
    3Expression g.setColor(color1) is a void method call, and thus it cannot be parameterized
    4Expression g.drawLine(x + i * 4 + 2,y + 3,x + i * 4 + 2,y + 3) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression g.drawLine(x + i * 4 + 2,y + 3,x + i * 4 + 2,y + 3) is a void method call, and thus it cannot be parameterized
    6Expression g.setColor(color1) is a void method call, and thus it cannot be parameterized
    7Expression x + i * 4 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression y + i * 4 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression x + i * 4 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression y + i * 4 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression g.drawLine(x + 4,y + i * 4 + 3,x + 4,y + i * 4 + 3) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Expression g.setColor(color1) is a void method call, and thus it cannot be parameterized
    13Expression g.drawLine(x + 4,y + i * 4 + 3,x + 4,y + i * 4 + 3) is a void method call, and thus it cannot be parameterized
    14Expression g.drawLine(x + 4,y + i * 4 + 3,x + 4,y + i * 4 + 3) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Expression g.setColor(color1) is a void method call, and thus it cannot be parameterized
    16Expression g.drawLine(x + 4,y + i * 4 + 3,x + 4,y + i * 4 + 3) is a void method call, and thus it cannot be parameterized
    17Expression x + i * 4 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    18Expression y + i * 4 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    19Expression x + i * 4 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    20Expression y + i * 4 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    21Expression x + i * 4 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    22Expression y + i * 4 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    23Expression x + i * 4 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    24Expression y + i * 4 cannot be parameterized, because it has dependencies to/from statements that will be extracted