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); } } }
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: 12 Number of AST nodes: 12
1
if (strClassName.startsWith("org.apache.jmeter.gui")) {
1
if (strClassName.startsWith("org.apache.jmeter.report.gui.action")) {
2
                    // log.info("classname:: " + strClassName);
2
                    commandClass = Class.forName(strClassName);
3
                    commandClass = Class.forName(strClassName);
3
                    if (!Modifier.isAbstract(commandClass.getModifiers())) {
4
                    if (!Modifier.isAbstract(commandClass.getModifiers())) {
4
                        command = (Command) commandClass.newInstance();
5
                        command = (Command) commandClass.newInstance();
5
                        Iterator iter = command.getActionNames().iterator();
6
                        Iterator iter = command.getActionNames().iterator();
6
                        while (iter.hasNext()) {
7
                        while (iter.hasNext()) {
7
                            String commandName = (String) iter.next();
8
                            String commandName = (String) iter.next();
8
                            Set commandObjects = (Set) commands.get(commandName);
9
                            Set commandObjects = (Set) commands.get(commandName);
9
                            if (commandObjects == null) {
10
                            if (commandObjects == null) {
10
                                commandObjects = new HashSet();
11
                                commandObjects = new HashSet();
11
                                commands.put(commandName, commandObjects);
12
                                commands.put(commandName, commandObjects);
12
                            }
13
                            }
13
                            commandObjects.add(command);
14
                            commandObjects.add(command);
14
                        }
15
                        }
15
                    }
16
                    }
16
                }
17
                }
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 comparisons41
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements12
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)16.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    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