OnMessageSubscriber(boolean useProps, String jndi, String url, String connfactory, String topic,
String useAuth, String user, String pwd) {
Context ctx = initJNDI(useProps, jndi, url, useAuth, user, pwd);
if (ctx != null) {
initConnection(ctx, connfactory, topic);
} else {
log.error("Could not initialize JNDI Initial Context Factory");
}
}
/**
* initialize the JNDI intial context
*
* @param useProps
* @param jndi
* @param url
* @param useAuth
* @param user
* @param pwd
* @return the context or null
*/
public Context initJNDI(boolean useProps, String jndi, String url, String useAuth, String user, String 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);
}
ReceiveSubscriber(boolean useProps, String jndi, String url, String connfactory, String topic,
String useAuth, String user, String pwd) {
Context ctx = initJNDI(useProps, jndi, url, useAuth, user, pwd);
if (ctx != null) {
initConnection(ctx, connfactory, topic);
} else {
log.error("Could not initialize JNDI Initial Context Factory");
}
}
/**
* Initialize the JNDI initial context
*
* @param useProps
* @param jndi
* @param url
* @param useAuth
* @param user
* @param pwd
* @return the JNDI initial context or null
*/
public Context initJNDI(boolean useProps, String jndi, String url, String useAuth, String user, String 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:
|
|
Method name:
|
Number of AST nodes: 0
|
|
Number of AST nodes: 0
|
|
1 | OnMessageSubscriber(boolean useProps, String jndi, String url, String connfactory, String topic,↵ | | 1 | ReceiveSubscriber(boolean useProps, String jndi, String url, String connfactory, String topic,↵
|
2 | String useAuth, String user, String pwd) {↵ | | 2 | String useAuth, String user, String pwd) {↵
|
3 | Context ctx = initJNDI(useProps, jndi, url, useAuth, user, pwd);↵ | | 3 | Context ctx = initJNDI(useProps, jndi, url, useAuth, user, pwd);↵
|
4 | if (ctx != null) {↵ | | 4 | if (ctx != null) {↵
|
5 | initConnection(ctx, connfactory, topic);↵ | | 5 | initConnection(ctx, connfactory, topic);↵
|
6 | } else {↵ | | 6 | } else {↵
|
7 | log.error("Could not initialize JNDI Initial Context Factory");↵ | | 7 | log.error("Could not initialize JNDI Initial Context Factory");↵
|
8 | }↵ | | 8 | }↵
|
9 | }↵ | | 9 | }↵
|
|
10 | /**↵ | | 10 | /**↵
|
11 | * initialize the JNDI intial context↵ | | 11 | * Initialize the JNDI initial context↵
|
12 | * ↵ | | 12 | * ↵
|
13 | * @param useProps↵ | | 13 | * @param useProps↵
|
14 | * @param jndi↵ | | 14 | * @param jndi↵
|
15 | * @param url↵ | | 15 | * @param url↵
|
16 | * @param useAuth↵ | | 16 | * @param useAuth↵
|
17 | * @param user↵ | | 17 | * @param user↵
|
18 | * @param pwd↵ | | 18 | * @param pwd↵
|
19 | * @return the context or null↵ | | 19 | * @return the JNDI initial context or null↵
|
20 | */↵ | | 20 | */↵
|
21 | public Context initJNDI(boolean useProps, String jndi, String url, String useAuth, String user, String pwd) {↵ | | 21 | public Context initJNDI(boolean useProps, String jndi, String url, String useAuth, String user, String pwd) {↵
|
22 | if (useProps) {↵ | | 22 | if (useProps) {↵
|
23 | try {↵ | | 23 | try {↵
|
24 | return new InitialContext();↵ | | 24 | return new InitialContext();↵
|
25 | } catch (NamingException e) {↵ | | 25 | } catch (NamingException e) {↵
|
26 | log.error(e.getMessage());↵ | | 26 | log.error(e.getMessage());↵
|
27 | return null;↵ | | 27 | return null;↵
|
28 | }↵ | | 28 | }↵
|
29 | } else {↵ | | 29 | } else {↵
|
30 | return InitialContextFactory.lookupContext(jndi, url, useAuth, user, pwd);↵ | | 30 | return InitialContextFactory.lookupContext(jndi, url, useAuth, user, pwd);↵
|
31 | }↵ | | 31 | }↵
|
32 | | | 32 |
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 0 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.0 |
Clones location | |
Number of node comparisons | 0 |