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.6
Clones locationClones are in different classes
Number of node comparisons27
  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 fragment3
    Time elapsed for statement mapping (ms)5.4
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
                                                                                                                                  
    1
    MainFrame mainFrame = GuiPackage.getInstance().getMainFrame();
    1
    ReportMainFrame mainFrame = ReportGuiPackage.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");
                                            
    12
    displayPopUp(e);
    Precondition Violations (1)
    Row Violation
    1Expression mainFrame cannot be unified with expression mainFrame , because common superclass javax.swing.JFrame does not declare member(s) public void closeMenu()