if (e.getType() == DateChangeEvent.SELECTED) { fireSelectionChanged(new DateRange(e.getNewRange() .getStartMillis(), e.getNewRange() .getEndMillis(false))); }
if (protocol.getState() < POP3Protocol.AUTHORIZATION) { openConnection(); }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/calendar/src/main/java/org/columba/calendar/ui/navigation/NavigationController.java File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/pop3/POP3Store.java
Method name: void dateRangeChanged(DateChangeEvent) Method name: void ensureAuthorization()
Number of AST nodes: 2 Number of AST nodes: 2
1
if (e.getType() == DateChangeEvent.SELECTED) {
1
if (protocol.getState() < POP3Protocol.AUTHORIZATION) {
2
							fireSelectionChanged(new DateRange(e.getNewRange()
2
			
3
									.getStartMillis(), e.getNewRange()
4
									.getEndMillis(false)));
5
				
3
openConnection();
6
		}
4
		}
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 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)1.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (e.getType() == DateChangeEvent.SELECTED)
    1
    if (e.getType() == DateChangeEvent.SELECTED)
    1
    if (protocol.getState() < POP3Protocol.AUTHORIZATION)
    Differences
    Expression1Expression2Difference
    getTypegetStateMETHOD_INVOCATION_NAME_MISMATCH
    eprotocolVARIABLE_NAME_MISMATCH
    com.miginfocom.util.dates.DateChangeEventorg.columba.ristretto.pop3.POP3ProtocolVARIABLE_TYPE_MISMATCH
    com.miginfocom.util.dates.DateChangeEventorg.columba.ristretto.pop3.POP3ProtocolVARIABLE_TYPE_MISMATCH
    SELECTEDAUTHORIZATIONVARIABLE_NAME_MISMATCH
    ==<OPERATOR_MISMATCH
    Preondition Violations
    Type com.miginfocom.util.dates.DateChangeEvent of variable e does not match with type org.columba.ristretto.pop3.POP3Protocol of variable protocol
    • Make classes com.miginfocom.util.dates.DateChangeEvent and org.columba.ristretto.pop3.POP3Protocol extend a common superclass
    Type com.miginfocom.util.dates.DateChangeEvent does not match with type org.columba.ristretto.pop3.POP3Protocol
    • Make classes com.miginfocom.util.dates.DateChangeEvent and org.columba.ristretto.pop3.POP3Protocol extend a common superclass
    1
    if (protocol.getState() < POP3Protocol.AUTHORIZATION)
    2
    fireSelectionChanged(new DateRange(e.getNewRange().getStartMillis(), e.getNewRange().getEndMillis(false)));
    2
    fireSelectionChanged(new DateRange(e.getNewRange().getStartMillis(), e.getNewRange().getEndMillis(false)));
    2
    openConnection();
    Differences
    Expression1Expression2Difference
    fireSelectionChangedopenConnectionMETHOD_INVOCATION_NAME_MISMATCH
    fireSelectionChanged(new DateRange(e.getNewRange().getStartMillis(),e.getNewRange().getEndMillis(false)))openConnection()ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression fireSelectionChanged(new DateRange(e.getNewRange().getStartMillis(),e.getNewRange().getEndMillis(false))) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression openConnection() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method openConnection
    Expression fireSelectionChanged(new DateRange(e.getNewRange().getStartMillis(),e.getNewRange().getEndMillis(false))) is a void method call, and thus it cannot be parameterized
    Expression openConnection() is a void method call, and thus it cannot be parameterized
    Expression fireSelectionChanged(new DateRange(e.getNewRange().getStartMillis(),e.getNewRange().getEndMillis(false))) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression openConnection() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method openConnection
    Expression fireSelectionChanged(new DateRange(e.getNewRange().getStartMillis(),e.getNewRange().getEndMillis(false))) is a void method call, and thus it cannot be parameterized
    Expression openConnection() is a void method call, and thus it cannot be parameterized
    2
    openConnection();
    Precondition Violations (11)
    Row Violation
    1Type com.miginfocom.util.dates.DateChangeEvent of variable e does not match with type org.columba.ristretto.pop3.POP3Protocol of variable protocol
    2Type com.miginfocom.util.dates.DateChangeEvent does not match with type org.columba.ristretto.pop3.POP3Protocol
    3Expression fireSelectionChanged(new DateRange(e.getNewRange().getStartMillis(),e.getNewRange().getEndMillis(false))) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression openConnection() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression fireSelectionChanged(new DateRange(e.getNewRange().getStartMillis(),e.getNewRange().getEndMillis(false))) is a void method call, and thus it cannot be parameterized
    6Expression openConnection() is a void method call, and thus it cannot be parameterized
    7Expression fireSelectionChanged(new DateRange(e.getNewRange().getStartMillis(),e.getNewRange().getEndMillis(false))) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression openConnection() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression fireSelectionChanged(new DateRange(e.getNewRange().getStartMillis(),e.getNewRange().getEndMillis(false))) is a void method call, and thus it cannot be parameterized
    10Expression openConnection() is a void method call, and thus it cannot be parameterized
    11The refactoring of the clones is infeasible, because classes and org.columba.mail.pop3.POP3Store do not have a common superclass