homepageButton = new JButton(ImageLoader .getSmallIcon(IconKeys.INTERNET)); homepageButton.setMargin(new Insets(0, 0, 0, 0)); homepageButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { String s = homepageTextField.getText(); try { URL url = new URL(s); ColumbaDesktop.getInstance().browse(url); } catch (MalformedURLException e1) { e1.printStackTrace(); } } });
freebusyButton = new JButton(ImageLoader .getSmallIcon(IconKeys.INTERNET)); freebusyButton.setMargin(new Insets(0, 0, 0, 0)); freebusyButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { String s = freebusyTextField.getText(); try { URL url = new URL(s); ColumbaDesktop.getInstance().browse(url); } catch (MalformedURLException e1) { e1.printStackTrace(); } } });
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/contact/src/main/java/org/columba/addressbook/gui/dialog/contact/ContactEditorDialog.java File path: /columba-1.4-src/contact/src/main/java/org/columba/addressbook/gui/dialog/contact/ContactEditorDialog.java
Method name: void initComponents() Method name: void initComponents()
Number of AST nodes: 3 Number of AST nodes: 3
1
homepageButton = new JButton(ImageLoader
1
freebusyButton = new JButton(ImageLoader
2
				.getSmallIcon(IconKeys.INTERNET));
2
				.getSmallIcon(IconKeys.INTERNET));
3
		homepageButton.setMargin(new Insets(0, 0, 0, 0));
3
		freebusyButton.setMargin(new Insets(0, 0, 0, 0));
4
		homepageButton.addActionListener(new ActionListener() {
4
		freebusyButton.addActionListener(new ActionListener() {
5
			public void actionPerformed(ActionEvent e) {
5
			public void actionPerformed(ActionEvent e) {
6
				String s = homepageTextField.getText();
6
				String s = freebusyTextField.getText();
7
				try {
7
				try {
8
					URL url = new URL(s);
8
					URL url = new URL(s);
9
					ColumbaDesktop.getInstance().browse(url);
9
					ColumbaDesktop.getInstance().browse(url);
10
				} catch (MalformedURLException e1) {
10
				} catch (MalformedURLException e1) {
11
					e1.printStackTrace();
11
					e1.printStackTrace();
12
				}
12
				}
13
			}
13
			}
14
		});
14
		});
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 the same method
Number of node comparisons4
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    60
    homepageButton = new JButton(ImageLoader.getSmallIcon(IconKeys.INTERNET));
    60
    homepageButton = new JButton(ImageLoader.getSmallIcon(IconKeys.INTERNET));
    78
    freebusyButton = new JButton(ImageLoader.getSmallIcon(IconKeys.INTERNET));
    Differences
    Expression1Expression2Difference
    homepageButtonfreebusyButtonVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression homepageButton is a field being modified, and thus it cannot be parameterized
    Expression freebusyButton is a field being modified, and thus it cannot be parameterized
    78
    freebusyButton = new JButton(ImageLoader.getSmallIcon(IconKeys.INTERNET));
    61
    homepageButton.setMargin(new Insets(0, 0, 0, 0));
    61
    homepageButton.setMargin(new Insets(0, 0, 0, 0));
    79
    freebusyButton.setMargin(new Insets(0, 0, 0, 0));
    Differences
    Expression1Expression2Difference
    homepageButtonfreebusyButtonVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression homepageButton cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression freebusyButton cannot be parameterized, because it has dependencies to/from statements that will be extracted
    79
    freebusyButton.setMargin(new Insets(0, 0, 0, 0));
    62
    homepageButton.addActionListener(new ActionListener() {...});
    62
    homepageButton.addActionListener(new ActionListener() {...});
    80
    freebusyButton.addActionListener(new ActionListener() {...});
    Differences
    Expression1Expression2Difference
    homepageTextFieldfreebusyTextFieldVARIABLE_NAME_MISMATCH
    homepageButtonfreebusyButtonVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression homepageButton cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression freebusyButton cannot be parameterized, because it has dependencies to/from statements that will be extracted
    80
    freebusyButton.addActionListener(new ActionListener() {...});
    Precondition Violations (6)
    Row Violation
    1Expression homepageButton is a field being modified, and thus it cannot be parameterized
    2Expression freebusyButton is a field being modified, and thus it cannot be parameterized
    3Expression homepageButton cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression freebusyButton cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression homepageButton cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression freebusyButton cannot be parameterized, because it has dependencies to/from statements that will be extracted