if (menuElement.getName().equals(MenuXMLDecoder.MENU)) { String menuId = menuElement .getAttributeValue(MenuXMLDecoder.ID); String menuName = mediator.getString("menu", "mainframe", menuId); ExtendableMenu menu = new ExtendableMenu(menuId, menuName); parseMenu(menu, menuElement); menuBar.add(menu); }
TableColumn tc = (TableColumn) enumeration.nextElement(); String name = (String) tc.getHeaderValue(); XmlElement column = new XmlElement("column"); column.addAttribute("name", name); // save width int size = tc.getWidth(); column.addAttribute("width", Integer.toString(size)); columns.addElement(column);
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/menu/MenuXMLDecoder.java File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/folderoptions/ColumnOptionsPlugin.java
Method name: ExtendableMenuBar createMenuBar(InputStream) Method name: void saveOptionsToXml(IMailbox)
Number of AST nodes: 6 Number of AST nodes: 7
1
if (menuElement.getName().equals(MenuXMLDecoder.MENU)) {
1
TableColumn tc = (TableColumn) enumeration.nextElement();
2
				String menuId = menuElement
2
			String 
3
						.getAttributeValue(MenuXMLDecoder.ID);
4
				String menuName = mediator.getString("menu", "mainframe",
5
						menuId);
6
				ExtendableMenu menu = new ExtendableMenu(menuId, menuName);
7
				parseMenu(menu, menuElement
3
name = (String) tc.getHeaderValue();
4
			XmlElement column = new XmlElement("column");
5
			column.addAttribute("name", name);
6
			// save width
7
			int size = tc.getWidth();
8
);
8
			column.addAttribute("width", Integer.toString(size));
9
				menuBar.add(menu);
9
			
10
			}
10
columns.addElement(column);
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
Number of node comparisons36
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment4
    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
                                                                                                                      
    8
    TableColumn tc = (TableColumn)enumeration.nextElement();
    Preondition Violations
    Unmatched statement TableColumn tc=(TableColumn)enumeration.nextElement(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    8
    TableColumn tc = (TableColumn)enumeration.nextElement();
    11
    String menuId = menuElement.getAttributeValue(MenuXMLDecoder.ID);
    11
    String menuId = menuElement.getAttributeValue(MenuXMLDecoder.ID);
    9
    String name = (String)tc.getHeaderValue();
    Differences
    Expression1Expression2Difference
    menuIdnameVARIABLE_NAME_MISMATCH
    menuElement.getAttributeValue(MenuXMLDecoder.ID)(String)tc.getHeaderValue()TYPE_COMPATIBLE_REPLACEMENT
    9
    String name = (String)tc.getHeaderValue();
                                                                                                  
    10
    XmlElement column = new XmlElement("column");
                                                                              
    11
    column.addAttribute("name", name);
    Preondition Violations
    Unmatched statement column.addAttribute("name",name); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    11
    column.addAttribute("name", name);
                                                          
    12
    int size = tc.getWidth();
    12
    String menuName = mediator.getString("menu", "mainframe", menuId);
    12
    String menuName = mediator.getString("menu", "mainframe", menuId);
    Preondition Violations
    Unmatched statement String menuName=mediator.getString("menu","mainframe",menuId); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                                        
                                                                                                                    
    13
    column.addAttribute("width", Integer.toString(size));
    13
    ExtendableMenu menu = new ExtendableMenu(menuId, menuName);
    13
    ExtendableMenu menu = new ExtendableMenu(menuId, menuName);
    Preondition Violations
    Unmatched statement ExtendableMenu menu=new ExtendableMenu(menuId,menuName); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                            
                                                                  
    14
    columns.addElement(column);
    14
    parseMenu(menu, menuElement);
                                                                    
    15
    menuBar.add(menu);
                                                
    Precondition Violations (4)
    Row Violation
    1Unmatched statement TableColumn tc=(TableColumn)enumeration.nextElement(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement column.addAttribute("name",name); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched statement String menuName=mediator.getString("menu","mainframe",menuId); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched statement ExtendableMenu menu=new ExtendableMenu(menuId,menuName); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted