if (running) { // Pass request to new proxy thread Proxy thd = (Proxy) proxyClass.newInstance(); thd.configure(clientSocket, target, pageEncodings, formEncodings); thd.start(); }
JPopupMenu pop = new JPopupMenu(); pop.add(MenuFactory.makeMenus(new String[] { MenuFactory.CONTROLLERS, MenuFactory.CONFIG_ELEMENTS, MenuFactory.TIMERS, MenuFactory.PRE_PROCESSORS, MenuFactory.SAMPLERS, MenuFactory.ASSERTIONS, MenuFactory.POST_PROCESSORS, MenuFactory.LISTENERS, }, JMeterUtils.getResString("add"), // $NON-NLS-1$ ActionNames.ADD)); MenuFactory.addEditMenu(pop, true); MenuFactory.addFileMenu(pop); return pop;
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/proxy/Daemon.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/threads/gui/ThreadGroupGui.java
Method name: void run() Method name: JPopupMenu createPopupMenu()
Number of AST nodes: 4 Number of AST nodes: 5
1
if (runn
1
JPopupMenu pop = new JPopupMenu();
2
ing) {
2
		pop.add(MenuFactory.makeMenus(new String[] { 
3
						// Pass request to new proxy thread
3
				
4
						Proxy thd = (Proxy) proxyClass.newInstance();
5
                        thd.configure(clientSocket, target, pageEncodings, formEncodings);
6
						thd.start();
7
					}
4
MenuFactory.CONTROLLERS, 
5
				MenuFactory.CONFIG_ELEMENTS, 
6
				MenuFactory.TIMERS, 
7
				MenuFactory.PRE_PROCESSORS,
8
				MenuFactory.SAMPLERS, 
9
				MenuFactory.ASSERTIONS,
10
				MenuFactory.POST_PROCESSORS,
11
				MenuFactory.LISTENERS,
12
				}, 
13
				JMeterUtils.getResString("add"), // $NON-NLS-1$
14
				ActionNames.ADD));
15
		MenuFactory.addEditMenu(pop, true);
16
		MenuFactory.addFileMenu(pop);
17
		return pop;
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 in different classes
Number of node comparisons11
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment4
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    14
    Proxy thd = (Proxy)proxyClass.newInstance();
    14
    Proxy thd = (Proxy)proxyClass.newInstance();
    1
    JPopupMenu pop = new JPopupMenu();
    Differences
    Expression1Expression2Difference
    org.apache.jmeter.protocol.http.proxy.Proxyjavax.swing.JPopupMenuSUBCLASS_TYPE_MISMATCH
    thdpopVARIABLE_NAME_MISMATCH
    org.apache.jmeter.protocol.http.proxy.Proxyjavax.swing.JPopupMenuSUBCLASS_TYPE_MISMATCH
    (Proxy)proxyClass.newInstance()new JPopupMenu()TYPE_COMPATIBLE_REPLACEMENT
    1
    JPopupMenu pop = new JPopupMenu();
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
    2
    pop.add(MenuFactory.makeMenus(new String[] {MenuFactory.CONTROLLERS, MenuFactory.CONFIG_ELEMENTS, MenuFactory.TIMERS, MenuFactory.PRE_PROCESSORS, MenuFactory.SAMPLERS, MenuFactory.ASSERTIONS, MenuFactory.POST_PROCESSORS, MenuFactory.LISTENERS}, JMeterUtils.getResString("add"), ActionNames.ADD));
                                                                              
    3
    MenuFactory.addEditMenu(pop, true);
                                                                    
    4
    MenuFactory.addFileMenu(pop);
                                
    5
    return pop;
    15
    thd.configure(clientSocket, target, pageEncodings, formEncodings);
    15
    thd.configure(clientSocket, target, pageEncodings, formEncodings);
    Preondition Violations
    Unmatched statement thd.configure(clientSocket,target,pageEncodings,formEncodings); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                                          
    16
    thd.start();
    16
    thd.start();
    Preondition Violations
    Unmatched statement thd.start(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                    
    Precondition Violations (3)
    Row Violation
    1Unmatched statement thd.configure(clientSocket,target,pageEncodings,formEncodings); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement thd.start(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Clone fragment #1 returns variable thd with type org.apache.jmeter.protocol.http.proxy.Proxy , while Clone fragment #2 returns variable pop with type javax.swing.JPopupMenu