PublisherSampler sampler = new PublisherSampler(); this.configureTestElement(sampler); sampler.setUseJNDIProperties(String.valueOf(useProperties.isSelected())); sampler.setJNDIIntialContextFactory(jndiICF.getText()); sampler.setProviderUrl(urlField.getText()); sampler.setConnectionFactory(jndiConnFac.getText()); sampler.setTopic(jmsTopic.getText()); sampler.setUsername(jmsUser.getText()); sampler.setPassword(jmsPwd.getText()); sampler.setTextMessage(textMessage.getText()); sampler.setInputFile(messageFile.getFilename()); sampler.setRandomPath(randomFile.getFilename()); sampler.setConfigChoice(configChoice.getText()); sampler.setMessageChoice(msgChoice.getText()); sampler.setIterations(iterations.getText()); sampler.setUseAuth(reqAuth.getText()); return sampler;
super.configure(el); PublisherSampler sampler = (PublisherSampler) el; useProperties.setSelected(sampler.getUseJNDIPropertiesAsBoolean()); jndiICF.setText(sampler.getJNDIInitialContextFactory()); urlField.setText(sampler.getProviderUrl()); jndiConnFac.setText(sampler.getConnectionFactory()); jmsTopic.setText(sampler.getTopic()); jmsUser.setText(sampler.getUsername()); jmsPwd.setText(sampler.getPassword()); textMessage.setText(sampler.getTextMessage()); messageFile.setFilename(sampler.getInputFile()); randomFile.setFilename(sampler.getRandomPath()); configChoice.setText(sampler.getConfigChoice()); msgChoice.setText(sampler.getMessageChoice()); updateConfig(sampler.getConfigChoice()); iterations.setText(sampler.getIterations()); reqAuth.setText(sampler.getUseAuth());
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/jms/control/gui/JMSPublisherGui.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/jms/control/gui/JMSPublisherGui.java
Method name: TestElement createTestElement() Method name: void configure(TestElement)
Number of AST nodes: 17 Number of AST nodes: 17
1
super.configure(el);
1
PublisherSampler sampler = new PublisherSampler();
2
		PublisherSampler sampler = (PublisherSampler) el;
2
		this.configureTestElement(sampler);
3
		
3
		sampler.setUseJNDIProperties(String.valueOf(useProperties.isSelected()));
4
useProperties.setSelected(sampler.getUseJNDIProperties
4
		
5
AsBoolean());
5
sampler.setJNDIIntialContextFactory(jndiICF.getText());
6
		jndiICF.setText(sampler.getJNDIInitialContextFactory(
6
		
7
));
7
sampler.setProviderUrl(urlField.getText());
8
		urlField.setText(sampler.getProviderUrl(
8
		
9
));
9
sampler.setConnectionFactory(jndiConnFa
10
		jndiConnFac.setText(sampler.getConnectionFactory());
10
c.getText());
11
		jmsTopic.setText(
11
		sampler.setTopic(jmsTopic.getText());
12
sampler.getTopic(
12
		
13
));
13
sampler.setUsername(jmsUser.getText());
14
		jmsUser.setText(sampler.getUsername(
14
		
15
));
15
sampler.setPassword(jmsPwd.getText());
16
		jmsPwd.setText(sampler.getPassword(
16
		
17
));
17
sampler.setTextMessage(textMessage.getText());
18
		textMessage.setText(sampler.getTextMessage(
18
		
19
));
19
sampler.setInputFile(message
20
		messageFile.setFilename(sampler.getInputFile());
20
File.getFilename());
21
		randomFile.setFilename(
21
		sampler.setRandomPath(randomFil
22
sampler.getRandomPath());
22
e.getFilename());
23
		configChoice.set
