ReportMainFrame mainFrame = ReportGuiPackage.getInstance().getMainFrame(); // Close any Main Menu that is open mainFrame.closeMenu(); int selRow = tree.getRowForLocation(e.getX(), e.getY()); if (tree.getPathForLocation(e.getX(), e.getY()) != null) { log.debug("mouse pressed, updating currentPath"); currentPath = tree.getPathForLocation(e.getX(), e.getY()); } if (selRow != -1) { // updateMainMenu(((JMeterGUIComponent) // getCurrentNode().getUserObject()).createPopupMenu()); if (isRightClick(e)) { if (tree.getSelectionCount() < 2) { tree.setSelectionPath(currentPath); } if (getCurrentNode() instanceof ReportTreeNode) { log.debug("About to display pop-up"); displayPopUp(e); } } }
MainFrame mainFrame = GuiPackage.getInstance().getMainFrame(); // Close any Main Menu that is open mainFrame.closeMenu(); int selRow = tree.getRowForLocation(e.getX(), e.getY()); if (tree.getPathForLocation(e.getX(), e.getY()) != null) { log.debug("mouse pressed, updating currentPath"); currentPath = tree.getPathForLocation(e.getX(), e.getY()); } if (selRow != -1) { // updateMainMenu(((JMeterGUIComponent) // getCurrentNode().getUserObject()).createPopupMenu()); if (isRightClick(e)) { if (tree.getSelectionCount() < 2) { tree.setSelectionPath(currentPath); } log.debug("About to display pop-up"); displayPopUp(e); } }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/report/gui/tree/ReportTreeListener.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/gui/tree/JMeterTreeListener.java
Method name: void mousePressed(MouseEvent) Method name: void mousePressed(MouseEvent)
Number of AST nodes: 13 Number of AST nodes: 12
1
ReportMainFrame mainFrame = ReportGuiPackage.getInstance().getMainFrame();
1
MainFrame mainFrame = GuiPackage.getInstance().getMainFrame();
2
		// Close any Main Menu that is open
2
		// Close any Main Menu that is open
3
		mainFrame.closeMenu();
3
		mainFrame.closeMenu();
4
		int selRow = tree.getRowForLocation(e.getX(), e.getY());
4
		int selRow = tree.getRowForLocation(e.getX(), e.getY());
5
		if (tree.getPathForLocation(e.getX(), e.getY()) != null) {
5
		if (tree.getPathForLocation(e.getX(), e.getY()) != null) {
6
			log.debug("mouse pressed, updating currentPath");
6
			log.debug("mouse pressed, updating currentPath");
7
			currentPath = tree.getPathForLocation(e.getX(), e.getY());
7
			currentPath = tree.getPathForLocation(e.getX(), e.getY());
8
		}
8
		}
