IMailFolder child = (IMailFolder) parent.getChildAt(i); CheckableTreeNode c = new CheckableTreeNode(child.getName()); c.setIcon(FolderTreeCellRenderer.getFolderIcon(child, false)); c.setNode(child); root.add(c); createChildNodes(c, child);
String item = (String) items[i]; // all headerfields are lowercase in property file String i18n = MailResourceLoader.getString("header", item .toLowerCase()); headerMenuItem = new JRadioButtonMenuItem(i18n); headerMenuItem.setActionCommand(item); headerMenuItem.addActionListener(this); columnGroup.add(headerMenuItem); add(headerMenuItem);
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/config/export/ExportDialog.java File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/table/action/SortMessagesMenu.java
Method name: void createChildNodes(CheckableTreeNode, IMailFolder) Method name: void createSubMenu()
Number of AST nodes: 6 Number of AST nodes: 7
1
IMailFolder child = (IMailFolder) parent.getChildAt(i);
2
			CheckableTreeNode c = new CheckableTreeNode(child.getNam
1
String item = (String) items[i];
2
			// all headerfields are lowercase in property file
3
			String i18n = MailResourceLoader.getString("header", item
3
e());
4
					.toLowerCase());
4
			c.setIcon(FolderTreeCellRenderer.getFolderIcon(child, false));
5
			
5
			c.setNode(child);
6
			root.add(c
6
headerMenuItem = new JRadioButtonMenuItem(i18n);
7
			headerMenuItem.setActionCommand(item);
8
			headerMenuItem.addActionListener(this);
7
);
9
			columnGroup.add(headerMenuItem);
8
			createChildNodes(c, child);
10
			add(headerMenuItem);
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 different classes having the same super class
Number of node comparisons43
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment5
    Number of unmapped statements in the second code fragment6
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    2
    IMailFolder child = (IMailFolder)parent.getChildAt(i);
                                                                                                                  
    3
    CheckableTreeNode c = new CheckableTreeNode(child.getName());
    3
    CheckableTreeNode c = new CheckableTreeNode(child.getName());
    Preondition Violations
    Unmatched statement CheckableTreeNode c=new CheckableTreeNode(child.getName()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                                
    4
    c.setIcon(FolderTreeCellRenderer.getFolderIcon(child, false));
                                                                                                                                    
    5
    c.setNode(child);
    5
    c.setNode(child);
    Preondition Violations
    Unmatched statement c.setNode(child); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                            
                                                                      
    14
    String item = (String)items[i];
                                                                                                                                                        
    15
    String i18n = MailResourceLoader.getString("header", item.toLowerCase());
    Preondition Violations
    Unmatched statement String i18n=MailResourceLoader.getString("header",item.toLowerCase()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    15
    String i18n = MailResourceLoader.getString("header", item.toLowerCase());
                                                                                                        
    16
    headerMenuItem = new JRadioButtonMenuItem(i18n);
    Preondition Violations
    Unmatched statement headerMenuItem=new JRadioButtonMenuItem(i18n); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    16
    headerMenuItem = new JRadioButtonMenuItem(i18n);
                                                                                        
    17
    headerMenuItem.setActionCommand(item);
                                                                                          
    18
    headerMenuItem.addActionListener(this);
    Preondition Violations
    Unmatched statement headerMenuItem.addActionListener(this); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    18
    headerMenuItem.addActionListener(this);
    6
    root.add(c);
    6
    root.add(c);
    19
    columnGroup.add(headerMenuItem);
    Differences
    Expression1Expression2Difference
    cheaderMenuItemVARIABLE_NAME_MISMATCH
    org.columba.mail.gui.config.export.CheckableTreeNodejavax.swing.JRadioButtonMenuItemVARIABLE_TYPE_MISMATCH
    rootcolumnGroupVARIABLE_NAME_MISMATCH
    org.columba.mail.gui.config.export.CheckableTreeNodejavax.swing.ButtonGroupVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.columba.mail.gui.config.export.CheckableTreeNode of variable c does not match with type javax.swing.JRadioButtonMenuItem of variable headerMenuItem
    • Make classes org.columba.mail.gui.config.export.CheckableTreeNode and javax.swing.JRadioButtonMenuItem extend a common superclass
    Type org.columba.mail.gui.config.export.CheckableTreeNode of variable root does not match with type javax.swing.ButtonGroup of variable columnGroup
    • Make classes org.columba.mail.gui.config.export.CheckableTreeNode and javax.swing.ButtonGroup extend a common superclass
    19
    columnGroup.add(headerMenuItem);
    7
    createChildNodes(c, child);
    7
    createChildNodes(c, child);
    Preondition Violations
    Unmatched statement createChildNodes(c,child); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                              
                                                    
    20
    add(headerMenuItem);
    Preondition Violations
    Unmatched statement add(headerMenuItem); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    20
    add(headerMenuItem);
    Precondition Violations (10)
    Row Violation
    1Unmatched statement CheckableTreeNode c=new CheckableTreeNode(child.getName()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement c.setNode(child); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3Unmatched statement String i18n=MailResourceLoader.getString("header",item.toLowerCase()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4Unmatched statement headerMenuItem=new JRadioButtonMenuItem(i18n); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5Unmatched statement headerMenuItem.addActionListener(this); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    6Type org.columba.mail.gui.config.export.CheckableTreeNode of variable c does not match with type javax.swing.JRadioButtonMenuItem of variable headerMenuItem
    7Type org.columba.mail.gui.config.export.CheckableTreeNode of variable root does not match with type javax.swing.ButtonGroup of variable columnGroup
    8Unmatched statement createChildNodes(c,child); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    9Unmatched statement add(headerMenuItem); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    10The refactoring of the clones is infeasible, because classes org.columba.mail.gui.config.export.ExportDialog and org.columba.mail.gui.table.action.SortMessagesMenu do not have a common superclass