23
		sampler.setConfigChoice(confi
24
Text(sampler.getConfigChoice());
24
gChoice.getText());
25
		msgChoice.setText(
25
		sampler.setMessageChoice(msgChoice.getText());
26
sampler.getMessageChoice(
26
		
27
));
27
sampler.setIterations(
28
		updateConfig(sampler.getConfigChoice());
28
iterations.getText());
29
		iterations.setText(
29
		sampler.setUseAuth(
30
sampler.getIterations());
30
reqAuth.getText());
31
		reqAuth.setText(
31
		return sampler;
32
sampler.getUseAuth());
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones locationClones are declared in the same class
Number of node comparisons289
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment15
    Number of unmapped statements in the second code fragment15
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    PublisherSampler sampler = new PublisherSampler();
    1
    PublisherSampler sampler = new PublisherSampler();
    2
    PublisherSampler sampler = (PublisherSampler)el;
    Differences
    Expression1Expression2Difference
    new PublisherSampler()(PublisherSampler)elTYPE_COMPATIBLE_REPLACEMENT
    2
    PublisherSampler sampler = (PublisherSampler)el;
    2
    this.configureTestElement(sampler);
    2
    this.configureTestElement(sampler);
    1
    super.configure(el);
    Differences
    Expression1Expression2Difference
    this.configureTestElement(sampler)super.configure(el)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression this.configureTestElement(sampler) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression this.configureTestElement(sampler) is a void method call, and thus it cannot be parameterized
    Expression super.configure(el) is a void method call, and thus it cannot be parameterized
    1
    super.configure(el);
                                                                                                                                                
    3
    useProperties.setSelected(sampler.getUseJNDIPropertiesAsBoolean());
    3
    sampler.setUseJNDIProperties(String.valueOf(useProperties.isSelected()));
                                                                                                                                                            
                                                                                                                          
    4
    jndiICF.setText(sampler.getJNDIInitialContextFactory());
    4
    sampler.setJNDIIntialContextFactory(jndiICF.getText());
                                                                                                                        
                                                                                                
    5
    urlField.setText(sampler.getProviderUrl());
    5
    sampler.setProviderUrl(urlField.getText());
                                                                                                
                                                                                                                  
    6
    jndiConnFac.setText(sampler.getConnectionFactory());
    6
    sampler.setConnectionFactory(jndiConnFac.getText());
                                                                                                                  
                                                                                    
    7
    jmsTopic.setText(sampler.getTopic());
    7
    sampler.setTopic(jmsTopic.getText());
                                                                                    
                                                                                        
    8
    jmsUser.setText(sampler.getUsername());
    8
    sampler.setUsername(jmsUser.getText());
                                                                                        
                                                                                      
    9
    jmsPwd.setText(sampler.getPassword());
    9
    sampler.setPassword(jmsPwd.getText());
                                                                                      
                                                                                                        
    10
    textMessage.setText(sampler.getTextMessage());
    10
    sampler.setTextMessage(textMessage.getText());
                                                                                                        
                                                                                                            
    11
    messageFile.setFilename(sampler.getInputFile());
    11
    sampler.setInputFile(messageFile.getFilename());
                                                                                                            
                                                                                                            
    12
    randomFile.setFilename(sampler.getRandomPath());
    12
    sampler.setRandomPath(randomFile.getFilename());
                                                                                                            
                                                                                                            
    13
    configChoice.setText(sampler.getConfigChoice());
    13
    sampler.setConfigChoice(configChoice.getText());
                                                                                                            
                                                                                                        
    14
    msgChoice.setText(sampler.getMessageChoice());
    14
    sampler.setMessageChoice(msgChoice.getText());
                                                                                                        
                                                                                            
    15
    updateConfig(sampler.getConfigChoice());
    15
    sampler.setIterations(iterations.getText());
                                                                                                    
                                                                                                    
    16
    iterations.setText(sampler.getIterations());
    16
    sampler.setUseAuth(reqAuth.getText());
                                                                                        
                                                                                        
    17
    reqAuth.setText(sampler.getUseAuth());
    17
    return sampler;
                                          
    Precondition Violations (3)
    Row Violation
    1Expression this.configureTestElement(sampler) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression this.configureTestElement(sampler) is a void method call, and thus it cannot be parameterized
    3Expression super.configure(el) is a void method call, and thus it cannot be parameterized