JPanel bottom = new JPanel(); bottom.setLayout(new BorderLayout()); //bottom.setLayout( new BoxLayout( bottom, BoxLayout.X_AXIS ) ); bottom.setBorder(BorderFactory.createEmptyBorder(17, 12, 11, 11)); //bottom.add( Box.createHorizontalStrut()); cancelButton = new ButtonWithMnemonic(MailResourceLoader.getString( "global", "cancel")); //$NON-NLS-1$ //$NON-NLS-2$ cancelButton.addActionListener(this); cancelButton.setActionCommand("CANCEL"); //$NON-NLS-1$ okButton = new ButtonWithMnemonic(MailResourceLoader.getString( "global", "ok")); //$NON-NLS-1$ //$NON-NLS-2$ okButton.addActionListener(this); okButton.setActionCommand("OK"); //$NON-NLS-1$ okButton.setDefaultCapable(true); getRootPane().setDefaultButton(okButton); helpButton = new ButtonWithMnemonic(MailResourceLoader.getString( "global", "help")); //$NON-NLS-1$ //$NON-NLS-2$ JPanel buttonPanel = new JPanel(); buttonPanel.setLayout(new GridLayout(1, 3, 5, 0)); buttonPanel.add(okButton); buttonPanel.add(cancelButton); buttonPanel.add(helpButton); //bottom.add( Box.createHorizontalGlue() ); bottom.add(buttonPanel, BorderLayout.EAST); return bottom;
JPanel bottom = new JPanel(); bottom.setLayout(new BorderLayout()); // bottom.setLayout( new BoxLayout( bottom, BoxLayout.X_AXIS ) ); bottom.setBorder(BorderFactory.createEmptyBorder(17, 12, 11, 11)); // bottom.add( Box.createHorizontalStrut()); cancelButton = new ButtonWithMnemonic(MailResourceLoader.getString( "global", "cancel")); //$NON-NLS-1$ //$NON-NLS-2$ cancelButton.addActionListener(this); cancelButton.setActionCommand("CANCEL"); //$NON-NLS-1$ okButton = new ButtonWithMnemonic(MailResourceLoader.getString( "global", "ok")); //$NON-NLS-1$ //$NON-NLS-2$ okButton.addActionListener(this); okButton.setActionCommand("OK"); //$NON-NLS-1$ okButton.setDefaultCapable(true); dialog.getRootPane().setDefaultButton(okButton); helpButton = new ButtonWithMnemonic(MailResourceLoader.getString( "global", "help")); //$NON-NLS-1$ //$NON-NLS-2$ JPanel buttonPanel = new JPanel(); buttonPanel.setLayout(new GridLayout(1, 3, 5, 0)); buttonPanel.add(okButton); buttonPanel.add(cancelButton); buttonPanel.add(helpButton); // bottom.add( Box.createHorizontalGlue() ); bottom.add(buttonPanel, BorderLayout.EAST); return bottom;
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/util/PasswordDialog.java File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/util/PGPPassphraseDialog.java
Method name: JPanel createButtonPanel() Method name: JPanel createButtonPanel()
Number of AST nodes: 19 Number of AST nodes: 19
1
JPanel bottom = new JPanel();
1
JPanel bottom = new JPanel();
2
		bottom.setLayout(new BorderLayout());
2
		bottom.setLayout(new BorderLayout());
3
		//bottom.setLayout( new BoxLayout( bottom, BoxLayout.X_AXIS ) );
3
		// bottom.setLayout( new BoxLayout( bottom, BoxLayout.X_AXIS ) );
4
		bottom.setBorder(BorderFactory.createEmptyBorder(17, 12, 11, 11));
4
		bottom.setBorder(BorderFactory.createEmptyBorder(17, 12, 11, 11));
5
		//bottom.add( Box.createHorizontalStrut());
5
		// bottom.add( Box.createHorizontalStrut());
6
		cancelButton = new ButtonWithMnemonic(MailResourceLoader.getString(
6
		cancelButton = new ButtonWithMnemonic(MailResourceLoader.getString(
7
				"global", "cancel"));
7
				"global", "cancel"));
8
		//$NON-NLS-1$ //$NON-NLS-2$
8
		//$NON-NLS-1$ //$NON-NLS-2$
9
		cancelButton.addActionListener(this);
9
		cancelButton.addActionListener(this);
10
		cancelButton.setActionCommand("CANCEL"); //$NON-NLS-1$
10
		cancelButton.setActionCommand("CANCEL"); //$NON-NLS-1$
11
		okButton = new ButtonWithMnemonic(MailResourceLoader.getString(
11
		okButton = new ButtonWithMnemonic(MailResourceLoader.getString(
12
				"global", "ok"));
12
				"global", "ok"));
