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;
                                                  
    20
    actionName = button.actionName;
    20
    actionName = button.actionName;
    10
    iconName = selectedIcon.name;
    Differences
    Expression1Expression2Difference
    actionNameiconNameVARIABLE_NAME_MISMATCH
    buttonselectedIconVARIABLE_NAME_MISMATCH
    org.gjt.sp.jedit.options.ToolBarOptionPane.Buttonorg.gjt.sp.jedit.options.ToolBarOptionPane.IconListEntryVARIABLE_TYPE_MISMATCH
    actionNamenameVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression button.actionName cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression selectedIcon.name cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.lang.String of variable button.actionName does not match with type java.lang.String of variable selectedIcon.name
    • Make classes org.gjt.sp.jedit.options.ToolBarOptionPane.Button and org.gjt.sp.jedit.options.ToolBarOptionPane.IconListEntry extend a common superclass
    Expression button.actionName cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression selectedIcon.name cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10
    iconName = selectedIcon.name;
    Precondition Violations (5)
    Row Violation
    1Expression button.actionName cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression selectedIcon.name cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Type java.lang.String of variable button.actionName does not match with type java.lang.String of variable selectedIcon.name
    4Expression button.actionName cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression selectedIcon.name cannot be parameterized, because it has dependencies to/from statements that will be extracted