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;
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.7
Clones locationClones are declared in the same class
Number of node comparisons40
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements9
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.6
    Clone typeType 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
    noWordSep = "";
    5
    noWordSep = "";
    4
    int type;
    6
    int type;
    5
    if (Character.isWhitespace(ch))
    7
    if (Character.isWhitespace(ch))
    6
    type = WHITESPACE;
    8
    type = WHITESPACE;
    7
    else if (Character.isLetterOrDigit(ch) || noWordSep.indexOf(ch) != -1)
    9
    else if (Character.isLetterOrDigit(ch) || noWordSep.indexOf(ch) != -1)
    8
    type = WORD_CHAR;
    10
    type = WORD_CHAR;
    else
    else
    9
    type = SYMBOL;
    11
    type = SYMBOL;
    Precondition Violations (1)
    Row Violation
    1Clone fragment #1 returns variables ch, type, noWordSep , while Clone fragment #2 returns variables ch, type, noWordSep