if (child instanceof AbstractMessageFolder) { try { ((AbstractMessageFolder) child).save(); } catch (Exception ex) { ex.printStackTrace(); } }
if (cursor_pos != -1) { try { _editor.moveCaretPosition(pos2); } catch (IllegalArgumentException ex) { ex.printStackTrace(); } }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/tree/FolderTreeModel.java File path: /columba-1.4-src/contact/src/main/java/org/columba/addressbook/gui/autocomplete/AddressAutoCompleter.java
Method name: void saveFolder(IMailFolder) Method name: void itemStateChanged(ItemEvent)
Number of AST nodes: 3 Number of AST nodes: 3
1
if (child instanceof AbstractMessageFolder) {
1
if (c
2
						try {
3
							((AbstractMessageFolder) child).save();
4
						} catch (Exception ex) {
5
							ex.printStackTrace();
6
						}
7
					
2
ursor_pos != -1) {
3
                try {
4
                    _editor.moveCaretPosition(pos2);
5
                } catch (IllegalArgumentException ex) {
6
                    ex.printStackTrace();
7
                }
8
}
8
            }
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 comparisons5
  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)1.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    5
    try
    5
    try
    9
    try
    Differences
    Expression1Expression2Difference
    java.lang.Exceptionjava.lang.IllegalArgumentExceptionSUBCLASS_TYPE_MISMATCH
    java.lang.Exceptionjava.lang.IllegalArgumentExceptionSUBCLASS_TYPE_MISMATCH
    java.lang.Exceptionjava.lang.IllegalArgumentExceptionSUBCLASS_TYPE_MISMATCH
    9
    try
    6
    ((AbstractMessageFolder)child).save();
    6
    ((AbstractMessageFolder)child).save();
    10
    _editor.moveCaretPosition(pos2);
    Differences
    Expression1Expression2Difference
    savemoveCaretPositionMETHOD_INVOCATION_NAME_MISMATCH
    ((AbstractMessageFolder)child)_editorAST_TYPE_MISMATCH
    ((AbstractMessageFolder)child).save()_editor.moveCaretPosition(pos2)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression ((AbstractMessageFolder)child).save() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    Expression ((AbstractMessageFolder)child).save() is a void method call, and thus it cannot be parameterized
    Expression _editor.moveCaretPosition(pos2) is a void method call, and thus it cannot be parameterized
    Expression ((AbstractMessageFolder)child).save() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    Expression ((AbstractMessageFolder)child).save() is a void method call, and thus it cannot be parameterized
    Expression _editor.moveCaretPosition(pos2) is a void method call, and thus it cannot be parameterized
    10
    _editor.moveCaretPosition(pos2);
    Precondition Violations (7)
    Row Violation
    1Expression ((AbstractMessageFolder)child).save() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    2Expression ((AbstractMessageFolder)child).save() is a void method call, and thus it cannot be parameterized
    3Expression _editor.moveCaretPosition(pos2) is a void method call, and thus it cannot be parameterized
    4Expression ((AbstractMessageFolder)child).save() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    5Expression ((AbstractMessageFolder)child).save() is a void method call, and thus it cannot be parameterized
    6Expression _editor.moveCaretPosition(pos2) is a void method call, and thus it cannot be parameterized
    7The refactoring of the clones is infeasible, because classes and org.columba.addressbook.gui.autocomplete.AddressAutoCompleter do not have a common superclass