comp = (TestBeanGUI) testBeanGUIs.get(testClass); if (comp == null) { comp = new TestBeanGUI(testClass); testBeanGUIs.put(testClass, comp); }
synchronized (threadGroupsInfoMap) { groupInfo = (ThroughputInfo)threadGroupsInfoMap.get(group); if (groupInfo == null) { groupInfo = new ThroughputInfo(); threadGroupsInfoMap.put(group, groupInfo); } }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/gui/GuiPackage.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/timers/ConstantThroughputTimer.java
Method name: JMeterGUIComponent getGuiFromCache(Class, Class) Method name: long calculateDelay()
Number of AST nodes: 4 Number of AST nodes: 5
1
comp = (TestBeanGUI) testBeanGUIs.get(testClass);
2
			if (comp == null) {
3
				comp = new TestBeanGUI(testClass);
4
				testBeanGUIs.put(testClass, comp);
5
			
1
synchronized (threadGroupsInfoMap) {
2
                groupInfo = (ThroughputInfo)threadGroupsInfoMap.get(group);
3
                if (groupInfo == null) {
4
                    groupInfo = new ThroughputInfo();
5
                    threadGroupsInfoMap.put(group, groupInfo);
6
                }
6
}
7
            }
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.1
Clones locationClones are in different classes
Number of node comparisons11
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)1.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    3
    comp = (TestBeanGUI)testBeanGUIs.get(testClass);
    3
    comp = (TestBeanGUI)testBeanGUIs.get(testClass);
    Preondition Violations
    Unmatched statement comp=(TestBeanGUI)testBeanGUIs.get(testClass); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                                      
                                                                                                                              
    17
    groupInfo = (ThroughputInfo)threadGroupsInfoMap.get(group);
    Preondition Violations
    Unmatched statement groupInfo=(ThroughputInfo)threadGroupsInfoMap.get(group); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    17
    groupInfo = (ThroughputInfo)threadGroupsInfoMap.get(group);
    4
    if (comp == null)
    4
    if (comp == null)
    18
    if (groupInfo == null)
    Differences
    Expression1Expression2Difference
    compgroupInfoVARIABLE_NAME_MISMATCH
    org.apache.jmeter.gui.JMeterGUIComponentorg.apache.jmeter.timers.ConstantThroughputTimer.ThroughputInfoVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.apache.jmeter.gui.JMeterGUIComponent of variable comp does not match with type org.apache.jmeter.timers.ConstantThroughputTimer.ThroughputInfo of variable groupInfo
    • Make classes org.apache.jmeter.gui.JMeterGUIComponent and org.apache.jmeter.timers.ConstantThroughputTimer.ThroughputInfo extend a common superclass
    18
    if (groupInfo == null)
    5
    comp = new TestBeanGUI(testClass);
    5
    comp = new TestBeanGUI(testClass);
    Preondition Violations
    Unmatched statement comp=new TestBeanGUI(testClass); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                          
                                                                          
    19
    groupInfo = new ThroughputInfo();
    Preondition Violations
    Unmatched statement groupInfo=new ThroughputInfo(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    19
    groupInfo = new ThroughputInfo();
    6
    testBeanGUIs.put(testClass, comp);
    6
    testBeanGUIs.put(testClass, comp);
    20
    threadGroupsInfoMap.put(group, groupInfo);
    Differences
    Expression1Expression2Difference
    testClassgroupVARIABLE_NAME_MISMATCH
    java.lang.Classorg.apache.jmeter.threads.ThreadGroupVARIABLE_TYPE_MISMATCH
    compgroupInfoVARIABLE_NAME_MISMATCH
    org.apache.jmeter.gui.JMeterGUIComponentorg.apache.jmeter.timers.ConstantThroughputTimer.ThroughputInfoVARIABLE_TYPE_MISMATCH
    testBeanGUIsthreadGroupsInfoMapVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type java.lang.Class of variable testClass does not match with type org.apache.jmeter.threads.ThreadGroup of variable group
    • Make classes java.lang.Class and org.apache.jmeter.threads.ThreadGroup extend a common superclass
    Type org.apache.jmeter.gui.JMeterGUIComponent of variable comp does not match with type org.apache.jmeter.timers.ConstantThroughputTimer.ThroughputInfo of variable groupInfo
    • Make classes org.apache.jmeter.gui.JMeterGUIComponent and org.apache.jmeter.timers.ConstantThroughputTimer.ThroughputInfo extend a common superclass
    20
    threadGroupsInfoMap.put(group, groupInfo);
    Precondition Violations (8)
    Row Violation
    1Unmatched statement comp=(TestBeanGUI)testBeanGUIs.get(testClass); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Unmatched statement groupInfo=(ThroughputInfo)threadGroupsInfoMap.get(group); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3Type org.apache.jmeter.gui.JMeterGUIComponent of variable comp does not match with type org.apache.jmeter.timers.ConstantThroughputTimer.ThroughputInfo of variable groupInfo
    4Unmatched statement comp=new TestBeanGUI(testClass); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5Unmatched statement groupInfo=new ThroughputInfo(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6Type java.lang.Class of variable testClass does not match with type org.apache.jmeter.threads.ThreadGroup of variable group
    7Type org.apache.jmeter.gui.JMeterGUIComponent of variable comp does not match with type org.apache.jmeter.timers.ConstantThroughputTimer.ThroughputInfo of variable groupInfo
    8The refactoring of the clones is infeasible, because classes org.apache.jmeter.gui.GuiPackage and org.apache.jmeter.timers.ConstantThroughputTimer do not have a common superclass