try { persistence.save(); } catch (Exception e) { e.printStackTrace(); }
try { mboxFile.createNewFile(); } catch (IOException e) { LOG.severe(e.getLocalizedMessage()); }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/calendar/src/main/java/org/columba/calendar/config/Config.java File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/folder/mbox/MboxDataStorage.java
Method name: void run() Method name: void MboxDataStorage(AbstractMessageFolder)
Number of AST nodes: 2 Number of AST nodes: 2
1
try {
1
try {
2
					persistence.save();
2
				mboxFile.createNewFile();
3
				} catch (Exception e) {
3
			} catch (IOException e) {
4
					e.printStackTrace();
4
				LOG.severe(e.getLocalizedMessage());
5
				}
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.3
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)2.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    try
    1
    try
    6
    try
    Differences
    Expression1Expression2Difference
    java.lang.Exceptionjava.io.IOExceptionSUBCLASS_TYPE_MISMATCH
    java.lang.Exceptionjava.io.IOExceptionSUBCLASS_TYPE_MISMATCH
    printStackTracesevereMETHOD_INVOCATION_NAME_MISMATCH
    eLOGVARIABLE_NAME_MISMATCH
    java.lang.Exceptionjava.util.logging.LoggerVARIABLE_TYPE_MISMATCH
    e.printStackTrace()LOG.severe(e.getLocalizedMessage())ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression e.printStackTrace() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression LOG.severe(e.getLocalizedMessage()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression e.printStackTrace() is a void method call, and thus it cannot be parameterized
    Expression LOG.severe(e.getLocalizedMessage()) is a void method call, and thus it cannot be parameterized
    Expression e cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.lang.Exception of variable e does not match with type java.util.logging.Logger of variable LOG
    • Make classes java.lang.Exception and java.util.logging.Logger extend a common superclass
    Expression e.printStackTrace() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression LOG.severe(e.getLocalizedMessage()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression e.printStackTrace() is a void method call, and thus it cannot be parameterized
    Expression LOG.severe(e.getLocalizedMessage()) is a void method call, and thus it cannot be parameterized
    6
    try
    2
    persistence.save();
    2
    persistence.save();
    7
    mboxFile.createNewFile();
    Differences
    Expression1Expression2Difference
    savecreateNewFileMETHOD_INVOCATION_NAME_MISMATCH
    persistencemboxFileVARIABLE_NAME_MISMATCH
    org.columba.calendar.config.XMLPersistencejava.io.FileVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression mboxFile.createNewFile() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression persistence.save() is a void method call, and thus it cannot be parameterized
    Expression mboxFile.createNewFile() is a void method call, and thus it cannot be parameterized
    Type org.columba.calendar.config.XMLPersistence of variable persistence does not match with type java.io.File of variable mboxFile
    • Make classes org.columba.calendar.config.XMLPersistence and java.io.File extend a common superclass
    7
    mboxFile.createNewFile();
    Precondition Violations (15)
    Row Violation
    1Expression e.printStackTrace() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression LOG.severe(e.getLocalizedMessage()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression e.printStackTrace() is a void method call, and thus it cannot be parameterized
    4Expression LOG.severe(e.getLocalizedMessage()) is a void method call, and thus it cannot be parameterized
    5Expression e cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Type java.lang.Exception of variable e does not match with type java.util.logging.Logger of variable LOG
    7Expression e.printStackTrace() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression LOG.severe(e.getLocalizedMessage()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression e.printStackTrace() is a void method call, and thus it cannot be parameterized
    10Expression LOG.severe(e.getLocalizedMessage()) is a void method call, and thus it cannot be parameterized
    11Expression mboxFile.createNewFile() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Expression persistence.save() is a void method call, and thus it cannot be parameterized
    13Expression mboxFile.createNewFile() is a void method call, and thus it cannot be parameterized
    14Type org.columba.calendar.config.XMLPersistence of variable persistence does not match with type java.io.File of variable mboxFile
    15The refactoring of the clones is infeasible, because classes and org.columba.mail.folder.mbox.MboxDataStorage do not have a common superclass