9
		if (selRow != -1) {
9
		if (selRow != -1) {
10
			// updateMainMenu(((JMeterGUIComponent)
10
			// updateMainMenu(((JMeterGUIComponent)
11
			// getCurrentNode().getUserObject()).createPopupMenu());
11
			// getCurrentNode().getUserObject()).createPopupMenu());
12
			if (isRightClick(e)) {
12
			if (isRightClick(e)) {
13
				if (tree.getSelectionCount() < 2) {
13
				if (tree.getSelectionCount() < 2) {
14
					tree.setSelectionPath(currentPath);
14
					tree.setSelectionPath(currentPath);
15
				}
15
				}
16
				if (getCurrentNode() instanceof ReportTreeNode) {
16
				
17
					log.debug("About to display pop-up");
17
log.debug("About to display pop-up");
18
					displayPopUp(e);
18
				displayPopUp(e);
19
				}
19
			
20
			}
20
}
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.9
Clones locationClones are in different classes
Number of node comparisons27
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements10
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)11.1
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    ReportMainFrame mainFrame = ReportGuiPackage.getInstance().getMainFrame();
    1
    ReportMainFrame mainFrame = ReportGuiPackage.getInstance().getMainFrame();
    1
    MainFrame mainFrame = GuiPackage.getInstance().getMainFrame();
    Differences
    Expression1Expression2Difference
    org.apache.jmeter.gui.ReportMainFrameorg.apache.jmeter.gui.MainFrameSUBCLASS_TYPE_MISMATCH
    org.apache.jmeter.gui.ReportMainFrameorg.apache.jmeter.gui.MainFrameSUBCLASS_TYPE_MISMATCH
    org.apache.jmeter.gui.ReportGuiPackageorg.apache.jmeter.gui.GuiPackageSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression ReportGuiPackage cannot be unified with expression GuiPackage , because common superclass org.apache.jmeter.util.LocaleChangeListener does not declare member(s) public static org.apache.jmeter.gui.ReportGuiPackage getInstance() , public static org.apache.jmeter.gui.GuiPackage getInstance() , public org.apache.jmeter.gui.ReportMainFrame getMainFrame() , public org.apache.jmeter.gui.MainFrame getMainFrame()
    1
    MainFrame mainFrame = GuiPackage.getInstance().getMainFrame();
    2
    mainFrame.closeMenu();
    2
    mainFrame.closeMenu();
    2
    mainFrame.closeMenu();
    Differences
    Expression1Expression2Difference
    org.apache.jmeter.gui.ReportMainFrameorg.apache.jmeter.gui.MainFrameSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression mainFrame cannot be unified with expression mainFrame , because common superclass javax.swing.JFrame does not declare member(s) public void closeMenu()
    2
    mainFrame.closeMenu();
    3
    int selRow = tree.getRowForLocation(e.getX(), e.getY());
    3
    int selRow = tree.getRowForLocation(e.getX(), e.getY());
    4
    if (tree.getPathForLocation(e.getX(), e.getY()) != null)
    4
    if (tree.getPathForLocation(e.getX(), e.getY()) != null)
    5
    log.debug("mouse pressed, updating currentPath");
    5
    log.debug("mouse pressed, updating currentPath");
    6
    currentPath = tree.getPathForLocation(e.getX(), e.getY());
    6
    currentPath = tree.getPathForLocation(e.getX(), e.getY());
    7
    if (selRow != -1)
    7
    if (selRow != -1)
    8
    if (isRightClick(e))
    8
    if (isRightClick(e))
    9
    if (tree.getSelectionCount() < 2)
    9
    if (tree.getSelectionCount() < 2)
    10
    tree.setSelectionPath(currentPath);
    10
    tree.setSelectionPath(currentPath);
                                                                                      
    11
    log.debug("About to display pop-up");
    11
    if (getCurrentNode() instanceof ReportTreeNode)
                                                                                                        
    12
    log.debug("About to display pop-up");
                                                                                      
    13
    displayPopUp(e);
    13
    displayPopUp(e);
    Preondition Violations
    Unmatched statement displayPopUp(e); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                            
                                            
    12
    displayPopUp(e);
    Preondition Violations
    Unmatched statement displayPopUp(e); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    12
    displayPopUp(e);
    Precondition Violations (4)
    Row Violation
    1Expression ReportGuiPackage cannot be unified with expression GuiPackage , because common superclass org.apache.jmeter.util.LocaleChangeListener does not declare member(s) public static org.apache.jmeter.gui.ReportGuiPackage getInstance() , public static org.apache.jmeter.gui.GuiPackage getInstance() , public org.apache.jmeter.gui.ReportMainFrame getMainFrame() , public org.apache.jmeter.gui.MainFrame getMainFrame()
    2Expression mainFrame cannot be unified with expression mainFrame , because common superclass javax.swing.JFrame does not declare member(s) public void closeMenu()
    3Unmatched statement displayPopUp(e); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4Unmatched statement displayPopUp(e); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted