goToSelectedNode(); // fuck me dead SwingUtilities.invokeLater(new Runnable() { public void run() { resultTree.requestFocus(); } }); evt.consume();
SwingUtilities.invokeAndWait(new Runnable() { public void run() { progress.setValue(progress .getValue() + value); } }); Thread.yield();
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/search/HyperSearchResults.java File path: /jEdit-4.2/src/installer/SwingInstall.java
Method name: void keyPressed(KeyEvent) Method name: void advance(int)
Number of AST nodes: 3 Number of AST nodes: 2
1
goToSelectedNode();
2
				// fuck me dead
3
				SwingUtilities.invokeLater(new Runnable()
1
SwingUtilities.invokeAndWait(new Runnable()
4
				{
2
				{
5
					public void run()
3
					public void run()
6
					{
4
					{
7
						resultTree.requestFocus(
5
						progress.setValue(progress
8
);
6
							.getValue() + value);
9
					}
7
					}
10
				});
8
				});
11
				evt.consume();
9
				Thread.yield();
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.0
Clones locationClones are in different classes
Number of node comparisons6
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    2
    goToSelectedNode();
    2
    goToSelectedNode();
    2
    SwingUtilities.invokeAndWait(new Runnable() {...});
    Differences
    Expression1Expression2Difference
    goToSelectedNodeinvokeAndWaitMETHOD_INVOCATION_NAME_MISMATCH
    goToSelectedNode()SwingUtilities.invokeAndWait(new Runnable(){ public void run(){ progress.setValue(progress.getValue() + value); } } )ARGUMENT_NUMBER_MISMATCH
    SwingUtilitiesMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression goToSelectedNode() is a void method call, and thus it cannot be parameterized
    Expression SwingUtilities.invokeAndWait(new Runnable(){ public void run(){ progress.setValue(progress.getValue() + value); } } ) is a void method call, and thus it cannot be parameterized
    Expression goToSelectedNode() is a void method call, and thus it cannot be parameterized
    Expression SwingUtilities.invokeAndWait(new Runnable(){ public void run(){ progress.setValue(progress.getValue() + value); } } ) is a void method call, and thus it cannot be parameterized
    2
    SwingUtilities.invokeAndWait(new Runnable() {...});
    3
    SwingUtilities.invokeLater(new Runnable() {...});
                                                                                                                                                                                                                        
    4
    evt.consume();
    4
    evt.consume();
    3
    Thread.yield();
    Differences
    Expression1Expression2Difference
    consumeyieldMETHOD_INVOCATION_NAME_MISMATCH
    java.awt.event.KeyEventjava.lang.ThreadVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression evt.consume() is a void method call, and thus it cannot be parameterized
    Expression Thread.yield() is a void method call, and thus it cannot be parameterized
    Type java.awt.event.KeyEvent of variable evt does not match with type java.lang.Thread of variable Thread
    • Make classes java.awt.event.KeyEvent and java.lang.Thread extend a common superclass
    3
    Thread.yield();
    Precondition Violations (7)
    Row Violation
    1Expression goToSelectedNode() is a void method call, and thus it cannot be parameterized
    2Expression SwingUtilities.invokeAndWait(new Runnable(){ public void run(){ progress.setValue(progress.getValue() + value); } } ) is a void method call, and thus it cannot be parameterized
    3Expression goToSelectedNode() is a void method call, and thus it cannot be parameterized
    4Expression SwingUtilities.invokeAndWait(new Runnable(){ public void run(){ progress.setValue(progress.getValue() + value); } } ) is a void method call, and thus it cannot be parameterized
    5Expression evt.consume() is a void method call, and thus it cannot be parameterized
    6Expression Thread.yield() is a void method call, and thus it cannot be parameterized
    7Type java.awt.event.KeyEvent of variable evt does not match with type java.lang.Thread of variable Thread