if (lastJFCDirectory == null) { String start = JMeterUtils.getPropDefault("user.dir", ""); if (!start.equals("")) { jfc.setCurrentDirectory(new File(start)); } } jfc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); int retVal = jfc.showDialog(ReportGuiPackage.getInstance().getMainFrame(), JMeterUtils.getResString("report_select")); lastJFCDirectory = jfc.getCurrentDirectory().getAbsolutePath(); if (retVal == JFileChooser.APPROVE_OPTION) { return jfc; } else { return null; }
if (lastJFCDirectory == null) { String start = JMeterUtils.getPropDefault("user.dir", ""); if (!start.equals("")) { jfc.setCurrentDirectory(new File(start)); } } clearFileFilters(); jfc.addChoosableFileFilter(new JMeterFileFilter(exts)); int retVal = jfc.showOpenDialog(ReportGuiPackage.getInstance().getMainFrame()); lastJFCDirectory = jfc.getCurrentDirectory().getAbsolutePath(); if (retVal == JFileChooser.APPROVE_OPTION) { return jfc; } else { return null; }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/gui/util/DirectoryDialoger.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/gui/util/ReportFileDialoger.java
Method name: JFileChooser promptToOpenFile() Method name: JFileChooser promptToOpenFile(String[])
Number of AST nodes: 10 Number of AST nodes: 11
1
if (lastJFCDirectory == null) {
1
if (lastJFCDirectory == null) {
2
			String start = JMeterUtils.getPropDefault("user.dir", "");
2
			String start = JMeterUtils.getPropDefault("user.dir", "");
3
			if (!start.equals("")) {
3
			if (!start.equals("")) {
4
				jfc.setCurrentDirectory(new File(start));
4
				jfc.setCurrentDirectory(new File(start));
5
			}
5
			}
6
		}
6
		}
7
        jfc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
8
        
7
		clearFileFilters();
8
		jfc.addChoosableFileFilter(new JMeterFileFilter(exts));
9
int retVal = jfc.showDialog(ReportGuiPackage.getInstance().getMainFrame(),
9
		int retVal = jfc.showOpenDialog(ReportGuiPackage.getInstance().getMainFrame()
10
                JMeterUtils.getResString("report_select"));
10
);
11
		lastJFCDirectory = jfc.getCurrentDirectory().getAbsolutePath();
11
		lastJFCDirectory = jfc.getCurrentDirectory().getAbsolutePath();
12
		if (retVal == JFileChooser.APPROVE_OPTION) {
12
		if (retVal == JFileChooser.APPROVE_OPTION) {
13
			return jfc;
13
			return jfc;
14
		} else {
14
		} else {
15
			return null;
15
			return null;
16
		}
16
		}
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.4
Clones locationClones are in different classes
Number of node comparisons24
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements10
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)2.1
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    if (lastJFCDirectory == null)
    1
    if (lastJFCDirectory == null)
    2
    String start = JMeterUtils.getPropDefault("user.dir", "");
    2
    String start = JMeterUtils.getPropDefault("user.dir", "");
    3
    if (!start.equals(""))
    3
    if (!start.equals(""))
    4
    jfc.setCurrentDirectory(new File(start));
    4
    jfc.setCurrentDirectory(new File(start));
    5
    jfc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
    5
    jfc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
    5
    clearFileFilters();
    Differences
    Expression1Expression2Difference
    setFileSelectionModeclearFileFiltersMETHOD_INVOCATION_NAME_MISMATCH
    jfc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY)clearFileFilters()ARGUMENT_NUMBER_MISMATCH
    jfcMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression jfc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY) is a void method call, and thus it cannot be parameterized
    Expression clearFileFilters() is a void method call, and thus it cannot be parameterized
    Expression jfc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY) is a void method call, and thus it cannot be parameterized
    Expression clearFileFilters() is a void method call, and thus it cannot be parameterized
    5
    clearFileFilters();
                                                                                                                        
    6
    jfc.addChoosableFileFilter(new JMeterFileFilter(exts));
    6
    int retVal = jfc.showDialog(ReportGuiPackage.getInstance().getMainFrame(), JMeterUtils.getResString("report_select"));
    6
    int retVal = jfc.showDialog(ReportGuiPackage.getInstance().getMainFrame(), JMeterUtils.getResString("report_select"));
    7
    int retVal = jfc.showOpenDialog(ReportGuiPackage.getInstance().getMainFrame());
    Differences
    Expression1Expression2Difference
    showDialogshowOpenDialogMETHOD_INVOCATION_NAME_MISMATCH
    jfc.showDialog(ReportGuiPackage.getInstance().getMainFrame(),JMeterUtils.getResString("report_select"))jfc.showOpenDialog(ReportGuiPackage.getInstance().getMainFrame())ARGUMENT_NUMBER_MISMATCH
    7
    int retVal = jfc.showOpenDialog(ReportGuiPackage.getInstance().getMainFrame());
    7
    lastJFCDirectory = jfc.getCurrentDirectory().getAbsolutePath();
    8
    lastJFCDirectory = jfc.getCurrentDirectory().getAbsolutePath();
    8
    if (retVal == JFileChooser.APPROVE_OPTION)
    9
    if (retVal == JFileChooser.APPROVE_OPTION)
    9
    return jfc;
    10
    return jfc;
    else
    else
    10
    return null;
    11
    return null;
    Precondition Violations (4)
    Row Violation
    1Expression jfc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY) is a void method call, and thus it cannot be parameterized
    2Expression clearFileFilters() is a void method call, and thus it cannot be parameterized
    3Expression jfc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY) is a void method call, and thus it cannot be parameterized
    4Expression clearFileFilters() is a void method call, and thus it cannot be parameterized