PublisherSampler sampler = (PublisherSampler) s; 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());
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: void modifyTestElement(TestElement) Method name: void configure(TestElement)
Number of AST nodes: 16 Number of AST nodes: 17
1
super.configure(el);
1
PublisherSampler sampler = (PublisherSampler) s;
2
		PublisherSampler sampler = (PublisherSampler) el;
2
		this.configureTestElement(sampler);
3
		
3
		sampler.setUseJNDIProperties(String.valueOf(useProperties.isSelected()));
4
useProperties.setSelected(sampler.getUseJNDIPropertiesAsBoolean());
4
		sampler.setJNDIIntialContextFactory(jndiICF.getText());
5
		jndiICF.setText(sampler.getJNDIInitialContextFactory(
5
		
6
));
6
sampler.setProviderUrl(urlField.getText());
7
		urlField.setText(sampler.getProviderUrl(
7
		
8
));
8
sampler.setConnectionFactory(jndiConnFa
9
		jndiConnFac.setText(sampler.getConnectionFactory());
9
c.getText());
10
		jmsTopic.setText(
10
		sampler.setTopic(jmsTopic.getText());
11
sampler.getTopic(
11
		
12
));
12
sampler.setUsername(jmsUser.getText());
13
		jmsUser.setText(sampler.getUsername(
13
		
14
));
14
sampler.setPassword(jmsPwd.getText());
15
		jmsPwd.setText(sampler.getPassword(
15
		
16
));
16
sampler.setTextMessage(textM
17
		textMessage.setText(sampler.getTextMessage());
17
essage.getText());
18
		messageFile.set
18
		sampler.setInputFile(message
19
Filename(sampler.getInputFile());
19
File.getFilename());
20
		randomFile.setFilename(
20
		sampler.setRandomPath(randomFil
21
sampler.getRandomPath());
21
e.getFilename());
22
		configChoice.set
22
		sampler.setConfigChoice(confi
23
Text(sampler.getConfigChoice());
23
gChoice.getText());
24
		msgChoice.setText(
24
		sampler.setMessageChoice(msgChoice.getText());
25
sampler.getMessageChoice(
25
		
26
));
26
sampler.setIterations(
27
		updateConfig(sampler.getConfigChoice());
27
iterations.getText());
28
		iterations.setText(
28
		sampler.setUseAuth(
29
sampler.getIterations());
29
reqAuth.getText());
30
		reqAuth.setText(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 comparisons272
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment14
    Number of unmapped statements in the second code fragment15
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    PublisherSampler sampler = (PublisherSampler)s;
    1
    PublisherSampler sampler = (PublisherSampler)s;
    2
    PublisherSampler sampler = (PublisherSampler)el;
    Differences
    Expression1Expression2Difference
    selVARIABLE_NAME_MISMATCH
    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());
    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