if (properties.getProperty("host") != null) account.setHost(properties.getProperty("host")); else account.setHost("jabber.org");
if (properties.getProperty("resource") != null) account.setResource(properties.getProperty("resource")); else account.setResource("Altura");
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/plugins/org.columba.chat.altura/src/org/columba/chat/config/Config.java File path: /columba-1.4-src/plugins/org.columba.chat.altura/src/org/columba/chat/config/Config.java
Method name: void load() Method name: void load()
Number of AST nodes: 3 Number of AST nodes: 3
1
if (properties.getProperty("host") != null)
1
if (properties.getProperty("resource") != null)
2
			account.setHost(properties.getProperty("host"));
2
			account.setResource(properties.getProperty("resource"));
3
		else
3
		else
4
			account.setHost("jabber.org");
4
			account.setResource("Altura");
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.3
Clones locationClones are in the same method
Number of node comparisons9
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements3
    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
    7
    if (properties.getProperty("host") != null)
    7
    if (properties.getProperty("host") != null)
    12
    if (properties.getProperty("resource") != null)
    Differences
    Expression1Expression2Difference
    "host""resource"LITERAL_VALUE_MISMATCH
    12
    if (properties.getProperty("resource") != null)
    8
    account.setHost(properties.getProperty("host"));
    8
    account.setHost(properties.getProperty("host"));
    13
    account.setResource(properties.getProperty("resource"));
    Differences
    Expression1Expression2Difference
    "host""resource"LITERAL_VALUE_MISMATCH
    setHostsetResourceMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression account.setHost(properties.getProperty("host")) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression account.setResource(properties.getProperty("resource")) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression account.setHost(properties.getProperty("host")) is a void method call, and thus it cannot be parameterized
    Expression account.setResource(properties.getProperty("resource")) is a void method call, and thus it cannot be parameterized
    13
    account.setResource(properties.getProperty("resource"));
    else
    else
    9
    account.setHost("jabber.org");
    9
    account.setHost("jabber.org");
    14
    account.setResource("Altura");
    Differences
    Expression1Expression2Difference
    "jabber.org""Altura"LITERAL_VALUE_MISMATCH
    setHostsetResourceMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression account.setHost("jabber.org") cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression account.setResource("Altura") cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression account.setHost("jabber.org") is a void method call, and thus it cannot be parameterized
    Expression account.setResource("Altura") is a void method call, and thus it cannot be parameterized
    14
    account.setResource("Altura");
    Precondition Violations (8)
    Row Violation
    1Expression account.setHost(properties.getProperty("host")) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression account.setResource(properties.getProperty("resource")) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression account.setHost(properties.getProperty("host")) is a void method call, and thus it cannot be parameterized
    4Expression account.setResource(properties.getProperty("resource")) is a void method call, and thus it cannot be parameterized
    5Expression account.setHost("jabber.org") cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression account.setResource("Altura") cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression account.setHost("jabber.org") is a void method call, and thus it cannot be parameterized
    8Expression account.setResource("Altura") is a void method call, and thus it cannot be parameterized