private static void clearFileFilters() { FileFilter[] filters = jfc.getChoosableFileFilters(); for (FileFilter filter : filters) { jfc.removeChoosableFileFilter(filter); } }
private static void clearFileFilters() { FileFilter[] filters = jfc.getChoosableFileFilters(); for (int x = 0; x < filters.length; x++) { jfc.removeChoosableFileFilter(filters[x]); } }
Clone fragments detected by clone detection tool
File path: /apache-jmeter-2.11/src/core/org/apache/jmeter/gui/util/FileDialoger.java File path: /apache-jmeter-2.11/src/reports/org/apache/jmeter/gui/util/ReportFileDialoger.java
Method name: void clearFileFilters() Method name: void clearFileFilters()
Number of AST nodes: 2 Number of AST nodes: 2
1
private static void clearFileFilters() {
1
private static void clearFileFilters() {
2
        FileFilter[] filters = jfc.getChoosableFileFilters();
2
        FileFilter[] filters = jfc.getChoosableFileFilters();
3
        for (FileFilter filter : filters) {
3
        for (int x = 0; x < filters.length; x++) {
4
            jfc.removeChoosableFileFilter(filter);
4
            jfc.removeChoosableFileFilter(filters[x]);
5
        }
5
        }
6
    }
6
    }
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.0
    Similarity Score0.400
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    for (FileFilter filter : filters)
    2
    for (int x = 0; x < filters.length; x++)
    3
    jfc.removeChoosableFileFilter(filter);
    3
    jfc.removeChoosableFileFilter(filter);
    3
    jfc.removeChoosableFileFilter(filters[x]);
    Differences
    Expression1Expression2Difference
    filterfilters[x]TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression filter cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression filters[x] cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3
    jfc.removeChoosableFileFilter(filters[x]);
    Precondition Violations (2)
    Row Violation
    1Expression filter cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression filters[x] cannot be parameterized, because it has dependencies to/from statements that will be extracted