public class TestPreferencesPanel { /** * @param args */ public static void main(String[] args) throws Exception { JFrame f = new JFrame(); f.getContentPane().setLayout(new BorderLayout()); ApplicationArguments.initialize(new String[0]); PreferencesManager.initialize(new DummyPlugin()); DBCopyPreferenceBean bean = PreferencesManager.getPreferences(); final PreferencesPanel p = new PreferencesPanel(bean); JScrollPane sp = new JScrollPane(p); f.getContentPane().add(sp, BorderLayout.CENTER); JButton button = new JButton("Save"); button.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { p.applyChanges(); PreferencesManager.unload(); } }); JButton exitButton = new JButton("Exit"); exitButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { System.exit(0); } }); JPanel buttonPanel = new JPanel(); buttonPanel.add(button); buttonPanel.add(exitButton); f.getContentPane().add(buttonPanel, BorderLayout.SOUTH); f.setBounds(200, 50,700, 700); f.setVisible(true)
public class TestSQLScriptPreferencesPanel { /** * @param args */ public static void main(String[] args) throws Exception { JFrame f = new JFrame(); f.getContentPane().setLayout(new BorderLayout()); ApplicationArguments.initialize(new String[0]); SQLScriptPreferencesManager.initialize(new DummyPlugin()); SQLScriptPreferenceBean bean = SQLScriptPreferencesManager.getPreferences(); final SQLScriptPreferencesPanel p = new SQLScriptPreferencesPanel(bean); JScrollPane sp = new JScrollPane(p); f.getContentPane().add(sp, BorderLayout.CENTER); JButton button = new JButton("Save"); button.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { p.applyChanges(); SQLScriptPreferencesManager.unload(); } }); JButton exitButton = new JButton("Exit"); exitButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { System.exit(0); } }); JPanel buttonPanel = new JPanel(); buttonPanel.add(button); buttonPanel.add(exitButton); f.getContentPane().add(buttonPanel, BorderLayout.SOUTH); f.setBounds(200, 50,700, 700); f.setVisible(true)
Clone fragments detected by clone detection tool
File path: /sql12/plugins/dbcopy/test/net/sourceforge/squirrel_sql/plugins/dbcopy/gui/TestPreferencesPanel.java File path: /sql12/test/jfctests/net/sourceforge/squirrel_sql/plugins/sqlscript/prefs/TestSQLScriptPreferencesPanel.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
public class TestPreferencesPanel {
1
public class TestSQLScriptPreferencesPanel {
2
    /**
2
    /**
3
     * @param args
3
     * @param args
4
     */
4
     */
5
    public static void main(String[] args) throws Exception {
5
    public static void main(String[] args) throws Exception {
6
        JFrame f = new JFrame();
6
        JFrame f = new JFrame();
7
        f.getContentPane().setLayout(new BorderLayout());
7
        f.getContentPane().setLayout(new BorderLayout());
8
        ApplicationArguments.initialize(new String[0]);
8
        ApplicationArguments.initialize(new String[0]);
9
        PreferencesManager.initialize(new DummyPlugin());
9
        SQLScriptPreferencesManager.initialize(new DummyPlugin());
10
        DBCopyPreferenceBean bean = PreferencesManager.getPreferences();
10
        SQLScriptPreferenceBean bean = SQLScriptPreferencesManager.getPreferences();
11
        final PreferencesPanel p = new PreferencesPanel(bean);
11
        final SQLScriptPreferencesPanel p = new SQLScriptPreferencesPanel(bean);
12
        JScrollPane sp = new JScrollPane(p);
12
        JScrollPane sp = new JScrollPane(p);
13
        f.getContentPane().add(sp, BorderLayout.CENTER);
13
        f.getContentPane().add(sp, BorderLayout.CENTER);
14
        JButton button = new JButton("Save");
14
        JButton button = new JButton("Save");
15
        button.addActionListener(new ActionListener() {
15
        button.addActionListener(new ActionListener() {
16
            public void actionPerformed(ActionEvent e) {
16
            public void actionPerformed(ActionEvent e) {
17
                p.applyChanges();
17
                p.applyChanges();
18
                PreferencesManager.unload();
18
                SQLScriptPreferencesManager.unload();
19
            }
19
            }
20
        });
20
        });
21
        JButton exitButton = new JButton("Exit");
21
        JButton exitButton = new JButton("Exit");
22
        exitButton.addActionListener(new ActionListener() {
22
        exitButton.addActionListener(new ActionListener() {
23
            public void actionPerformed(ActionEvent e) {
23
            public void actionPerformed(ActionEvent e) {
24
                System.exit(0);
24
                System.exit(0);
25
            }
25
            }
26
        });
26
        });
27
        JPanel buttonPanel = new JPanel();
27
        JPanel buttonPanel = new JPanel();
28
        buttonPanel.add(button);
28
        buttonPanel.add(button);
29
        buttonPanel.add(exitButton);
29
        buttonPanel.add(exitButton);
30
        f.getContentPane().add(buttonPanel, BorderLayout.SOUTH);
30
        f.getContentPane().add(buttonPanel, BorderLayout.SOUTH);
31
        f.setBounds(200, 50,700, 700);
31
        f.setBounds(200, 50,700, 700);
32
        f.setVisible(true)
32
        f.setVisible(true)
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones location
Number of node comparisons0