XmlElement column = columns.getElement(i); IDefaultItem columnItem = new DefaultItem(column); String name = columnItem.get("name"); int size = columnItem.getInteger("width"); //int position= columnItem.getInteger("position"); // add column to table model tableController.getHeaderTableModel().addColumn(name); // add column to JTable column model TableColumn tc = tableController.createTableColumn(name, size); //tc.setModelIndex(position); tc.setModelIndex(i); // resize column width tc.setPreferredWidth(size); tableController.addColumn(tc);
String input = FolderTstHelper.getString(0); System.out.println("input=" + input); // create stream from string ByteArrayInputStream inputStream = FolderTstHelper .getByteArrayInputStream(input); // add stream to folder Object uid = getSourceFolder().addMessage(inputStream); // get inputstream of this message from folder InputStream outputStream = sourceFolder.getMessageSourceStream(uid); // create string from inputstream String output = FolderTstHelper.getStringFromInputStream(outputStream); // compare both messages assertEquals("message source should be equal", input, output); outputStream.close();
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/folderoptions/ColumnOptionsPlugin.java File path: /columba-1.4-src/mail/src/test/java/org/columba/mail/folder/GetMessageSourceStreamTest.java
Method name: void loadOptionsFromXml(IMailbox) Method name: void test()
Number of AST nodes: 9 Number of AST nodes: 8
1
XmlElement column = columns.getElement(i);
1
String input = Fol
2
			IDefaultItem columnItem = new DefaultItem(column);
3
			String name = columnItem.get("name");
4
			int size
2
derTstHelper.getString(0);
3
        System.out.println("input=" + input);
4
        // create stream from string
5
 = columnItem.getInteger("width");
5
        ByteArrayInputStream inputStream = Fol
6
			//int position= columnItem.getInteger("position");
7
			
6
derTstHelper
7
                .getByteArrayInputStream(input);
8
// add column to table model
8
        // add 
9
			tableController.getHeaderTableMo
9
stream to folder
10
del().addColumn(name);
10
        Object uid = getSourceFolder().addMessage(inputStream);
11
			// add column to JTable column model
12
			TableColumn tc = tableContr
11
        // get inputstream of this message from folder
13
oller.createTableColumn(name, size);
12
        InputStream outputStream = sourceFolder.
14
			//tc.setModelIndex(position);
15
			tc.setModelIndex(i);
16
			// resize column width
17
			tc.setPreferredWidth(size);
18
			tableController.addColumn(tc
13
getMessageSourceStream(uid);
14
        // create string from inputstream
15
        String output = FolderTstHelper.getStringFromInputStream(outputStream);
16
        // compare both messages
17
        assertEquals("message source should be equal", input, output);
19
);
18
        outputStream.close();
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 comparisons72
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment8
    Number of unmapped statements in the second code fragment7
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
                                                                                    
    2
    System.out.println("input=" + input);
    Preondition Violations
    Unmatched statement System.out.println("input=" + input); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2
    System.out.println("input=" + input);
                                                                                                                                                                          
    3
    ByteArrayInputStream inputStream = FolderTstHelper.getByteArrayInputStream(input);
    Preondition Violations
    Unmatched statement ByteArrayInputStream inputStream=FolderTstHelper.getByteArrayInputStream(input); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3
    ByteArrayInputStream inputStream = FolderTstHelper.getByteArrayInputStream(input);
                                                                                                                    
    4
    Object uid = getSourceFolder().addMessage(inputStream);
                                                                                                                                              
    5
    InputStream outputStream = sourceFolder.getMessageSourceStream(uid);
    5
    XmlElement column = columns.getElement(i);
                                                                                          
                                                                                                                                                    
    6
    String output = FolderTstHelper.getStringFromInputStream(outputStream);
    6
    IDefaultItem columnItem = new DefaultItem(column);
    6
    IDefaultItem columnItem = new DefaultItem(column);
    Preondition Violations
    Unmatched statement IDefaultItem columnItem=new DefaultItem(column); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                          
    7
    String name = columnItem.get("name");
    7
    String name = columnItem.get("name");
    1
    String input = FolderTstHelper.getString(0);
    Differences
    Expression1Expression2Difference
    nameinputVARIABLE_NAME_MISMATCH
    columnItem.get("name")FolderTstHelper.getString(0)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression columnItem.get("name") cannot be parameterized, because it has dependencies to/from statements that will be extracted
    1
    String input = FolderTstHelper.getString(0);
                                                                                                                                  
    7
    assertEquals("message source should be equal", input, output);
    Preondition Violations
    Unmatched statement assertEquals("message source should be equal",input,output); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    7
    assertEquals("message source should be equal", input, output);
                                                    
    8
    outputStream.close();
    8
    int size = columnItem.getInteger("width");
                                                                                          
    9
    tableController.getHeaderTableModel().addColumn(name);
    9
    tableController.getHeaderTableModel().addColumn(name);
    Preondition Violations
    Unmatched statement tableController.getHeaderTableModel().addColumn(name); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                      
    10
    TableColumn tc = tableController.createTableColumn(name, size);
    10
    TableColumn tc = tableController.createTableColumn(name, size);
    Preondition Violations
    Unmatched statement TableColumn tc=tableController.createTableColumn(name,size); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                                    
    11
    tc.setModelIndex(i);
    11
    tc.setModelIndex(i);
    Preondition Violations
    Unmatched statement tc.setModelIndex(i); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                    
    12
    tc.setPreferredWidth(size);
    12
    tc.setPreferredWidth(size);
    Preondition Violations
    Unmatched statement tc.setPreferredWidth(size); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                  
    13
    tableController.addColumn(tc);
                                                                        
    Precondition Violations (10)
    Row Violation
    1Unmatched statement System.out.println("input=" + input); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement ByteArrayInputStream inputStream=FolderTstHelper.getByteArrayInputStream(input); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched statement IDefaultItem columnItem=new DefaultItem(column); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Expression columnItem.get("name") cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Unmatched statement assertEquals("message source should be equal",input,output); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6Unmatched statement tableController.getHeaderTableModel().addColumn(name); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    7Unmatched statement TableColumn tc=tableController.createTableColumn(name,size); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    8Unmatched statement tc.setModelIndex(i); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    9Unmatched statement tc.setPreferredWidth(size); 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.folderoptions.ColumnOptionsPlugin and org.columba.mail.folder.GetMessageSourceStreamTest do not have a common superclass