_shareSQLHistoryChk.addChangeListener(_controlMediator); _limitSQLHistoryComboSizeChk.addChangeListener(_controlMediator); JPanel pnl = new JPanel(new GridBagLayout()); pnl.setBorder(BorderFactory.createTitledBorder(s_stringMgr.getString("SessionSQLPropertiesPanel.sqlhistory"))); final GridBagConstraints gbc = new GridBagConstraints(); gbc.fill = GridBagConstraints.HORIZONTAL; gbc.insets = new Insets(4, 4, 4, 4); gbc.anchor = GridBagConstraints.WEST; gbc.gridx = 0; gbc.gridy = 0; pnl.add(_shareSQLHistoryChk, gbc); ++gbc.gridy; pnl.add(_limitSQLHistoryComboSizeChk, gbc); ++gbc.gridx; pnl.add(_limitSQLHistoryComboSizeField, gbc); return pnl;
final GridBagConstraints gbc = new GridBagConstraints(); gbc.anchor = GridBagConstraints.WEST; gbc.fill = GridBagConstraints.HORIZONTAL; gbc.insets = new Insets(4, 4, 4, 4); gbc.gridx = 0; gbc.gridy = 0; add(new JLabel(SkinPrefsPanelI18n.THEME_PACK, SwingConstants.RIGHT), gbc); ++gbc.gridx; add(_themePackCmb, gbc); gbc.gridx = 0; ++gbc.gridy; add(new JLabel(SkinPrefsPanelI18n.THEMEPACK_LOC, SwingConstants.RIGHT), gbc); ++gbc.gridx; final String themePackDir = _ctrl._prefs.getThemePackDirectory(); add(new OutputLabel(themePackDir), gbc);
Clone fragments detected by clone detection tool
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/properties/SessionSQLPropertiesPanel.java File path: /sql12/plugins/laf/src/net/sourceforge/squirrel_sql/plugins/laf/SkinLookAndFeelController.java
Method name: JPanel createSQLHistoryPanel() Method name: void createUserInterface()
Number of AST nodes: 16 Number of AST nodes: 15
1
_shareSQLHistoryChk.addChangeListener(_controlMediator);
2
			_limitSQLHistoryComboSizeChk.addChangeListener(_controlMediator);
1
final GridBagConstr
3
			JPanel pnl = new JPanel(new GridBagLayout());
4
			pnl.setBorder(BorderFactory.createTitledBorder(s_stringMgr.getString("SessionSQLPropertiesPanel.sqlhistory")));
5
			final GridBagConstraints gbc = new
2
aints gbc = new GridBagConstraints();
6
 GridBagConstraints();
3
			gbc.anchor = GridBagConstraints.WEST;
7
			gbc.fill = GridBagConstraints.HORIZONTAL;
4
			gbc.fill = GridBagConstraints.HORIZONTAL;
8
			gbc.insets = new Insets(4, 4, 4, 4);
5
			gbc.insets = new Insets(4, 4, 4, 4);
9
			gbc.anchor = GridBa
6
			gbc.gridx = 0;
7
			gbc.gridy = 0;
10
gConstraints.WEST;
8
			add(new JLabel(SkinPrefsPanelI18n.THEME_PACK, SwingConstants.
11
			gbc.gridx = 0;
9
RIGHT), gbc);
12
			gbc.gridy = 0;
10
			++gbc.gridx;
13
			pnl.add(_shareSQLHistoryChk, gbc);
11
			add(_
14
			++gbc.gridy;
15
			pnl.add(_limitSQLHistoryComboSizeChk, gbc);
16
			++gbc.gridx;
17
			pnl.add(_limitSQLHistoryComboSizeField, gbc
12
themePackCmb, gbc);
13
			gbc.gridx = 0;
14
			++gbc.gridy;
15
			add(new JLabel(SkinPrefsPanelI18n.THEMEPACK_LOC, SwingConstants.RIGHT), gbc);
16
			++gbc.gridx;
18
);
17
			final String themePackDir = _ctrl._prefs.getThemePackDirectory();
