IDatabaseObjectInfo[] infos = _tree.getSelectedDatabaseObjects(); if (infos.length > 1 && !isMultipleObjectAction()) { _session.showErrorMessage(getErrorMessage()); } else { try { getCommand(infos).execute(); } catch (Exception e) { _session.showErrorMessage(e); } }
if (_tree != null) { IDatabaseObjectInfo[] infos = _tree.getSelectedDatabaseObjects(); if (infos.length > 1 && !isMultipleObjectAction()) { _tree.getSession().showMessage(getErrorMessage()); } else { try { getCommand(infos).execute(); } catch (Exception e) { _tree.getSession().showMessage(e); } } }
Clone fragments detected by clone detection tool
File path: /sql12/plugins/refactoring/src/net/sourceforge/squirrel_sql/plugins/refactoring/actions/AbstractRefactoringAction.java File path: /sql12/plugins/postgres/src/net/sourceforge/squirrel_sql/plugins/postgres/actions/AbstractObjectTreeAction.java
Method name: void actionPerformed(ActionEvent) Method name: void actionPerformed(ActionEvent)
Number of AST nodes: 5 Number of AST nodes: 6
1
if (_tree != null) {
1
IDatabaseObjectInfo[] infos = _tree.getSelectedDatabaseObjects();
2
            IDatabaseObjectInfo[] infos = _tree.getSelectedDatabaseObjects();
2
			
3
if (infos.length > 1 && !isMultipleObjectAction())
3
            if (infos.length > 1 && !isMultipleObjectAction())
4
			{
5
				_s
4
 {
6
ession.showErrorMessage(getErrorMessage());
5
                _tree.getSession().showMessage(getErrorMessage());
7
			} else
8
			{
9
				try
10
				{
11
					
6
            } else {
7
                try {
12
getCommand(infos).execute();
8
                    getCommand(infos).execute();
13
				
14
} catch (Exception e)
9
                } catch (Exception e)
15
				{
16
					_s
10
 {
17
ession.showErrorMessage(e);
11
                    _tree.getSession().showMessage(e);
18
				}
19
			
12
                }
13
            }
20
}
14
        }
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)6.8
Clones locationClones are in different classes having the same super class
Number of node comparisons10
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)302.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    IDatabaseObjectInfo[] infos = _tree.getSelectedDatabaseObjects();
    2
    IDatabaseObjectInfo[] infos = _tree.getSelectedDatabaseObjects();
    3
    if (infos.length > 1 && !isMultipleObjectAction())
    3
    if (infos.length > 1 && !isMultipleObjectAction())
    4
    _session.showErrorMessage(getErrorMessage());
    4
    _session.showErrorMessage(getErrorMessage());
    4
    _tree.getSession().showMessage(getErrorMessage());
    Differences
    Expression1Expression2Difference
    showErrorMessageshowMessageMETHOD_INVOCATION_NAME_MISMATCH
    _session_tree.getSession()TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression _session.showErrorMessage(getErrorMessage()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression _session.showErrorMessage(getErrorMessage()) is a void method call, and thus it cannot be parameterized
    Expression _tree.getSession().showMessage(getErrorMessage()) is a void method call, and thus it cannot be parameterized
    4
    _tree.getSession().showMessage(getErrorMessage());
    5
    try
    5
    try
    5
    try
    Differences
    Expression1Expression2Difference
    showErrorMessageshowMessageMETHOD_INVOCATION_NAME_MISMATCH
    _session_tree.getSession()TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression _session.showErrorMessage(e) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression _tree.getSession().showMessage(e) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression _session.showErrorMessage(e) is a void method call, and thus it cannot be parameterized
    Expression _tree.getSession().showMessage(e) is a void method call, and thus it cannot be parameterized
    5
    try
    6
    getCommand(infos).execute();
    6
    getCommand(infos).execute();
    Precondition Violations (7)
    Row Violation
    1Expression _session.showErrorMessage(getErrorMessage()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression _session.showErrorMessage(getErrorMessage()) is a void method call, and thus it cannot be parameterized
    3Expression _tree.getSession().showMessage(getErrorMessage()) is a void method call, and thus it cannot be parameterized
    4Expression _session.showErrorMessage(e) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression _tree.getSession().showMessage(e) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression _session.showErrorMessage(e) is a void method call, and thus it cannot be parameterized
    7Expression _tree.getSession().showMessage(e) is a void method call, and thus it cannot be parameterized