addToken(currentToken);
currentToken = new RETokenPOSIX(subIndex,RETokenPOSIX.DIGIT,insens,false);
}
// NON-DIGIT OPERATOR
// \D
else if (unit.bk && (unit.ch == 'D') && syntax.get(RESyntax.RE_CHAR_CLASS_ESCAPES)) {
addToken(currentToken);
currentToken = new RETokenPOSIX(subIndex,RETokenPOSIX.DIGIT,insens,true);
}
// NEWLINE ESCAPE
// \n
else if (unit.bk && (unit.ch == 'n')) {
addToken(currentToken);
currentToken = new RETokenChar(subIndex,'\n',false);
addToken(currentToken);
currentToken = new RETokenPOSIX(subIndex,RETokenPOSIX.SPACE,insens,false);
}
// NON-WHITESPACE OPERATOR
// \S
else if (unit.bk && (unit.ch == 'S') && syntax.get(RESyntax.RE_CHAR_CLASS_ESCAPES)) {
addToken(currentToken);
currentToken = new RETokenPOSIX(subIndex,RETokenPOSIX.SPACE,insens,true);
}
// TAB ESCAPE
// \t
else if (unit.bk && (unit.ch == 't')) {
addToken(currentToken);
currentToken = new RETokenChar(subIndex,'\t',false);
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/gnu/regexp/RE.java
|
|
File path: /jEdit-4.2/src/gnu/regexp/RE.java
|
Method name: void initialize(Object, int, RESyntax, int, int)
|
|
Method name: void initialize(Object, int, RESyntax, int, int)
|
Number of AST nodes: 6
|
|
Number of AST nodes: 6
|
|
1 | addToken(currentToken);↵ | | 1 | addToken(currentToken);↵
|
2 | currentToken = new RETokenPOSIX(subIndex,RETokenPOSIX.DIGIT,insens,false);↵ | | 2 | currentToken = new RETokenPOSIX(subIndex,RETokenPOSIX.SPACE,insens,false);↵
|
3 | }↵ | | |
|
|
4 | // NON-DIGIT↵ | | 3 | }↵
|
|
5 | OPERATOR↵ | | 4 | // NON-WHITESPACE OPERATOR↵
|
6 | // \D↵ | | 5 | // \S↵
|
|
7 | else if (unit.bk && (unit.ch == 'D') && syntax.get(RESyntax.RE_CHAR_CLASS_ESCAPES)) {↵ | | 6 | else if (unit.bk && (unit.ch == 'S') && syntax.get(RESyntax.RE_CHAR_CLASS_ESCAPES)) {↵
|
8 | addToken(currentToken);↵ | | 7 | addToken(currentToken);↵
|
9 | currentToken = new RETokenPOSIX(subIndex,RETokenPOSIX.DIGIT,insens,true);↵ | | 8 | currentToken = new RETokenPOSIX(subIndex,RETokenPOSIX.SPACE,insens,true);↵
|
10 | }↵ | | 9 | }↵
|
|
11 | // NEWLINE ESCAPE↵ | | 10 | // TAB ESCAPE↵
|
12 | // \n↵ | | 11 | // \t↵
|
|
13 | else if (unit.bk && (unit.ch == 'n')) {↵ | | 12 | else if (unit.bk && (unit.ch == 't')) {↵
|
14 | addToken(currentToken);↵ | | 13 | addToken(currentToken);↵
|
15 | currentToken = new RETokenChar(subIndex,'\n',false); | | 14 | currentToken = new RETokenChar(subIndex,'\t',false);
|
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.0 |
Clones location | Clones are in the same method |
Number of node comparisons | 3 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 2 |
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 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
246 | addToken(currentToken); | | 258 | addToken(currentToken); |
247 | currentToken = new RETokenPOSIX(subIndex, RETokenPOSIX.DIGIT, insens, false); | | 259 | currentToken = new RETokenPOSIX(subIndex, RETokenPOSIX.SPACE, insens, false); |
Precondition Violations (0)
Row |
Violation |