13
		//$NON-NLS-1$ //$NON-NLS-2$
13
		//$NON-NLS-1$ //$NON-NLS-2$
14
		okButton.addActionListener(this);
14
		okButton.addActionListener(this);
15
		okButton.setActionCommand("OK"); //$NON-NLS-1$
15
		okButton.setActionCommand("OK"); //$NON-NLS-1$
16
		okButton.setDefaultCapable(true);
16
		okButton.setDefaultCapable(true);
17
		getRootPane().setDefaultButton(okButton);
17
		dialog.getRootPane().setDefaultButton(okButton);
18
		helpButton = new ButtonWithMnemonic(MailResourceLoader.getString(
18
		helpButton = new ButtonWithMnemonic(MailResourceLoader.getString(
19
				"global", "help"));
19
				"global", "help"));
20
		//$NON-NLS-1$ //$NON-NLS-2$
20
		//$NON-NLS-1$ //$NON-NLS-2$
21
		JPanel buttonPanel = new JPanel();
21
		JPanel buttonPanel = new JPanel();
22
		buttonPanel.setLayout(new GridLayout(1, 3, 5, 0));
22
		buttonPanel.setLayout(new GridLayout(1, 3, 5, 0));
23
		buttonPanel.add(okButton);
23
		buttonPanel.add(okButton);
24
		buttonPanel.add(cancelButton);
24
		buttonPanel.add(cancelButton);
25
		buttonPanel.add(helpButton);
25
		buttonPanel.add(helpButton);
26
		//bottom.add( Box.createHorizontalGlue() );
26
		// bottom.add( Box.createHorizontalGlue() );
27
		bottom.add(buttonPanel, BorderLayout.EAST);
27
		bottom.add(buttonPanel, BorderLayout.EAST);
28
		return bottom;
28
		return bottom;
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 comparisons108
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements19
    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
    1
    JPanel bottom = new JPanel();
    1
    JPanel bottom = new JPanel();
    2
    bottom.setLayout(new BorderLayout());
    2
    bottom.setLayout(new BorderLayout());
    3
    bottom.setBorder(BorderFactory.createEmptyBorder(17, 12, 11, 11));
    3
    bottom.setBorder(BorderFactory.createEmptyBorder(17, 12, 11, 11));
    4
    cancelButton = new ButtonWithMnemonic(MailResourceLoader.getString("global", "cancel"));
    4
    cancelButton = new ButtonWithMnemonic(MailResourceLoader.getString("global", "cancel"));
    5
    cancelButton.addActionListener(this);
    5
    cancelButton.addActionListener(this);
    6
    cancelButton.setActionCommand("CANCEL");
    6
    cancelButton.setActionCommand("CANCEL");
    7
    okButton = new ButtonWithMnemonic(MailResourceLoader.getString("global", "ok"));
    7
    okButton = new ButtonWithMnemonic(MailResourceLoader.getString("global", "ok"));
    8
    okButton.addActionListener(this);
    8
    okButton.addActionListener(this);
    9
    okButton.setActionCommand("OK");
    9
    okButton.setActionCommand("OK");
    10
    okButton.setDefaultCapable(true);
    10
    okButton.setDefaultCapable(true);
    11
    getRootPane().setDefaultButton(okButton);
    11
    getRootPane().setDefaultButton(okButton);
    11
    dialog.getRootPane().setDefaultButton(okButton);
    Differences
    Expression1Expression2Difference
    dialogMISSING_METHOD_INVOCATION_EXPRESSION
    11
    dialog.getRootPane().setDefaultButton(okButton);
    12
    helpButton = new ButtonWithMnemonic(MailResourceLoader.getString("global", "help"));
    12
    helpButton = new ButtonWithMnemonic(MailResourceLoader.getString("global", "help"));
    13
    JPanel buttonPanel = new JPanel();
    13
    JPanel buttonPanel = new JPanel();
    14
    buttonPanel.setLayout(new GridLayout(1, 3, 5, 0));
    14
    buttonPanel.setLayout(new GridLayout(1, 3, 5, 0));
    15
    buttonPanel.add(okButton);
    15
    buttonPanel.add(okButton);
    16
    buttonPanel.add(cancelButton);
    16
    buttonPanel.add(cancelButton);
    17
    buttonPanel.add(helpButton);
    17
    buttonPanel.add(helpButton);
    18
    bottom.add(buttonPanel, BorderLayout.EAST);
    18
    bottom.add(buttonPanel, BorderLayout.EAST);
    19
    return bottom;
    19
    return bottom;
    Precondition Violations (1)
    Row Violation
    1The refactoring of the clones is infeasible, because classes org.columba.mail.gui.util.PasswordDialog and org.columba.mail.gui.util.PGPPassphraseDialog do not have a common superclass