char ch = line.charAt(pos);
if(noWordSep == null)
noWordSep = "";
//{{{ the character under the cursor changes how we behave.
int type;
if(Character.isWhitespace(ch))
type = WHITESPACE;
else if(Character.isLetterOrDigit(ch)
|| noWordSep.indexOf(ch) != -1)
type = WORD_CHAR;
else
type = SYMBOL;
char ch = line.charAt(pos);
if(noWordSep == null)
noWordSep = "";
//{{{ the character under the cursor changes how we behave.
int type;
if(Character.isWhitespace(ch))
type = WHITESPACE;
else if(Character.isLetterOrDigit(ch)
|| noWordSep.indexOf(ch) != -1)
type = WORD_CHAR;
else
type = SYMBOL;
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/TextUtilities.java
|
|
File path: /jEdit-4.2/src/org/gjt/sp/jedit/TextUtilities.java
|
Method name: int findWordStart(String, int, String, boolean, boolean)
|
|
Method name: int findWordEnd(String, int, String, boolean, boolean)
|
Number of AST nodes: 9
|
|
Number of AST nodes: 9
|
|
1 | char ch = line.charAt(pos);↵ | | 1 | char ch = line.charAt(pos);↵
|
|
2 | if(noWordSep == null)↵ | | 2 | if(noWordSep == null)↵
|
3 | noWordSep = "";↵ | | 3 | noWordSep = "";↵
|
|
4 | //{{{ the character under the cursor changes how we behave.↵ | | 4 | //{{{ the character under the cursor changes how we behave.↵
|
5 | int type;↵ | | 5 | int type;↵
|
6 | if(Character.isWhitespace(ch))↵ | | 6 | if(Character.isWhitespace(ch))↵
|
7 | type = WHITESPACE;↵ | | 7 | type = WHITESPACE;↵
|
8 | else if(Character.isLetterOrDigit(ch)↵ | | 8 | else if(Character.isLetterOrDigit(ch)↵
|
9 | || noWordSep.indexOf(ch) != -1)↵ | | 9 | || noWordSep.indexOf(ch) != -1)↵
|
10 | type = WORD_CHAR;↵ | | 10 | type = WORD_CHAR;↵
|
11 | else↵ | | 11 | else↵
|
12 | type = SYMBOL; | | 12 | type = SYMBOL;
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.7 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 40 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 9 |
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) | 1.6 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | char ch = line.charAt(pos); | | 3 | char ch = line.charAt(pos); |
2 | if (noWordSep == null) | | 4 | if (noWordSep == null) |
3 | | | 5 | |
4 | int type; | | 6 | int type; |
5 | if (Character.isWhitespace(ch)) | | 7 | if (Character.isWhitespace(ch)) |
6 | | | 8 | |
7 | else if (Character.isLetterOrDigit(ch) || noWordSep.indexOf(ch) != -1) | | 9 | else if (Character.isLetterOrDigit(ch) || noWordSep.indexOf(ch) != -1) |
8 | | | 10 | |
| | | | |
9 | | | 11 | |
Precondition Violations (1)
Row |
Violation |
1 | Clone fragment #1 returns variables ch, type, noWordSep , while Clone fragment #2 returns variables ch, type, noWordSep |