if (evt.isPopupTrigger()) { displayPopupMenu(evt); }
if (_undo.canUndo()) { _undo.undo(); }
Clone fragments detected by clone detection tool
File path: /sql12/plugins/favs/src/net/sourceforge/squirrel_sql/plugins/favs/QueryTree.java File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/action/UndoAction.java
Method name: void mouseReleased(MouseEvent) Method name: void actionPerformed(ActionEvent)
Number of AST nodes: 2 Number of AST nodes: 2
1
if (evt.isPopupTrigger()) {
1
if (_undo.canUndo())
2
					displayPopupMenu(evt);
2
		
3
		
3
{
4
			_undo.undo();
4
		}
5
		}
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 in different classes
Number of node comparisons4
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)59.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (evt.isPopupTrigger())
    1
    if (evt.isPopupTrigger())
    1
    if (_undo.canUndo())
    Differences
    Expression1Expression2Difference
    isPopupTriggercanUndoMETHOD_INVOCATION_NAME_MISMATCH
    evt_undoVARIABLE_NAME_MISMATCH
    java.awt.event.MouseEventjavax.swing.undo.UndoManagerVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.awt.event.MouseEvent of variable evt does not match with type javax.swing.undo.UndoManager of variable _undo
    • Make classes java.awt.event.MouseEvent and javax.swing.undo.UndoManager extend a common superclass
    1
    if (_undo.canUndo())
    2
    displayPopupMenu(evt);
    2
    displayPopupMenu(evt);
    2
    _undo.undo();
    Differences
    Expression1Expression2Difference
    displayPopupMenuundoMETHOD_INVOCATION_NAME_MISMATCH
    displayPopupMenu(evt)_undo.undo()ARGUMENT_NUMBER_MISMATCH
    _undoMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression displayPopupMenu(evt) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method displayPopupMenu
    Expression _undo.undo() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression displayPopupMenu(evt) is a void method call, and thus it cannot be parameterized
    Expression _undo.undo() is a void method call, and thus it cannot be parameterized
    Expression displayPopupMenu(evt) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method displayPopupMenu
    Expression _undo.undo() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression displayPopupMenu(evt) is a void method call, and thus it cannot be parameterized
    Expression _undo.undo() is a void method call, and thus it cannot be parameterized
    2
    _undo.undo();
    Precondition Violations (10)
    Row Violation
    1Type java.awt.event.MouseEvent of variable evt does not match with type javax.swing.undo.UndoManager of variable _undo
    2Expression displayPopupMenu(evt) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression _undo.undo() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression displayPopupMenu(evt) is a void method call, and thus it cannot be parameterized
    5Expression _undo.undo() is a void method call, and thus it cannot be parameterized
    6Expression displayPopupMenu(evt) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression _undo.undo() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression displayPopupMenu(evt) is a void method call, and thus it cannot be parameterized
    9Expression _undo.undo() is a void method call, and thus it cannot be parameterized
    10The refactoring of the clones is infeasible, because classes and net.sourceforge.squirrel_sql.client.session.action.UndoAction do not have a common superclass