File path: /sql12/test/jfctests/net/sourceforge/squirrel_sql/plugins/oracle/gui/TestOraclePluginPreferencesPanel.java | File path: /sql12/plugins/dbcopy/test/net/sourceforge/squirrel_sql/plugins/dbcopy/gui/TestPreferencesPanel.java | |||
Method name: void main(String[])
|
Method name: void main(String[])
|
|||
Number of AST nodes: 18 | Number of AST nodes: 18 | |||
1 | JFrame f = new JFrame();↵ | 1 | JFrame f = new JFrame();↵ | |
2 | // TODO move to new standard location and rewrite test to be less static↵ | |||
3 | f.getContentPane().setLayout(new BorderLayout());↵ | 2 | f.getContentPane().setLayout(new BorderLayout());↵ | |
4 | ApplicationArguments.initialize(new String[0]);↵ | 3 | ApplicationArguments.initialize(new String[0]);↵ | |
5 | final PluginQueryTokenizerPreferencesManager prefsManager = ↵ | 4 | ↵ | |
6 | new PluginQueryTokenizerPreferencesManager();↵ | |||
7 | prefsManager.initialize(new DummyPlugin(), new Oracle↵ | 5 | PreferencesManager.initialize(new DummyPlugin());↵ | |
8 | PreferenceBean());↵ | 6 | DBCopyPreferenceBean bean = PreferencesManager.getPreferences();↵ | |
9 | final PluginQueryTokenizerPreferencesPanel p = ↵ | 7 | final P↵ | |
10 | new OraclePluginPreferencesPanel(prefsManager);↵ | 8 | referencesPanel p = new PreferencesPanel(bean);↵ | |
11 | JScrollPane sp = new JScrollPane(p);↵ | 9 | JScrollPane sp = new JScrollPane(p);↵ | |
12 | f.getContentPane().add(sp, BorderLayout.CENTER);↵ | 10 | f.getContentPane().add(sp, BorderLayout.CENTER);↵ | |
13 | JButton button = new JButton("Save");↵ | 11 | JButton button = new JButton("Save");↵ | |
14 | button.addActionListener(new ActionListener() {↵ | 12 | button.addActionListener(new ActionListener() {↵ | |
15 | public void actionPerformed(ActionEvent e) {↵ | 13 | public void actionPerformed(ActionEvent e) {↵ | |
16 | p.applyChanges();↵ | 14 | p.applyChanges();↵ | |
17 | prefsManager.unload();↵ | 15 | PreferencesManager.unload();↵ | |
18 | }↵ | 16 | }↵ | |
19 | });↵ | 17 | });↵ | |
20 | JButton exitButton = new JButton("Exit");↵ | 18 | JButton exitButton = new JButton("Exit");↵ | |
21 | exitButton.addActionListener(new ActionListener() {↵ | 19 | exitButton.addActionListener(new ActionListener() {↵ | |
22 | public void actionPerformed(ActionEvent e) {↵ | 20 | public void actionPerformed(ActionEvent e) {↵ | |
23 | System.exit(0);↵ | 21 | System.exit(0);↵ | |
24 | }↵ | 22 | }↵ | |
25 | });↵ | 23 | });↵ | |
26 | JPanel buttonPanel = new JPanel();↵ | 24 | JPanel buttonPanel = new JPanel();↵ | |
27 | buttonPanel.add(button);↵ | 25 | buttonPanel.add(button);↵ | |
28 | buttonPanel.add(exitButton);↵ | 26 | buttonPanel.add(exitButton);↵ | |
29 | f.getContentPane().add(buttonPanel, BorderLayout.SOUTH);↵ | 27 | f.getContentPane().add(buttonPanel, BorderLayout.SOUTH);↵ | |
30 | f.setBounds(200, 50,700, 700);↵ | 28 | f.setBounds(200, 50,700, 700);↵ | |
31 | f.setVisible(true); | 29 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.0 |
Clones location | Clones are in different classes |
Number of node comparisons | 176 |
Number of mapped statements | 16 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | JFrame f = new JFrame(); | 1 | JFrame f = new JFrame(); | ||||||||||||||||||||||||||
2 | f.getContentPane().setLayout(new BorderLayout()); | 2 | f.getContentPane().setLayout(new BorderLayout()); | ||||||||||||||||||||||||||
3 | ApplicationArguments.initialize(new String[0]); | 3 | ApplicationArguments.initialize(new String[0]); | ||||||||||||||||||||||||||
|
| 4 | PreferencesManager.initialize(new DummyPlugin()); | ||||||||||||||||||||||||||
4 | final PluginQueryTokenizerPreferencesManager prefsManager = new PluginQueryTokenizerPreferencesManager(); | | |||||||||||||||||||||||||||
| 5 | DBCopyPreferenceBean bean = PreferencesManager.getPreferences(); | |||||||||||||||||||||||||||
5 | prefsManager.initialize(new DummyPlugin(), new OraclePreferenceBean()); |
| | ||||||||||||||||||||||||||
6 | final PluginQueryTokenizerPreferencesPanel p = new OraclePluginPreferencesPanel(prefsManager); |
| 6 | final PreferencesPanel p = new PreferencesPanel(bean); | |||||||||||||||||||||||||
7 | JScrollPane sp = new JScrollPane(p); |
| 7 | JScrollPane sp = new JScrollPane(p); | |||||||||||||||||||||||||
8 | f.getContentPane().add(sp, BorderLayout.CENTER); | 8 | f.getContentPane().add(sp, BorderLayout.CENTER); | ||||||||||||||||||||||||||
9 | JButton button = new JButton("Save"); | 9 | JButton button = new JButton("Save"); | ||||||||||||||||||||||||||
10 | button.addActionListener(new ActionListener() {...}); |
| 10 | button.addActionListener(new ActionListener() {...}); | |||||||||||||||||||||||||
11 | JButton exitButton = new JButton("Exit"); | 11 | JButton exitButton = new JButton("Exit"); | ||||||||||||||||||||||||||
12 | exitButton.addActionListener(new ActionListener() {...}); | 12 | exitButton.addActionListener(new ActionListener() {...}); | ||||||||||||||||||||||||||
13 | JPanel buttonPanel = new JPanel(); | 13 | JPanel buttonPanel = new JPanel(); | ||||||||||||||||||||||||||
14 | buttonPanel.add(button); | 14 | buttonPanel.add(button); | ||||||||||||||||||||||||||
15 | buttonPanel.add(exitButton); | 15 | buttonPanel.add(exitButton); | ||||||||||||||||||||||||||
16 | f.getContentPane().add(buttonPanel, BorderLayout.SOUTH); | 16 | f.getContentPane().add(buttonPanel, BorderLayout.SOUTH); | ||||||||||||||||||||||||||
17 | f.setBounds(200, 50, 700, 700); | 17 | f.setBounds(200, 50, 700, 700); | ||||||||||||||||||||||||||
18 | f.setVisible(true); | 18 | f.setVisible(true); |
Row | Violation |
---|---|
1 | Unmatched statement PreferencesManager.initialize(new DummyPlugin()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
2 | Unmatched statement prefsManager.initialize(new DummyPlugin(),new OraclePreferenceBean()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
3 | Expression new OraclePluginPreferencesPanel(prefsManager) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression new PreferencesPanel(bean) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Type net.sourceforge.squirrel_sql.client.plugin.PluginQueryTokenizerPreferencesManager of variable prefsManager does not match with type net.sourceforge.squirrel_sql.plugins.dbcopy.prefs.DBCopyPreferenceBean of variable bean |
6 | Expression p cannot be unified with expression p , because common superclass javax.swing.JPanel does not declare member(s) public void applyChanges() |
7 | Type net.sourceforge.squirrel_sql.client.plugin.PluginQueryTokenizerPreferencesManager of variable prefsManager does not match with type net.sourceforge.squirrel_sql.plugins.dbcopy.prefs.PreferencesManager of variable PreferencesManager |
8 | Expression prefsManager.unload() is a void method call, and thus it cannot be parameterized |
9 | Expression PreferencesManager.unload() is a void method call, and thus it cannot be parameterized |