if (getContextProvider() != null && getContextProvider().trim().length() > 0) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("Using Provider [" + getContextProvider() + "]"); } table.put(Context.PROVIDER_URL, getContextProvider()); }
if (getInitialContextFactory() != null && getInitialContextFactory().trim().length() > 0) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("Using InitialContext [" + getInitialContextFactory() + "]"); } table.put(Context.INITIAL_CONTEXT_FACTORY, getInitialContextFactory()); }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/jms/sampler/JMSSampler.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/jms/sampler/JMSSampler.java
Method name: Context getInitialContext() Method name: Context getInitialContext()
Number of AST nodes: 4 Number of AST nodes: 4
1
if (getContextProvider() != null && getContextProvider().trim().length() > 0) {
1
if (getInitialContextFactory() != null && getInitialContextFactory().trim().length() > 0) {
2
			if (LOGGER.isDebugEnabled()) {
2
			if (LOGGER.isDebugEnabled()) {
3
				LOGGER.debug("Using Provider [" + getContextProvider() + "]");
3
				LOGGER.debug("Using InitialContext [" + getInitialContextFactory() + "]");
4
			}
4
			}
5
			table.put(Context.PROVIDER_URL, getContextProvider());
5
			table.put(Context.INITIAL_CONTEXT_FACTORY, getInitialContextFactory());
6
		}
6
		}
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 comparisons8
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements4
    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.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    6
    if (getContextProvider() != null && getContextProvider().trim().length() > 0)
    6
    if (getContextProvider() != null && getContextProvider().trim().length() > 0)
    2
    if (getInitialContextFactory() != null && getInitialContextFactory().trim().length() > 0)
    Differences
    Expression1Expression2Difference
    getContextProvidergetInitialContextFactoryMETHOD_INVOCATION_NAME_MISMATCH
    getContextProvidergetInitialContextFactoryMETHOD_INVOCATION_NAME_MISMATCH
    2
    if (getInitialContextFactory() != null && getInitialContextFactory().trim().length() > 0)
    7
    if (LOGGER.isDebugEnabled())
    3
    if (LOGGER.isDebugEnabled())
    8
    LOGGER.debug("Using Provider [" + getContextProvider() + "]");
    8
    LOGGER.debug("Using Provider [" + getContextProvider() + "]");
    4
    LOGGER.debug("Using InitialContext [" + getInitialContextFactory() + "]");
    Differences
    Expression1Expression2Difference
    "Using Provider [""Using InitialContext ["LITERAL_VALUE_MISMATCH
    getContextProvidergetInitialContextFactoryMETHOD_INVOCATION_NAME_MISMATCH
    4
    LOGGER.debug("Using InitialContext [" + getInitialContextFactory() + "]");
    9
    table.put(Context.PROVIDER_URL, getContextProvider());
    9
    table.put(Context.PROVIDER_URL, getContextProvider());
    5
    table.put(Context.INITIAL_CONTEXT_FACTORY, getInitialContextFactory());
    Differences
    Expression1Expression2Difference
    PROVIDER_URLINITIAL_CONTEXT_FACTORYVARIABLE_NAME_MISMATCH
    getContextProvidergetInitialContextFactoryMETHOD_INVOCATION_NAME_MISMATCH
    5
    table.put(Context.INITIAL_CONTEXT_FACTORY, getInitialContextFactory());
    Precondition Violations (0)
    Row Violation