final GridBagConstraints gbc = new GridBagConstraints(); gbc.fill = GridBagConstraints.HORIZONTAL; gbc.insets = new Insets(4, 4, 4, 4); gbc.gridx = 0; gbc.gridy = 0; gbc.weightx = 1; add(createHTTPPanel(), gbc); ++gbc.gridy; add(createSOCKSPanel(), gbc); final ActionListener lis = new MyActionHandler(); _httpUseProxyChk.addActionListener(lis); _socksUseProxyChk.addActionListener(lis);
setLayout(new GridBagLayout()); 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(createSQLPanel(), gbc); ++gbc.gridy; add(createFontPanel(), gbc); ++gbc.gridy; add(createSQLHistoryPanel(), gbc);
Clone fragments detected by clone detection tool
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/preferences/ProxyPreferencesPanel.java File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/properties/SessionSQLPropertiesPanel.java
Method name: void createUserInterface() Method name: void createGUI()
Number of AST nodes: 12 Number of AST nodes: 12
1
setLayout(new GridBagLayout());
1
final GridBagConstraints gbc = new GridBagConstraints();
2
			final GridBagConstraints gbc = new GridBagConstraints();
2
			
3
			gbc.anchor = GridBagConstraints.WEST;
3
gbc.fill = GridBagConstraints.HORIZONTAL;
4
			gbc.fill = GridBagConstraints.HORIZONTAL;
4
			gbc.insets = new Insets(4, 4, 4, 4);
5
			gbc.insets = new Insets(4, 4, 4, 4);
5
			gbc.gridx = 0;
6
			gbc.gridx = 0;
6
			gbc.gridy = 0;
7
			gbc.gridy = 0;
7
			gbc.weightx = 1;
8
			
8
			add(createHTTPPanel(), gbc);
9
add(createSQLPanel(), gbc);
9
			++gbc.gridy;
10
			++gbc.gridy;
10
			add(createSOCKSPanel(), gbc);
11
			add(createFontPanel(), gbc);
11
			final ActionListener lis = new MyActionHandler();
12
			
12
			_httpUseProxyChk.addActionListener(lis);
13
			_socksUseProxyChk.addActionListener(lis
13
++gbc.gridy;
14
);
14
			add(createSQLHistoryPanel(), gbc);
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
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 comparisons96
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements8
    Number of unmapped statements in the first code fragment4
    Number of unmapped statements in the second code fragment4
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                        
    1
    setLayout(new GridBagLayout());
    1
    final GridBagConstraints gbc = new GridBagConstraints();
    2
    final GridBagConstraints gbc = new GridBagConstraints();
                                                                                
    3
    gbc.anchor = GridBagConstraints.WEST;
    Preondition Violations
    Unmatched statement gbc.anchor=GridBagConstraints.WEST; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3
    gbc.anchor = GridBagConstraints.WEST;
    2
    gbc.fill = GridBagConstraints.HORIZONTAL;
    4
    gbc.fill = GridBagConstraints.HORIZONTAL;
    3
    gbc.insets = new Insets(4, 4, 4, 4);
    5
    gbc.insets = new Insets(4, 4, 4, 4);
    4
    gbc.gridx = 0;
    6
    gbc.gridx = 0;
    5
    gbc.gridy = 0;
    7
    gbc.gridy = 0;
    6
    gbc.weightx = 1;
    6
    gbc.weightx = 1;
    Preondition Violations
    Unmatched statement gbc.weightx=1; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                      
    7
    add(createHTTPPanel(), gbc);
    7
    add(createHTTPPanel(), gbc);
    10
    add(createFontPanel(), gbc);
    Differences
    Expression1Expression2Difference
    createHTTPPanelcreateFontPanelMETHOD_INVOCATION_NAME_MISMATCH
    10
    add(createFontPanel(), gbc);
    8
    ++gbc.gridy;
    9
    ++gbc.gridy;
    9
    add(createSOCKSPanel(), gbc);
    9
    add(createSOCKSPanel(), gbc);
    8
    add(createSQLPanel(), gbc);
    Differences
    Expression1Expression2Difference
    createSOCKSPanelcreateSQLPanelMETHOD_INVOCATION_NAME_MISMATCH
    8
    add(createSQLPanel(), gbc);
    10
    final ActionListener lis = new MyActionHandler();
                                                                                                          
                                    
    11
    ++gbc.gridy;
    Preondition Violations
    Unmatched statement ++gbc.gridy; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    11
    ++gbc.gridy;
    11
    _httpUseProxyChk.addActionListener(lis);
                                                                                            
                                                                              
    12
    add(createSQLHistoryPanel(), gbc);
    Preondition Violations
    Unmatched statement add(createSQLHistoryPanel(),gbc); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    12
    add(createSQLHistoryPanel(), gbc);
    12
    _socksUseProxyChk.addActionListener(lis);
                                                                                              
    Precondition Violations (4)
    Row Violation
    1Unmatched statement gbc.anchor=GridBagConstraints.WEST; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement gbc.weightx=1; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched statement ++gbc.gridy; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched statement add(createSQLHistoryPanel(),gbc); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted