updateCurrentNode(); // Forget about all GUIs we've created so far: we'll need to re-created // them all! guis = new HashMap(); nodesToGui = new HashMap(); testBeanGUIs = new HashMap(); // BeanInfo objects also contain locale-sensitive data -- flush them // away: Introspector.flushCaches(); // Now put the current GUI in place. [This code was copied from the // EditCommand action -- we can't just trigger the action because that // would populate the current node with the contents of the new GUI -- // which is empty.] MainFrame mf = getMainFrame(); // Fetch once if (mf == null) // Probably caused by unit testing on headless system { log.warn("Mainframe is null"); } else { mf.setMainPanel((javax.swing.JComponent) getCurrentGui()); mf.setEditMenu(getTreeListener().getCurrentNode().createPopupMenu()); }
updateCurrentNode(); // Forget about all GUIs we've created so far: we'll need to re-created // them all! guis = new HashMap(); nodesToGui = new HashMap(); testBeanGUIs = new HashMap(); // BeanInfo objects also contain locale-sensitive data -- flush them // away: Introspector.flushCaches(); // Now put the current GUI in place. [This code was copied from the // EditCommand action -- we can't just trigger the action because that // would populate the current node with the contents of the new GUI -- // which is empty.] ReportMainFrame mf = getMainFrame(); // Fetch once if (mf == null) // Probably caused by unit testing on headless system { log.warn("Mainframe is null"); } else { mf.setMainPanel((javax.swing.JComponent) getCurrentGui()); mf.setEditMenu(getTreeListener().getCurrentNode().createPopupMenu()); }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/gui/GuiPackage.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/gui/ReportGuiPackage.java
Method name: void localeChanged(LocaleChangeEvent) Method name: void localeChanged(LocaleChangeEvent)
Number of AST nodes: 10 Number of AST nodes: 10
1
updateCurrentNode();
1
updateCurrentNode();
2
		// Forget about all GUIs we've created so far: we'll need to re-created
2
		// Forget about all GUIs we've created so far: we'll need to re-created
3
		// them all!
3
		// them all!
4
		guis = new HashMap();
4
		guis = new HashMap();
5
		nodesToGui = new HashMap();
5
		nodesToGui = new HashMap();
6
		testBeanGUIs = new HashMap();
6
		testBeanGUIs = new HashMap();
7
		// BeanInfo objects also contain locale-sensitive data -- flush them
7
		// BeanInfo objects also contain locale-sensitive data -- flush them
8
		// away:
8
		// away:
9
		Introspector.flushCaches();
9
		Introspector.flushCaches();
10
		// Now put the current GUI in place. [This code was copied from the
10
		// Now put the current GUI in place. [This code was copied from the
11
		// EditCommand action -- we can't just trigger the action because that
11
		// EditCommand action -- we can't just trigger the action because that
12
		// would populate the current node with the contents of the new GUI --
12
		// would populate the current node with the contents of the new GUI --
13
		// which is empty.]
13
		// which is empty.]
14
		MainFrame mf = getMainFrame(); // Fetch once
14
		ReportMainFrame mf = getMainFrame(); // Fetch once
15
		if (mf == null) // Probably caused by unit testing on headless system
15
		if (mf == null) // Probably caused by unit testing on headless system
16
		{
16
		{
17
			log.warn("Mainframe is null");
17
			log.warn("Mainframe is null");
18
		} else {
18
		} else {
19
			mf.setMainPanel((javax.swing.JComponent) getCurrentGui());
19
			mf.setMainPanel((javax.swing.JComponent) getCurrentGui());
20
			mf.setEditMenu(getTreeListener().getCurrentNode().createPopupMenu());
20
			mf.setEditMenu(getTreeListener().getCurrentNode().createPopupMenu());
21
		}
21
		}
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.2
Clones locationClones are in different classes
Number of node comparisons31
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements9
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)18.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    updateCurrentNode();
    1
    updateCurrentNode();
    2
    guis = new HashMap();
    2
    guis = new HashMap();
    3
    nodesToGui = new HashMap();
    3
    nodesToGui = new HashMap();
    4
    testBeanGUIs = new HashMap();
    4
    testBeanGUIs = new HashMap();
    5
    Introspector.flushCaches();
    5
    Introspector.flushCaches();
    6
    MainFrame mf = getMainFrame();
    6
    MainFrame mf = getMainFrame();
    6
    ReportMainFrame mf = getMainFrame();
    Differences
    Expression1Expression2Difference
    org.apache.jmeter.gui.MainFrameorg.apache.jmeter.gui.ReportMainFrameSUBCLASS_TYPE_MISMATCH
    org.apache.jmeter.gui.MainFrameorg.apache.jmeter.gui.ReportMainFrameSUBCLASS_TYPE_MISMATCH
    6
    ReportMainFrame mf = getMainFrame();
    7
    if (mf == null)
    7
    if (mf == null)
    7
    if (mf == null)
    Differences
    Expression1Expression2Difference
    org.apache.jmeter.gui.MainFrameorg.apache.jmeter.gui.ReportMainFrameSUBCLASS_TYPE_MISMATCH
    7
    if (mf == null)
    8
    log.warn("Mainframe is null");
    8
    log.warn("Mainframe is null");
    else
    else
    9
    mf.setMainPanel((javax.swing.JComponent)getCurrentGui());
    9
    mf.setMainPanel((javax.swing.JComponent)getCurrentGui());
    9
    mf.setMainPanel((javax.swing.JComponent)getCurrentGui());
    Differences
    Expression1Expression2Difference
    org.apache.jmeter.gui.MainFrameorg.apache.jmeter.gui.ReportMainFrameSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression mf cannot be unified with expression mf , because common superclass javax.swing.JFrame does not declare member(s) public void setMainPanel(javax.swing.JComponent)
    9
    mf.setMainPanel((javax.swing.JComponent)getCurrentGui());
                                                                                                                                                      
    10
    mf.setEditMenu(getTreeListener().getCurrentNode().createPopupMenu());
    10
    mf.setEditMenu(getTreeListener().getCurrentNode().createPopupMenu());
                                                                                                                                                      
    Precondition Violations (2)
    Row Violation
    1Expression mf cannot be unified with expression mf , because common superclass javax.swing.JFrame does not declare member(s) public void setMainPanel(javax.swing.JComponent)
    2Clone fragment #1 returns variable mf with type org.apache.jmeter.gui.MainFrame , while Clone fragment #2 returns variable mf with type org.apache.jmeter.gui.ReportMainFrame