if( j2 < z )
{
m_currentChar = ch2;
m_crc.updateCRC( ch2 );
j2++;
}
else
{
m_currentState = RAND_PART_A_STATE;
i2++;
count = 0;
setupRandPartA();
}
if( j2 < z )
{
m_currentChar = ch2;
m_crc.updateCRC( ch2 );
j2++;
}
else
{
m_currentState = NO_RAND_PART_A_STATE;
i2++;
count = 0;
setupNoRandPartA();
}
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/installer/CBZip2InputStream.java
|
|
File path: /jEdit-4.2/src/installer/CBZip2InputStream.java
|
Method name: void setupRandPartC()
|
|
Method name: void setupNoRandPartC()
|
Number of AST nodes: 8
|
|
Number of AST nodes: 8
|
|
1 | if( j2 < z )↵ | | 1 | if( j2 < z )↵
|
2 | {↵ | | 2 | {↵
|
3 | m_currentChar = ch2;↵ | | 3 | m_currentChar = ch2;↵
|
4 | m_crc.updateCRC( ch2 );↵ | | 4 | m_crc.updateCRC( ch2 );↵
|
5 | j2++;↵ | | 5 | j2++;↵
|
6 | }↵ | | 6 | }↵
|
7 | else↵ | | 7 | else↵
|
8 | {↵ | | 8 | {↵
|
9 | m_currentState = RAND_PART_A_STATE;↵ | | 9 | m_currentState = NO_RAND_PART_A_STATE;↵
|
10 | i2++;↵ | | 10 | i2++;↵
|
11 | count = 0;↵ | | 11 | count = 0;↵
|
12 | setupRandPartA();↵ | | 12 | setupNoRandPartA();↵
|
13 | } | | 13 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.2 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 64 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 8 |
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) | 5.6 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | if (j2 < z) | | 1 | if (j2 < z) |
2 | | | 2 | |
3 | | | 3 | |
4 | | | 4 | |
| | | | |
5 | m_currentState = RAND_PART_A_STATE; | | 5 | m_currentState = NO_RAND_PART_A_STATE; |
6 | | | 6 | |
7 | | | 7 | |
8 | | | 8 | |
Precondition Violations (4)
Row |
Violation |
1 | Expression setupRandPartA() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression setupNoRandPartA() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression setupRandPartA() is a void method call, and thus it cannot be parameterized |
4 | Expression setupNoRandPartA() is a void method call, and thus it cannot be parameterized |