if (e.getSource().cancelled()) { try { server.dropConnection(); } catch (IOException e1) { } }
for (int i = 0; i < 10; i++) { try { Thread.sleep(1000); } catch (InterruptedException ie) { } }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/smtp/command/SendMessageCommand.java File path: /columba-1.4-src/core/src/main/java/org/columba/core/shutdown/ShutdownManager.java
Method name: void workerStatusChanged(WorkerStatusChangedEvent) Method name: void run()
Number of AST nodes: 3 Number of AST nodes: 3
1
if (e.getSource().cancelled()) {
1
for (int i = 0; i < 10; i++) {
2
						try {
2
							try {
3
							server.dropConnection();
3
								Thread.sleep(1000);
4
						} catch (IOException e1) {
4
							} catch (InterruptedException ie) {
5
						}
5
							}
6
					}
6
						}
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.4
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)15.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    try
    2
    try
    8
    try
    Differences
    Expression1Expression2Difference
    dropConnectionsleepMETHOD_INVOCATION_NAME_MISMATCH
    org.columba.mail.smtp.SMTPServerjava.lang.ThreadVARIABLE_TYPE_MISMATCH
    server.dropConnection()Thread.sleep(1000)TYPE_COMPATIBLE_REPLACEMENT
    server.dropConnection()Thread.sleep(1000)ARGUMENT_NUMBER_MISMATCH
    java.io.IOExceptionjava.lang.InterruptedExceptionSUBCLASS_TYPE_MISMATCH
    e1ieVARIABLE_NAME_MISMATCH
    java.io.IOExceptionjava.lang.InterruptedExceptionSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression server.dropConnection() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    Expression Thread.sleep(1000) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    Expression server.dropConnection() is a void method call, and thus it cannot be parameterized
    Expression Thread.sleep(1000) is a void method call, and thus it cannot be parameterized
    Type org.columba.mail.smtp.SMTPServer of variable server does not match with type java.lang.Thread of variable Thread
    • Make classes org.columba.mail.smtp.SMTPServer and java.lang.Thread extend a common superclass
    Expression server.dropConnection() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    Expression Thread.sleep(1000) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    Expression server.dropConnection() is a void method call, and thus it cannot be parameterized
    Expression Thread.sleep(1000) is a void method call, and thus it cannot be parameterized
    8
    try
    3
    server.dropConnection();
    3
    server.dropConnection();
    9
    Thread.sleep(1000);
    Differences
    Expression1Expression2Difference
    dropConnectionsleepMETHOD_INVOCATION_NAME_MISMATCH
    org.columba.mail.smtp.SMTPServerjava.lang.ThreadVARIABLE_TYPE_MISMATCH
    server.dropConnection()Thread.sleep(1000)TYPE_COMPATIBLE_REPLACEMENT
    server.dropConnection()Thread.sleep(1000)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression server.dropConnection() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    Expression Thread.sleep(1000) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    Expression server.dropConnection() is a void method call, and thus it cannot be parameterized
    Expression Thread.sleep(1000) is a void method call, and thus it cannot be parameterized
    Type org.columba.mail.smtp.SMTPServer of variable server does not match with type java.lang.Thread of variable Thread
    • Make classes org.columba.mail.smtp.SMTPServer and java.lang.Thread extend a common superclass
    Expression server.dropConnection() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    Expression Thread.sleep(1000) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    Expression server.dropConnection() is a void method call, and thus it cannot be parameterized
    Expression Thread.sleep(1000) is a void method call, and thus it cannot be parameterized
    9
    Thread.sleep(1000);
    Precondition Violations (19)
    Row Violation
    1Expression server.dropConnection() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    2Expression Thread.sleep(1000) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    3Expression server.dropConnection() is a void method call, and thus it cannot be parameterized
    4Expression Thread.sleep(1000) is a void method call, and thus it cannot be parameterized
    5Type org.columba.mail.smtp.SMTPServer of variable server does not match with type java.lang.Thread of variable Thread
    6Expression server.dropConnection() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    7Expression Thread.sleep(1000) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    8Expression server.dropConnection() is a void method call, and thus it cannot be parameterized
    9Expression Thread.sleep(1000) is a void method call, and thus it cannot be parameterized
    10Expression server.dropConnection() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    11Expression Thread.sleep(1000) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    12Expression server.dropConnection() is a void method call, and thus it cannot be parameterized
    13Expression Thread.sleep(1000) is a void method call, and thus it cannot be parameterized
    14Type org.columba.mail.smtp.SMTPServer of variable server does not match with type java.lang.Thread of variable Thread
    15Expression server.dropConnection() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    16Expression Thread.sleep(1000) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    17Expression server.dropConnection() is a void method call, and thus it cannot be parameterized
    18Expression Thread.sleep(1000) is a void method call, and thus it cannot be parameterized
    19The refactoring of the clones is infeasible, because classes and do not have a common superclass