File destFile = fc.getSelectedFile(); ICalendarStore store = CalendarStoreFactory.getInstance() .getLocaleStore(); Command command = new SaveEventToFileCommand( new CalendarCommandReference(store, activity), destFile); CommandProcessor.getInstance().addOp(command);
File file = DefaultConfigDirectory.getInstance().getCurrentPath(); File logDirectory = new File(file, "log"); File logFile = new File(logDirectory, "columba.log"); ColumbaDesktop.getInstance().open(logFile);
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/calendar/src/main/java/org/columba/calendar/ui/action/SaveAsAction.java File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/globalactions/ViewLogAction.java
Method name: void actionPerformed(ActionEvent) Method name: void actionPerformed(ActionEvent)
Number of AST nodes: 4 Number of AST nodes: 4
1
File destFile = fc.getSelectedFile();
1
File file = 
2
			ICalendarStore store = CalendarStoreFactory.getInstance()
3
					.getLocaleStore();
2
DefaultConfigDirectory.getInstance().getCurrentPath();
4
			Command command = new SaveEventToFileCommand(
3
		
5
					new CalendarCommandReference(s
4
File logDirectory = new File(file, "log");
6
tore, activity), destFile);
5
		File logFile = new File(logDirectory, "columba.log");
7
			CommandProcessor.getInstance().addOp(command);
6
		ColumbaDesktop.getInstance().open(logFile);
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 comparisons16
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                                                                                          
    1
    File file = DefaultConfigDirectory.getInstance().getCurrentPath();
    13
    File destFile = fc.getSelectedFile();
    13
    File destFile = fc.getSelectedFile();
    2
    File logDirectory = new File(file, "log");
    Differences
    Expression1Expression2Difference
    destFilelogDirectoryVARIABLE_NAME_MISMATCH
    fc.getSelectedFile()new File(file,"log")TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression new File(file,"log") cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2
    File logDirectory = new File(file, "log");
                                                                                                              
    3
    File logFile = new File(logDirectory, "columba.log");
    Preondition Violations
    Unmatched statement File logFile=new File(logDirectory,"columba.log"); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3
    File logFile = new File(logDirectory, "columba.log");
                                                                                                
    4
    ColumbaDesktop.getInstance().open(logFile);
    14
    ICalendarStore store = CalendarStoreFactory.getInstance().getLocaleStore();
                                                                                                                                                              
    15
    Command command = new SaveEventToFileCommand(new CalendarCommandReference(store, activity), destFile);
    15
    Command command = new SaveEventToFileCommand(new CalendarCommandReference(store, activity), destFile);
    Preondition Violations
    Unmatched statement Command command=new SaveEventToFileCommand(new CalendarCommandReference(store,activity),destFile); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                                                                                                                
    16
    CommandProcessor.getInstance().addOp(command);
                                                                                                        
    Precondition Violations (3)
    Row Violation
    1Expression new File(file,"log") cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Unmatched statement File logFile=new File(logDirectory,"columba.log"); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched statement Command command=new SaveEventToFileCommand(new CalendarCommandReference(store,activity),destFile); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted