if (guiTitles.size() > 0) { String title = guiItem.getDocAnchor(); boolean ct = guiTitles.containsKey(title); if (ct) { guiTitles.put(title, Boolean.TRUE);// So we can detect extra entries } String name = guiItem.getClass().getName(); if (// Is this a work in progress or an internal GUI component? (title != null && title.length() > 0) // Will be "" for internal components && (title.toUpperCase(java.util.Locale.ENGLISH).indexOf("(ALPHA") == -1) && (title.toUpperCase(java.util.Locale.ENGLISH).indexOf("(BETA") == -1) && (!title.equals("Example1")) // Skip the example samplers ... && (!title.equals("Example2")) && (!name.startsWith("org.apache.jmeter.examples.")) ) {// No, not a work in progress ... String s = "component_reference.xml needs '" + title + "' anchor for " + name; if (!ct) { log.warn(s); // Record in log as well } assertTrue(s, ct); } }
if (funcTitles.size() > 0) { String title = funcItem.getReferenceKey(); boolean ct = funcTitles.containsKey(title); if (ct) { funcTitles.put(title, Boolean.TRUE);// For detecting extra entries } if (// Is this a work in progress ? title.indexOf("(ALPHA") == -1 && title.indexOf("(EXPERIMENTAL") == -1) {// No, // not // a // work // in // progress // ... String s = "function.xml needs '" + title + "' entry for " + funcItem.getClass().getName(); if (!ct) { log.warn(s); // Record in log as well } assertTrue(s, ct); } }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/junit/JMeterTest.java File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/junit/JMeterTest.java
Method name: void runGUITitle() Method name: void runFunction()
Number of AST nodes: 11 Number of AST nodes: 10
1
if (guiTitles.size() > 0) {
1
if (funcTitles.size() > 0) {
2
			String title = guiItem.getDocAnchor();
2
			String title = funcItem.getReferenceKey();
3
			boolean ct = guiTitles.containsKey(title);
3
			boolean ct = funcTitles.containsKey(title);
4
			if (ct) {
4
			if (ct) {
5
				guiTitles.put(title, Boolean.TRUE);// So we can detect extra entries
5
				funcTitles.put(title, Boolean.TRUE);// For detecting extra entries
6
            }
7
            String name = guiItem.getClass().getName();
8
			if (// Is this a work in progress or an internal GUI component?
9
			    (title != null && title.length() > 0) // Will be "" for internal components
10
				&& (title.toUpperCase(java.util.Locale.ENGLISH)
6
			}
7
			if (// Is this a work in progress ?
11
.indexOf("(ALPHA") == -1) 
8
			title.indexOf("(ALPHA") == -1
12
                && (title.toUpperCase(java.util.Locale.ENGLISH).indexOf("(BETA") == -1)
9
 && title.indexOf("(EXPERIMENTAL") == -1)
13
				&& (!title.equals("Example1")) // Skip the example samplers ...
14
				&& (!title.equals("Example2"))
15
                && (!name.startsWith("org.apache.jmeter.examples."))
16
                )
17
            {// No, not a work in progress ...
18
                String s = "component_reference
10
 {// No,
11
																					// not
12
																					// a
13
																					// work
14
																					// in
15
																					// progress
16
																					// ...
19
.xml needs '" + title + "' anchor for " + name;
17
				String s = "function.xml needs '" + title + "' entry for " + funcItem.getClass().getName();
20
				if (!ct) {
18
				if (!ct) {
21
					log.warn(s); // Record in log as well
19
					log.warn(s); // Record in log as well
22
                }
20
				}
23
				assertTrue(s, ct);
21
				assertTrue(s, ct);
24
			}
22
			}
25
		}
23
		}
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.5
Clones locationClones are declared in the same class
Number of node comparisons29
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements9
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)2.9
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    if (guiTitles.size() > 0)
    1
    if (guiTitles.size() > 0)
    1
    if (funcTitles.size() > 0)
    Differences
    Expression1Expression2Difference
    guiTitlesfuncTitlesVARIABLE_NAME_MISMATCH
    1
    if (funcTitles.size() > 0)
                                                                                          
    2
    String title = funcItem.getReferenceKey();
    2
    String title = guiItem.getDocAnchor();
                                                                                  
    3
    boolean ct = guiTitles.containsKey(title);
    3
    boolean ct = guiTitles.containsKey(title);
    3
    boolean ct = funcTitles.containsKey(title);
    Differences
    Expression1Expression2Difference
    guiTitlesfuncTitlesVARIABLE_NAME_MISMATCH
    3
    boolean ct = funcTitles.containsKey(title);
    4
    if (ct)
    4
    if (ct)
    5
    guiTitles.put(title, Boolean.TRUE);
    5
    guiTitles.put(title, Boolean.TRUE);
    5
    funcTitles.put(title, Boolean.TRUE);
    Differences
    Expression1Expression2Difference
    guiTitlesfuncTitlesVARIABLE_NAME_MISMATCH
    5
    funcTitles.put(title, Boolean.TRUE);
    6
    String name = guiItem.getClass().getName();
                                                                                            
    7
    if ((title != null && title.length() > 0) && (title.toUpperCase(java.util.Locale.ENGLISH).indexOf("(ALPHA") == -1) && (title.toUpperCase(java.util.Locale.ENGLISH).indexOf("(BETA") == -1) && (!title.equals("Example1")) && (!title.equals("Example2")) && (!name.startsWith("org.apache.jmeter.examples.")))
    7
    if ((title != null && title.length() > 0) && (title.toUpperCase(java.util.Locale.ENGLISH).indexOf("(ALPHA") == -1) && (title.toUpperCase(java.util.Locale.ENGLISH).indexOf("(BETA") == -1) && (!title.equals("Example1")) && (!title.equals("Example2")) && (!name.startsWith("org.apache.jmeter.examples.")))
    6
    if (title.indexOf("(ALPHA") == -1 && title.indexOf("(EXPERIMENTAL") == -1)
    Differences
    Expression1Expression2Difference
    (title != null && title.length() > 0) && (title.toUpperCase(java.util.Locale.ENGLISH).indexOf("(ALPHA") == -1) && (title.toUpperCase(java.util.Locale.ENGLISH).indexOf("(BETA") == -1)&& (!title.equals("Example1"))&& (!title.equals("Example2"))&& (!name.startsWith("org.apache.jmeter.examples."))title.indexOf("(ALPHA") == -1 && title.indexOf("(EXPERIMENTAL") == -1INFIX_EXTENDED_OPERAND_NUMBER_MISMATCH
    (title != null && title.length() > 0)title.indexOf("(ALPHA") == -1INFIX_LEFT_OPERAND_MISMATCH
    (title.toUpperCase(java.util.Locale.ENGLISH).indexOf("(ALPHA") == -1)title.indexOf("(EXPERIMENTAL") == -1INFIX_RIGHT_OPERAND_MISMATCH
    6
    if (title.indexOf("(ALPHA") == -1 && title.indexOf("(EXPERIMENTAL") == -1)
    8
    String s = "component_reference.xml needs '" + title + "' anchor for " + name;
    8
    String s = "component_reference.xml needs '" + title + "' anchor for " + name;
    7
    String s = "function.xml needs '" + title + "' entry for " + funcItem.getClass().getName();
    Differences
    Expression1Expression2Difference
    "' anchor for ""' entry for "LITERAL_VALUE_MISMATCH
    namefuncItem.getClass().getName()TYPE_COMPATIBLE_REPLACEMENT
    "component_reference.xml needs '""function.xml needs '"LITERAL_VALUE_MISMATCH
    7
    String s = "function.xml needs '" + title + "' entry for " + funcItem.getClass().getName();
    9
    if (!ct)
    8
    if (!ct)
    10
    log.warn(s);
    9
    log.warn(s);
    11
    assertTrue(s, ct);
    10
    assertTrue(s, ct);
    Precondition Violations (0)
    Row Violation