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 statements2
    Number of unmapped statements in the first code fragment4
    Number of unmapped statements in the second code fragment5
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    2
    IMailFolder child = (IMailFolder)parent.getChildAt(i);
    2
    IMailFolder child = (IMailFolder)parent.getChildAt(i);
    Preondition Violations
    Unmatched statement IMailFolder child=(IMailFolder)parent.getChildAt(i); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                  
    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);
                                            
                                                                      
    14
    String item = (String)items[i];
    Preondition Violations
    Unmatched statement String item=(String)items[i]; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    14
    String item = (String)items[i];
                                                                                                                                                        
    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);
                                                                                          
    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);
    17
    headerMenuItem.setActionCommand(item);
    Differences
    Expression1Expression2Difference
    createChildNodessetActionCommandMETHOD_INVOCATION_NAME_MISMATCH
    createChildNodes(c,child)headerMenuItem.setActionCommand(item)ARGUMENT_NUMBER_MISMATCH
    headerMenuItemMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression createChildNodes(c,child) is a void method call, and thus it cannot be parameterized
    Expression headerMenuItem.setActionCommand(item) is a void method call, and thus it cannot be parameterized
    Expression createChildNodes(c,child) is a void method call, and thus it cannot be parameterized
    Expression headerMenuItem.setActionCommand(item) is a void method call, and thus it cannot be parameterized
    17
    headerMenuItem.setActionCommand(item);
                                                    
    20
    add(headerMenuItem);
    Precondition Violations (10)
    Row Violation
    1Unmatched statement IMailFolder child=(IMailFolder)parent.getChildAt(i); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched 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
    3Unmatched statement String item=(String)items[i]; cannot be moved before or after the extracted code, because it has dependencies to/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
    5Type org.columba.mail.gui.config.export.CheckableTreeNode of variable c does not match with type javax.swing.JRadioButtonMenuItem of variable headerMenuItem
    6Type org.columba.mail.gui.config.export.CheckableTreeNode of variable root does not match with type javax.swing.ButtonGroup of variable columnGroup
    7Expression createChildNodes(c,child) is a void method call, and thus it cannot be parameterized
    8Expression headerMenuItem.setActionCommand(item) is a void method call, and thus it cannot be parameterized
    9Expression createChildNodes(c,child) is a void method call, and thus it cannot be parameterized
    10Expression headerMenuItem.setActionCommand(item) is a void method call, and thus it cannot be parameterized