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/ReceiveSubscriber.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 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.2 |
Clones location | Clones are in different classes |
Number of node comparisons | 8 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 4 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 0.6 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | if (useProps) | | 1 | if (useProps) |
2 | | | 2 | |
3 | return new InitialContext(); | | 3 | return new InitialContext(); |
| | | | |
4 | return InitialContextFactory.lookupContext(jndi, url, useAuth, user, pwd); | | 4 | return InitialContextFactory.lookupContext(jndi, url, useAuth, user, pwd); |
Precondition Violations (0)
Row |
Violation |