19
			return pnl;
18
			add(new OutputLabel(themePackDir), gbc);
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 comparisons144
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements11
    Number of unmapped statements in the first code fragment5
    Number of unmapped statements in the second code fragment4
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    _shareSQLHistoryChk.addChangeListener(_controlMediator);
                                                                                                                          
    2
    _limitSQLHistoryComboSizeChk.addChangeListener(_controlMediator);
                                                                                                                                            
    3
    JPanel pnl = new JPanel(new GridBagLayout());
                                                                                                
    4
    pnl.setBorder(BorderFactory.createTitledBorder(s_stringMgr.getString("SessionSQLPropertiesPanel.sqlhistory")));
                                                                                                                                                                                                                                        
    5
    final GridBagConstraints gbc = new GridBagConstraints();
    1
    final GridBagConstraints gbc = new GridBagConstraints();
    6
    gbc.fill = GridBagConstraints.HORIZONTAL;
    3
    gbc.fill = GridBagConstraints.HORIZONTAL;
    7
    gbc.insets = new Insets(4, 4, 4, 4);
    4
    gbc.insets = new Insets(4, 4, 4, 4);
    8
    gbc.anchor = GridBagConstraints.WEST;
    2
    gbc.anchor = GridBagConstraints.WEST;
                                  
    5
    gbc.gridx = 0;
    Preondition Violations
    Unmatched statement gbc.gridx=0; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5
    gbc.gridx = 0;
    9
    gbc.gridx = 0;
    10
    gbc.gridx = 0;
    10
    gbc.gridy = 0;
    6
    gbc.gridy = 0;
                                  
    8
    ++gbc.gridx;
    Preondition Violations
    Unmatched statement ++gbc.gridx; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    8
    ++gbc.gridx;
    11
    pnl.add(_shareSQLHistoryChk, gbc);
    11
    pnl.add(_shareSQLHistoryChk, gbc);
    9
    add(_themePackCmb, gbc);
    Differences
    Expression1Expression2Difference
    _shareSQLHistoryChk_themePackCmbVARIABLE_NAME_MISMATCH
    javax.swing.JCheckBoxnet.sourceforge.squirrel_sql.fw.gui.DirectoryListComboBoxSUBCLASS_TYPE_MISMATCH
    pnlMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression pnl.add(_shareSQLHistoryChk,gbc) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression add(_themePackCmb,gbc) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression pnl.add(_shareSQLHistoryChk,gbc) is a void method call, and thus it cannot be parameterized
    Expression add(_themePackCmb,gbc) is a void method call, and thus it cannot be parameterized
    9
    add(_themePackCmb, gbc);
    12
    ++gbc.gridy;
    11
    ++gbc.gridy;
    13
    pnl.add(_limitSQLHistoryComboSizeChk, gbc);
    13
    pnl.add(_limitSQLHistoryComboSizeChk, gbc);
    12
    add(new JLabel(SkinPrefsPanelI18n.THEMEPACK_LOC, SwingConstants.RIGHT), gbc);
    Differences
    Expression1Expression2Difference
    javax.swing.JCheckBoxjavax.swing.JLabelSUBCLASS_TYPE_MISMATCH
    _limitSQLHistoryComboSizeChknew JLabel(SkinPrefsPanelI18n.THEMEPACK_LOC,SwingConstants.RIGHT)TYPE_COMPATIBLE_REPLACEMENT
    pnlMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression pnl.add(_limitSQLHistoryComboSizeChk,gbc) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression add(new JLabel(SkinPrefsPanelI18n.THEMEPACK_LOC,SwingConstants.RIGHT),gbc) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression pnl.add(_limitSQLHistoryComboSizeChk,gbc) is a void method call, and thus it cannot be parameterized
    Expression add(new JLabel(SkinPrefsPanelI18n.THEMEPACK_LOC,SwingConstants.RIGHT),gbc) is a void method call, and thus it cannot be parameterized
    12
    add(new JLabel(SkinPrefsPanelI18n.THEMEPACK_LOC, SwingConstants.RIGHT), gbc);
    14
    ++gbc.gridx;
    13
    ++gbc.gridx;
    15
    pnl.add(_limitSQLHistoryComboSizeField, gbc);
    15
    pnl.add(_limitSQLHistoryComboSizeField, gbc);
    7
    add(new JLabel(SkinPrefsPanelI18n.THEME_PACK, SwingConstants.RIGHT), gbc);
    Differences
    Expression1Expression2Difference
    net.sourceforge.squirrel_sql.fw.gui.IntegerFieldjavax.swing.JLabelSUBCLASS_TYPE_MISMATCH
    _limitSQLHistoryComboSizeFieldnew JLabel(SkinPrefsPanelI18n.THEME_PACK,SwingConstants.RIGHT)TYPE_COMPATIBLE_REPLACEMENT
    pnlMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression pnl.add(_limitSQLHistoryComboSizeField,gbc) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression add(new JLabel(SkinPrefsPanelI18n.THEME_PACK,SwingConstants.RIGHT),gbc) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression pnl.add(_limitSQLHistoryComboSizeField,gbc) is a void method call, and thus it cannot be parameterized
    Expression add(new JLabel(SkinPrefsPanelI18n.THEME_PACK,SwingConstants.RIGHT),gbc) is a void method call, and thus it cannot be parameterized
    7
    add(new JLabel(SkinPrefsPanelI18n.THEME_PACK, SwingConstants.RIGHT), gbc);
                                                                                                                                          
    14
    final String themePackDir = _ctrl._prefs.getThemePackDirectory();
                                                                                          
    15
    add(new OutputLabel(themePackDir), gbc);
    Preondition Violations
    Unmatched statement add(new OutputLabel(themePackDir),gbc); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    15
    add(new OutputLabel(themePackDir), gbc);
    16
    return pnl;
    16
    return pnl;
    Preondition Violations
    Unmatched return pnl;
                                  
    Precondition Violations (18)
    Row Violation
    1Unmatched statement gbc.gridx=0; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement ++gbc.gridx; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Expression pnl.add(_shareSQLHistoryChk,gbc) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression add(_themePackCmb,gbc) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression pnl.add(_shareSQLHistoryChk,gbc) is a void method call, and thus it cannot be parameterized
    6Expression add(_themePackCmb,gbc) is a void method call, and thus it cannot be parameterized
    7Expression pnl.add(_limitSQLHistoryComboSizeChk,gbc) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression add(new JLabel(SkinPrefsPanelI18n.THEMEPACK_LOC,SwingConstants.RIGHT),gbc) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression pnl.add(_limitSQLHistoryComboSizeChk,gbc) is a void method call, and thus it cannot be parameterized
    10Expression add(new JLabel(SkinPrefsPanelI18n.THEMEPACK_LOC,SwingConstants.RIGHT),gbc) is a void method call, and thus it cannot be parameterized
    11Expression pnl.add(_limitSQLHistoryComboSizeField,gbc) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Expression add(new JLabel(SkinPrefsPanelI18n.THEME_PACK,SwingConstants.RIGHT),gbc) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Expression pnl.add(_limitSQLHistoryComboSizeField,gbc) is a void method call, and thus it cannot be parameterized
    14Expression add(new JLabel(SkinPrefsPanelI18n.THEME_PACK,SwingConstants.RIGHT),gbc) is a void method call, and thus it cannot be parameterized
    15Unmatched statement add(new OutputLabel(themePackDir),gbc); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    16Unmatched return pnl;
    17Clone fragment #1 returns variables , while Clone fragment #2 returns variables gbc
    18The refactoring of the clones is infeasible, because classes net.sourceforge.squirrel_sql.client.session.properties.SessionSQLPropertiesPanel.SQLPropertiesPanel and net.sourceforge.squirrel_sql.plugins.laf.SkinLookAndFeelController.SkinPrefsPanel do not have a common superclass