while (iterClasses.hasNext()) { String strClassName = (String) iterClasses.next(); if (strClassName.startsWith("org.apache.jmeter.gui")) { commandClass = Class.forName(strClassName); if (!Modifier.isAbstract(commandClass.getModifiers())) { command = (Command) commandClass.newInstance(); Iterator iter = command.getActionNames().iterator(); while (iter.hasNext()) { String commandName = (String) iter.next(); Set commandObjects = (Set) commands.get(commandName); if (commandObjects == null) { commandObjects = new HashSet(); commands.put(commandName, commandObjects); } commandObjects.add(command); } } } }
while (iterClasses.hasNext()) { String strClassName = (String) iterClasses.next(); if (strClassName.startsWith("org.apache.jmeter.report.gui.action")) { // log.info("classname:: " + strClassName); commandClass = Class.forName(strClassName); if (!Modifier.isAbstract(commandClass.getModifiers())) { command = (Command) commandClass.newInstance(); Iterator iter = command.getActionNames().iterator(); while (iter.hasNext()) { String commandName = (String) iter.next(); Set commandObjects = (Set) commands.get(commandName); if (commandObjects == null) { commandObjects = new HashSet(); commands.put(commandName, commandObjects); } commandObjects.add(command); } } } }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/gui/action/ActionRouter.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/report/gui/action/ReportActionRouter.java
Method name: void populateCommandMap() Method name: void populateCommandMap()
Number of AST nodes: 14 Number of AST nodes: 14
1
while (iterClasses.hasNext()) {
1
while (iterClasses.hasNext()) {
2
				String strClassName = (String) iterClasses.next();
2
				String strClassName = (String) iterClasses.next();
3
                if (strClassName.startsWith("org.apache.jmeter.gui")) {
3
                if (strClassName.startsWith("org.apache.jmeter.report.gui.action")) {
4
                    // log.info("classname:: " + strClassName);
4
                    commandClass = Class.forName(strClassName);
5
                    commandClass = Class.forName(strClassName);
5
                    if (!Modifier.isAbstract(commandClass.getModifiers())) {
6
                    if (!Modifier.isAbstract(commandClass.getModifiers())) {
6
                        command = (Command) commandClass.newInstance();
7
                        command = (Command) commandClass.newInstance();
7
                        Iterator iter = command.getActionNames().iterator();
8
                        Iterator iter = command.getActionNames().iterator();
8
                        while (iter.hasNext()) {
9
                        while (iter.hasNext()) {
9
                            String commandName = (String) iter.next();
10
                            String commandName = (String) iter.next();
10
                            Set commandObjects = (Set) commands.get(commandName);
11
                            Set commandObjects = (Set) commands.get(commandName);
11
                            if (commandObjects == null) {
12
                            if (commandObjects == null) {
12
                                commandObjects = new HashSet();
13
                                commandObjects = new HashSet();
13
                                commands.put(commandName, commandObjects);
14
                                commands.put(commandName, commandObjects);
14
                            }
15
                            }
15
                            commandObjects.add(command);
16
                            commandObjects.add(command);
16
                        }
17
                        }
17
                    }
18
                    }
18
                }
19
                }
19
			}
20
			}
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 in different classes
Number of node comparisons45
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements14
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)25.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    12
    while (iterClasses.hasNext())
    12
    while (iterClasses.hasNext())
    13
    String strClassName = (String)iterClasses.next();
    13
    String strClassName = (String)iterClasses.next();
    14
    if (strClassName.startsWith("org.apache.jmeter.gui"))
    14
    if (strClassName.startsWith("org.apache.jmeter.gui"))
    14
    if (strClassName.startsWith("org.apache.jmeter.report.gui.action"))
    Differences
    Expression1Expression2Difference
    "org.apache.jmeter.gui""org.apache.jmeter.report.gui.action"LITERAL_VALUE_MISMATCH
    14
    if (strClassName.startsWith("org.apache.jmeter.report.gui.action"))
    15
    commandClass = Class.forName(strClassName);
    15
    commandClass = Class.forName(strClassName);
    16
    if (!Modifier.isAbstract(commandClass.getModifiers()))
    16
    if (!Modifier.isAbstract(commandClass.getModifiers()))
    17
    command = (Command)commandClass.newInstance();
    17
    command = (Command)commandClass.newInstance();
    18
    Iterator iter = command.getActionNames().iterator();
    18
    Iterator iter = command.getActionNames().iterator();
    19
    while (iter.hasNext())
    19
    while (iter.hasNext())
    20
    String commandName = (String)iter.next();
    20
    String commandName = (String)iter.next();
    21
    Set commandObjects = (Set)commands.get(commandName);
    21
    Set commandObjects = (Set)commands.get(commandName);
    22
    if (commandObjects == null)
    22
    if (commandObjects == null)
    23
    commandObjects = new HashSet();
    23
    commandObjects = new HashSet();
    24
    commands.put(commandName, commandObjects);
    24
    commands.put(commandName, commandObjects);
    25
    commandObjects.add(command);
    25
    commandObjects.add(command);
    Precondition Violations (0)
    Row Violation