Buffer buffer = jEdit.openTemporary( view,null,path,false); /* this is stupid and misleading. * but 'path' is not used anywhere except * the above line, and if this is done * after the 'continue', then we will * either hang, or be forced to duplicate * it inside the buffer == null, or add * a 'finally' clause. you decide which one's * worse. */ path = fileset.getNextFile(view,path); if(buffer == null) continue loop;
Buffer buffer = jEdit.openTemporary( view,null,path,false); /* this is stupid and misleading. * but 'path' is not used anywhere except * the above line, and if this is done * after the 'continue', then we will * either hang, or be forced to duplicate * it inside the buffer == null, or add * a 'finally' clause. you decide which one's * worse. */ path = fileset.getNextFile(view,path); if(buffer == null) continue loop;
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/search/SearchAndReplace.java File path: /jEdit-4.2/src/org/gjt/sp/jedit/search/SearchAndReplace.java
Method name: boolean find(View) Method name: boolean replaceAll(View)
Number of AST nodes: 4 Number of AST nodes: 4
1
Buffer buffer = jEdit.openTemporary(
1
Buffer buffer = jEdit.openTemporary(
2
						view,null,path,false);
2
					view,null,path,false);
3
					/* this is stupid and misleading.
3
				/* this is stupid and misleading.
4
					 * but 'path' is not used anywhere except
4
				 * but 'path' is not used anywhere except
5
					 * the above line, and if this is done
5
				 * the above line, and if this is done
6
					 * after the 'continue', then we will
6
				 * after the 'continue', then we will
7
					 * either hang, or be forced to duplicate
7
				 * either hang, or be forced to duplicate
8
					 * it inside the buffer == null, or add
8
				 * it inside the buffer == null, or add
9
					 * a 'finally' clause. you decide which one's
9
				 * a 'finally' clause. you decide which one's
10
					 * worse. */
10
				 * worse. */
11
					path = fileset.getNextFile(view,path);
11
				path = fileset.getNextFile(view,path);
12
					if(buffer == null)
12
				if(buffer == null)
13
						continue loop;
13
					continue loop;
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.2
Clones locationClones are declared in the same class
Number of node comparisons10
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    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.0
    Clone typeType 1
    Mapped Statements
    ID Statement ID Statement
    22
    Buffer buffer = jEdit.openTemporary(view, null, path, false);
    19
    Buffer buffer = jEdit.openTemporary(view, null, path, false);
    23
    path = fileset.getNextFile(view, path);
    20
    path = fileset.getNextFile(view, path);
    24
    if (buffer == null)
    21
    if (buffer == null)
    25
    continue loop;
    25
    continue loop;
    22
    continue loop;
    Preondition Violations
    Statement continue loop; without innermost loop
    Statement continue loop; without innermost loop
    22
    continue loop;
    Precondition Violations (3)
    Row Violation
    1Statement continue loop; without innermost loop
    2Statement continue loop; without innermost loop
    3Clone fragment #1 returns variables path, buffer , while Clone fragment #2 returns variables path, buffer