if (useProps) { try { return new InitialContext(); } catch (NamingException e) { log.error(e.getMessage()); return null; } } else { return InitialContextFactory.lookupContext(jndi, url, useAuth, user, pwd); }
if (useProps) { try { return new InitialContext(); } catch (NamingException e) { log.error(e.getMessage()); return null; } } else { return InitialContextFactory.lookupContext(jndi, url, useAuth, user, pwd); }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/jms/client/OnMessageSubscriber.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/jms/client/Publisher.java
Method name: Context initJNDI(boolean, String, String, String, String, String) Method name: Context initJNDI(boolean, String, String, String, String, String)
Number of AST nodes: 4 Number of AST nodes: 4
1
if (useProps) {
1
if (useProps) {
2
			try {
2
			try {
3
				return new InitialContext();
3
				return new InitialContext();
4
			} catch (NamingException e) {
4
			} catch (NamingException e) {
5
				log.error(e.getMessage());
5
				log.error(e.getMessage());
6
				return null;
6
				return null;
7
			}
7
			}
8
		} else {
8
		} else {
9
			return InitialContextFactory.lookupContext(jndi, url, useAuth, user, pwd);
9
			return InitialContextFactory.lookupContext(jndi, url, useAuth, user, pwd);
10
		}
10
		}
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.2
Clones locationClones are in different classes
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)0.7
    Clone typeType 1
    Mapped Statements
    ID Statement ID Statement
    1
    if (useProps)
    1
    if (useProps)
    2
    try
    2
    try
    3
    return new InitialContext();
    3
    return new InitialContext();
    else
    else
    4
    return InitialContextFactory.lookupContext(jndi, url, useAuth, user, pwd);
    4
    return InitialContextFactory.lookupContext(jndi, url, useAuth, user, pwd);
    Precondition Violations (0)
    Row Violation