try { SwingUtilities.invokeAndWait(new Runnable() { public void run() { String tmp = (String)JOptionPane.showInputDialog(parent, message, title, messageType, icon, null, initialValue); result.append(tmp); } }); } catch (Exception e) { log.error( "showTextInputDialog: encountered unexpected exception ", e); }
if (SwingUtilities.isEventDispatchThread()) { _getDialog(owner, title, modal, listener); } else { try { SwingUtilities.invokeAndWait(new Runnable() { public void run() { _getDialog(owner, title, modal, listener); } }); } catch (Exception e) { //i18n[DualProgressBarDialog.error.getdialog=getDialog: unable to invokeAndWait for dialog] log.error(s_stringMgr.getString("DualProgressBarDialog.error.getdialog"), e); } }
Clone fragments detected by clone detection tool
File path: /sql12/plugins/dbcopy/src/net/sourceforge/squirrel_sql/plugins/dbcopy/CopyProgressMonitor.java File path: /sql12/plugins/dbcopy/src/net/sourceforge/squirrel_sql/plugins/dbcopy/gui/DualProgressBarDialog.java
Method name: String showTextInputDialog(Object, String, int, Icon, Object) Method name: JDialog getDialog(Frame, String, boolean, ActionListener)
Number of AST nodes: 2 Number of AST nodes: 4
1
try {
2
                SwingUtilities.invokeAndWait(new Runnable() {
3
                    public void run() {
4
            
1
if (SwingUtilities.isEventDispatchThread()) {
2
            _getDialog(owner, title, modal, listener);
3
        } else {
5
            String tmp = 
4
            tr
6
 
5
y {
7
                           (String)JOptionPane.showInputDialog(parent, 
6
                
8
                                                                message, 
9
                                                                title, 
10
                                                                messageType, 
11
                                                                icon, 
12
                                                                null, 
13
                                                                initialValue);
14
                        result.append(tmp
7
SwingUtilities.invokeAndWait(new Runnable() {
8
                    public void run() {
15
);
9
                        _getDialog(owner, title, modal, listener);
16
                    }
10
                    }
17
                });
11
                });
18
            } catch (Exception e) {
12
            } catch (Exception e) {
19
                log.error(
13
                
20
                    "showTextInputDialog: encountered unexpected exception ",
21
        
14
//i18n[DualProgressBarDialog.error.getdialog=getDialog: unable to invokeAndWait for dialog]
15
                log.error(s_stringMgr.getString("DualProgressBarDialog.error.getdialog"), e);
22
            e);
16
            
23
    
17
}
24
        }
18
        }
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.3
Clones locationClones are in different classes
Number of node comparisons5