if (calendar == null) { JOptionPane.showMessageDialog(FrameManager.getInstance() .getActiveFrame(), "No calendar for export selected."); return; } JFileChooser fc = new JFileChooser(); fc.setMultiSelectionEnabled(false); fc.setFileSelectionMode(JFileChooser.FILES_ONLY); fc.setFileHidingEnabled(false);
if (id == null) { JOptionPane .showMessageDialog(FrameManager.getInstance() .getActiveFrame(), "No event for export selected."); return; } JFileChooser fc = new JFileChooser(); fc.setMultiSelectionEnabled(false); fc.setFileSelectionMode(JFileChooser.FILES_ONLY); fc.setFileHidingEnabled(false);
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/calendar/src/main/java/org/columba/calendar/ui/action/ExportCalendarAction.java File path: /columba-1.4-src/calendar/src/main/java/org/columba/calendar/ui/action/SaveAsAction.java
Method name: void actionPerformed(ActionEvent) Method name: void actionPerformed(ActionEvent)
Number of AST nodes: 7 Number of AST nodes: 7
1
if (calendar == null) {
1
if (id == null) {
2
			JOptionPane
2
			JOptionPane
3
.showMessageDialog(FrameManager.getInstance()
3
					.showMessageDialog(FrameManager.getInstance()
4
					.getActiveFrame(),
4
							.getActiveFrame(),
5
					"No calendar for export selected.");
5
 "No event for export selected.");
6
			return;
6
			return;
7
		}
7
		}
8
		JFileChooser fc = new JFileChooser();
8
		JFileChooser fc = new JFileChooser();
9
		fc.setMultiSelectionEnabled(false);
9
		fc.setMultiSelectionEnabled(false);
10
		fc.setFileSelectionMode(JFileChooser.FILES_ONLY);
10
		fc.setFileSelectionMode(JFileChooser.FILES_ONLY);
11
		fc.setFileHidingEnabled(false);
11
		fc.setFileHidingEnabled(false);
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.1
Clones locationClones are in different classes having the same super class
Number of node comparisons25
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements7
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    4
    if (calendar == null)
    4
    if (calendar == null)
    5
    if (id == null)
    Differences
    Expression1Expression2Difference
    calendaridVARIABLE_NAME_MISMATCH
    org.columba.calendar.base.api.ICalendarItemjava.lang.StringVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.columba.calendar.base.api.ICalendarItem of variable calendar does not match with type java.lang.String of variable id
    • Make classes org.columba.calendar.base.api.ICalendarItem and java.lang.String extend a common superclass
    5
    if (id == null)
    5
    JOptionPane.showMessageDialog(FrameManager.getInstance().getActiveFrame(), "No calendar for export selected.");
    5
    JOptionPane.showMessageDialog(FrameManager.getInstance().getActiveFrame(), "No calendar for export selected.");
    6
    JOptionPane.showMessageDialog(FrameManager.getInstance().getActiveFrame(), "No event for export selected.");
    Differences
    Expression1Expression2Difference
    "No calendar for export selected.""No event for export selected."LITERAL_VALUE_MISMATCH
    6
    JOptionPane.showMessageDialog(FrameManager.getInstance().getActiveFrame(), "No event for export selected.");
    6
    return;
    6
    return;
    7
    return;
    Preondition Violations
    Conditional return;
    Conditional return;
    7
    return;
    7
    JFileChooser fc = new JFileChooser();
    8
    JFileChooser fc = new JFileChooser();
    8
    fc.setMultiSelectionEnabled(false);
    9
    fc.setMultiSelectionEnabled(false);
    9
    fc.setFileSelectionMode(JFileChooser.FILES_ONLY);
    10
    fc.setFileSelectionMode(JFileChooser.FILES_ONLY);
    10
    fc.setFileHidingEnabled(false);
    11
    fc.setFileHidingEnabled(false);
    Precondition Violations (3)
    Row Violation
    1Type org.columba.calendar.base.api.ICalendarItem of variable calendar does not match with type java.lang.String of variable id
    2Conditional return;
    3Conditional return;