File path: /sql12/test/jfctests/net/sourceforge/squirrel_sql/plugins/sqlscript/prefs/TestSQLScriptPreferencesPanel.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 | f.getContentPane().setLayout(new BorderLayout());↵ | 2 | f.getContentPane().setLayout(new BorderLayout());↵ | |
3 | ApplicationArguments.initialize(new String[0]);↵ | 3 | ApplicationArguments.initialize(new String[0]);↵ | |
4 | SQLScriptPreferencesManager.initialize(new DummyPlugin());↵ | 4 | PreferencesManager.initialize(new DummyPlugin());↵ | |
5 | SQLScriptPreferenceBean bean = SQLScriptPreferencesManager.getPreferences();↵ | 5 | DBCopyPreferenceBean bean = PreferencesManager.getPreferences();↵ | |
6 | final SQLScriptPreferencesPanel p = new SQLScriptPreferencesPanel(bean);↵ | 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 | public void actionPerformed(ActionEvent e) {↵ | 11 | public void actionPerformed(ActionEvent e) {↵ | |
12 | p.applyChanges();↵ | 12 | p.applyChanges();↵ | |
13 | SQLScriptPreferencesManager.unload();↵ | 13 | PreferencesManager.unload();↵ | |
14 | }↵ | 14 | }↵ | |
15 | });↵ | 15 | });↵ | |
16 | JButton exitButton = new JButton("Exit");↵ | 16 | JButton exitButton = new JButton("Exit");↵ | |
17 | exitButton.addActionListener(new ActionListener() {↵ | 17 | exitButton.addActionListener(new ActionListener() {↵ | |
18 | public void actionPerformed(ActionEvent e) {↵ | 18 | public void actionPerformed(ActionEvent e) {↵ | |
19 | System.exit(0);↵ | 19 | System.exit(0);↵ | |
20 | }↵ | 20 | }↵ | |
21 | });↵ | 21 | });↵ | |
22 | JPanel buttonPanel = new JPanel();↵ | 22 | JPanel buttonPanel = new JPanel();↵ | |
23 | buttonPanel.add(button);↵ | 23 | buttonPanel.add(button);↵ | |
24 | buttonPanel.add(exitButton);↵ | 24 | buttonPanel.add(exitButton);↵ | |
25 | f.getContentPane().add(buttonPanel, BorderLayout.SOUTH);↵ | 25 | f.getContentPane().add(buttonPanel, BorderLayout.SOUTH);↵ | |
26 | f.setBounds(200, 50,700, 700);↵ | 26 | f.setBounds(200, 50,700, 700);↵ | |
27 | f.setVisible(true); | 27 |
| |
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 | 146 |
Number of mapped statements | 17 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
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 | SQLScriptPreferencesManager.initialize(new DummyPlugin()); |
| 4 | PreferencesManager.initialize(new DummyPlugin()); | ||||||||||||||||||||||
|
| 5 | DBCopyPreferenceBean bean = PreferencesManager.getPreferences(); | |||||||||||||||||||||||
5 | SQLScriptPreferenceBean bean = SQLScriptPreferencesManager.getPreferences(); |
| | |||||||||||||||||||||||
6 | final SQLScriptPreferencesPanel p = new SQLScriptPreferencesPanel(bean); |
| 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 | Type net.sourceforge.squirrel_sql.plugins.sqlscript.prefs.SQLScriptPreferencesManager does not match with type net.sourceforge.squirrel_sql.plugins.dbcopy.prefs.PreferencesManager |
2 | Unmatched statement DBCopyPreferenceBean bean=PreferencesManager.getPreferences(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement SQLScriptPreferenceBean bean=SQLScriptPreferencesManager.getPreferences(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Expression new SQLScriptPreferencesPanel(bean) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression new PreferencesPanel(bean) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Type net.sourceforge.squirrel_sql.plugins.sqlscript.prefs.SQLScriptPreferenceBean of variable bean does not match with type net.sourceforge.squirrel_sql.plugins.dbcopy.prefs.DBCopyPreferenceBean of variable bean |
7 | Expression p cannot be unified with expression p , because common superclass javax.swing.JPanel does not declare member(s) public void applyChanges() |
8 | Type net.sourceforge.squirrel_sql.plugins.sqlscript.prefs.SQLScriptPreferencesManager does not match with type net.sourceforge.squirrel_sql.plugins.dbcopy.prefs.PreferencesManager |