ToolBarOptionPane.Button button = (ToolBarOptionPane.Button)list .getSelectedValue(); label = button.label; actionName = button.actionName;
ToolBarOptionPane.IconListEntry selectedIcon = (ToolBarOptionPane.IconListEntry) builtinCombo.getSelectedItem(); icon = selectedIcon.icon; iconName = selectedIcon.name;
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/options/ToolBarOptionPane.java File path: /jEdit-4.2/src/org/gjt/sp/jedit/options/ToolBarOptionPane.java
Method name: ToolBarOptionPane.Button getSelection() Method name: ToolBarOptionPane.Button getSelection()
Number of AST nodes: 3 Number of AST nodes: 3
1
ToolBarOptionPane.Button button =
1
ToolBarOptionPane.IconListEntry selectedIcon =
2
					(ToolBarOptionPane.Button)list
2
					(ToolBarOptionPane.
3
					
3
IconListEntry)
4
.getSelectedValue();
4
					builtinCombo.getSelectedItem();
5
				label = button.label;
5
				icon = selectedIcon.icon;
6
				actionName = button.actionName;
6
				iconName = selectedIcon.name;
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.0
Clones locationClones are in the same method
Number of node comparisons9
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                                                                                                                                                                                    
    8
    ToolBarOptionPane.IconListEntry selectedIcon = (ToolBarOptionPane.IconListEntry)builtinCombo.getSelectedItem();
                                                        
    9
    icon = selectedIcon.icon;
    18
    ToolBarOptionPane.Button button = (ToolBarOptionPane.Button)list.getSelectedValue();
                                                                                                                                                                                
    19
    label = button.label;
    19
    label = button.label;
    10
    iconName = selectedIcon.name;
    Differences
    Expression1Expression2Difference
    labeliconNameVARIABLE_NAME_MISMATCH
    buttonselectedIconVARIABLE_NAME_MISMATCH
    org.gjt.sp.jedit.options.ToolBarOptionPane.Buttonorg.gjt.sp.jedit.options.ToolBarOptionPane.IconListEntryVARIABLE_TYPE_MISMATCH
    labelnameVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type org.gjt.sp.jedit.options.ToolBarOptionPane.Button of variable button does not match with type org.gjt.sp.jedit.options.ToolBarOptionPane.IconListEntry of variable selectedIcon
    • Make classes org.gjt.sp.jedit.options.ToolBarOptionPane.Button and org.gjt.sp.jedit.options.ToolBarOptionPane.IconListEntry extend a common superclass
    10
    iconName = selectedIcon.name;
    20
    actionName = button.actionName;
                                                                      
    Precondition Violations (1)
    Row Violation
    1Type org.gjt.sp.jedit.options.ToolBarOptionPane.Button of variable button does not match with type org.gjt.sp.jedit.options.ToolBarOptionPane.IconListEntry of variable selectedIcon