if (mode != FIXED_NUM_ROWS && mode != FIXED_NUM_COLUMNS) { throw new IllegalArgumentException("illegal mode; value is " + mode); } if (size <= 0) { throw new IllegalArgumentException("size cannot be zero or less; value is " + size); } if (hgap < 0) { throw new IllegalArgumentException("hgap cannot be negative; value is " + hgap); } if (vgap < 0) { throw new IllegalArgumentException("vgap cannot be negative; value is " + vgap); } this.mode = mode; this.size = size; this.hgap = hgap; this.vgap = vgap;
if (mode != FIXED_NUM_ROWS && mode != FIXED_NUM_COLUMNS) { throw new IllegalArgumentException("illegal mode; value is " + mode); } if (size <= 0) { throw new IllegalArgumentException("size cannot be zero or less; value is " + size); } if (hgap < 0) { throw new IllegalArgumentException("hgap cannot be negative; value is " + hgap); } if (vgap < 0) { throw new IllegalArgumentException("vgap cannot be negative; value is " + vgap); } this.mode = mode; this.size = size; this.hgap = hgap; this.vgap = vgap;
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/gui/VariableGridLayout.java File path: /jEdit-4.2/src/installer/VariableGridLayout.java
Method name: void VariableGridLayout(int, int, int, int) Method name: void VariableGridLayout(int, int, int, int)
Number of AST nodes: 12 Number of AST nodes: 12
1
if (mode != FIXED_NUM_ROWS && mode != FIXED_NUM_COLUMNS) {
1
if (mode != FIXED_NUM_ROWS && mode != FIXED_NUM_COLUMNS) {
2
			throw new IllegalArgumentException("illegal mode; value is " + mode);
2
			throw new IllegalArgumentException("illegal mode; value is " + mode);
3
		}
3
		}
4
		if (size <= 0) {
4
		if (size <= 0) {
5
			throw new IllegalArgumentException("size cannot be zero or less; value is " + size);
5
			throw new IllegalArgumentException("size cannot be zero or less; value is " + size);
6
		}
6
		}
7
		if (hgap < 0) {
7
		if (hgap < 0) {
8
			throw new IllegalArgumentException("hgap cannot be negative; value is " + hgap);
8
			throw new IllegalArgumentException("hgap cannot be negative; value is " + hgap);
9
		}
9
		}
10
		if (vgap < 0) {
10
		if (vgap < 0) {
11
			throw new IllegalArgumentException("vgap cannot be negative; value is " + vgap);
11
			throw new IllegalArgumentException("vgap cannot be negative; value is " + vgap);
12
		}
12
		}
13
		this.mode = mode;
13
		this.mode = mode;
14
		this.size = size;
14
		this.size = size;
15
		this.hgap = hgap;
15
		this.hgap = hgap;
16
		this.vgap = vgap;
16
		this.vgap = vgap;
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)1.1
Clones locationClones are in different classes
Number of node comparisons41
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements12
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)4.7
    Clone typeType 1
    Mapped Statements
    ID Statement ID Statement
    1
    if (mode != FIXED_NUM_ROWS && mode != FIXED_NUM_COLUMNS)
    1
    if (mode != FIXED_NUM_ROWS && mode != FIXED_NUM_COLUMNS)
    2
    throw new IllegalArgumentException("illegal mode; value is " + mode);
    2
    throw new IllegalArgumentException("illegal mode; value is " + mode);
    3
    if (size <= 0)
    3
    if (size <= 0)
    4
    throw new IllegalArgumentException("size cannot be zero or less; value is " + size);
    4
    throw new IllegalArgumentException("size cannot be zero or less; value is " + size);
    5
    if (hgap < 0)
    5
    if (hgap < 0)
    6
    throw new IllegalArgumentException("hgap cannot be negative; value is " + hgap);
    6
    throw new IllegalArgumentException("hgap cannot be negative; value is " + hgap);
    7
    if (vgap < 0)
    7
    if (vgap < 0)
    8
    throw new IllegalArgumentException("vgap cannot be negative; value is " + vgap);
    8
    throw new IllegalArgumentException("vgap cannot be negative; value is " + vgap);
    9
    this.mode = mode;
    9
    this.mode = mode;
    10
    this.size = size;
    10
    this.size = size;
    11
    this.hgap = hgap;
    11
    this.hgap = hgap;
    12
    this.vgap = vgap;
    12
    this.vgap = vgap;
    Precondition Violations (0)
    Row Violation