if (noLegendYet) { gbc.gridx = 0; gbc.gridy = compCount++; gbc.anchor = GridBagConstraints.WEST; gbc.weightx = 1.0; gbc.insets = new Insets(0, 10, 0, 0); JLabel totalTimeLabel = new JLabel("Total time - " + oneSample.toString()); totalTimeLabel.setForeground(currColor); gridBag.setConstraints(totalTimeLabel, gbc); legendPanel.add(totalTimeLabel); }
if (noLegendYet) { gbc.gridx = 0; gbc.gridy = compCount++; gbc.anchor = GridBagConstraints.WEST; gbc.weightx = 1.0; gbc.insets = new Insets(0, 10, 0, 0); JLabel compTimeLabel = new JLabel(componentRes.getSampleLabel()); compTimeLabel.setForeground(currColor); gridBag.setConstraints(compTimeLabel, gbc); legendPanel.add(compTimeLabel); }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/visualizers/GraphAccum.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/visualizers/GraphAccum.java
Method name: void drawSample(int, SampleResult, Graphics) Method name: void drawSample(int, SampleResult, Graphics)
Number of AST nodes: 10 Number of AST nodes: 10
1
if (noLegendYet) {
1
if (noLegendYet) {
2
			gbc.gridx = 0;
2
					gbc.gridx = 0;
3
			gbc.gridy = compCount++;
3
					gbc.gridy = compCount++;
4
			gbc.anchor = GridBagConstraints.WEST;
4
					gbc.anchor = GridBagConstraints.WEST;
5
			gbc.weightx = 1.0;
5
					gbc.weightx = 1.0;
6
			gbc.insets = new Insets(0, 10, 0, 0);
6
					gbc.insets = new Insets(0, 10, 0, 0);
7
			JLabel totalTimeLabel = new JLabel("Total time - " + oneSample.toString());
7
					JLabel compTimeLabel = new JLabel(componentRes.getSampleLabel());
8
			totalTimeLabel.setForeground(currColor);
8
					compTimeLabel.setForeground(currColor);
9
			gridBag.setConstraints(totalTimeLabel, gbc);
9
					gridBag.setConstraints(compTimeLabel, gbc);
10
			legendPanel.add(totalTimeLabel);
10
					legendPanel.add(compTimeLabel);
11
		}
11
				}
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 the same method
Number of node comparisons100
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment4
    Number of unmapped statements in the second code fragment4
    Time elapsed for statement mapping (ms)21.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    26
    if (noLegendYet)
    70
    if (noLegendYet)
    27
    gbc.gridx = 0;
    27
    gbc.gridx = 0;
    Preondition Violations
    Unmatched statement gbc.gridx=0; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                    
    28
    gbc.gridy = compCount++;
    28
    gbc.gridy = compCount++;
    Preondition Violations
    Unmatched statement gbc.gridy=compCount++; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                        
    29
    gbc.anchor = GridBagConstraints.WEST;
    29
    gbc.anchor = GridBagConstraints.WEST;
    Preondition Violations
    Unmatched statement gbc.anchor=GridBagConstraints.WEST; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                  
    30
    gbc.weightx = 1.0;
    30
    gbc.weightx = 1.0;
    Preondition Violations
    Unmatched statement gbc.weightx=1.0; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                            
                                    
    71
    gbc.gridx = 0;
    Preondition Violations
    Unmatched statement gbc.gridx=0; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    71
    gbc.gridx = 0;
                                                        
    72
    gbc.gridy = compCount++;
    Preondition Violations
    Unmatched statement gbc.gridy=compCount++; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    72
    gbc.gridy = compCount++;
                                                                                  
    73
    gbc.anchor = GridBagConstraints.WEST;
    Preondition Violations
    Unmatched statement gbc.anchor=GridBagConstraints.WEST; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    73
    gbc.anchor = GridBagConstraints.WEST;
                                            
    74
    gbc.weightx = 1.0;
    Preondition Violations
    Unmatched statement gbc.weightx=1.0; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    74
    gbc.weightx = 1.0;
    31
    gbc.insets = new Insets(0, 10, 0, 0);
    75
    gbc.insets = new Insets(0, 10, 0, 0);
    32
    JLabel totalTimeLabel = new JLabel("Total time - " + oneSample.toString());
    32
    JLabel totalTimeLabel = new JLabel("Total time - " + oneSample.toString());
    76
    JLabel compTimeLabel = new JLabel(componentRes.getSampleLabel());
    Differences
    Expression1Expression2Difference
    totalTimeLabelcompTimeLabelVARIABLE_NAME_MISMATCH
    "Total time - " + oneSample.toString()componentRes.getSampleLabel()TYPE_COMPATIBLE_REPLACEMENT
    76
    JLabel compTimeLabel = new JLabel(componentRes.getSampleLabel());
    33
    totalTimeLabel.setForeground(currColor);
    33
    totalTimeLabel.setForeground(currColor);
    77
    compTimeLabel.setForeground(currColor);
    Differences
    Expression1Expression2Difference
    totalTimeLabelcompTimeLabelVARIABLE_NAME_MISMATCH
    77
    compTimeLabel.setForeground(currColor);
    34
    gridBag.setConstraints(totalTimeLabel, gbc);
    34
    gridBag.setConstraints(totalTimeLabel, gbc);
    78
    gridBag.setConstraints(compTimeLabel, gbc);
    Differences
    Expression1Expression2Difference
    totalTimeLabelcompTimeLabelVARIABLE_NAME_MISMATCH
    78
    gridBag.setConstraints(compTimeLabel, gbc);
    35
    legendPanel.add(totalTimeLabel);
    35
    legendPanel.add(totalTimeLabel);
    79
    legendPanel.add(compTimeLabel);
    Differences
    Expression1Expression2Difference
    totalTimeLabelcompTimeLabelVARIABLE_NAME_MISMATCH
    79
    legendPanel.add(compTimeLabel);
    Precondition Violations (8)
    Row Violation
    1Unmatched statement gbc.gridx=0; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Unmatched statement gbc.gridy=compCount++; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3Unmatched statement gbc.anchor=GridBagConstraints.WEST; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4Unmatched statement gbc.weightx=1.0; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    5Unmatched statement gbc.gridx=0; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    6Unmatched statement gbc.gridy=compCount++; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    7Unmatched statement gbc.anchor=GridBagConstraints.WEST; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    8Unmatched statement gbc.weightx=1.0; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted