try { Double.parseDouble(tfNewValue.getText()); } catch (NumberFormatException ex) { JOptionPane.showMessageDialog(session.getApplication().getMainFrame(), i18n.GLOBAL_ERROR_FORMAT_NUMERIC); tfNewValue.requestFocusInWindow(); return false; }
try { Integer.parseInt(tfNewValue.getText()); } catch (NumberFormatException ex) { JOptionPane.showMessageDialog(session.getApplication().getMainFrame(), i18n.GLOBAL_ERROR_FORMAT_INTEGER); tfNewValue.requestFocusInWindow(); return false; }
Clone fragments detected by clone detection tool
File path: /sql12/plugins/smarttools/src/net/sourceforge/squirrel_sql/plugins/smarttools/gui/SmarttoolChangeValuesFrame.java File path: /sql12/plugins/smarttools/src/net/sourceforge/squirrel_sql/plugins/smarttools/gui/SmarttoolChangeValuesFrame.java
Method name: boolean isInputOK(int) Method name: boolean isInputOK(int)
Number of AST nodes: 2 Number of AST nodes: 2
1
try
1
try
2
				{
2
				{
3
					Double.parseDouble(tfNewValue.getText());
3
					Integer.parseInt(tfNewValue.getText());
4
				}
4
				}
5
				catch (NumberFormatException ex)
5
				catch (NumberFormatException ex)
6
				{
6
				{
7
					JOptionPane.showMessageDialog(session.getApplication().getMainFrame(), i18n.GLOBAL_ERROR_FORMAT_NUMERIC);
7
					JOptionPane.showMessageDialog(session.getApplication().getMainFrame(), i18n.GLOBAL_ERROR_FORMAT_INTEGER);
8
					tfNewValue.requestFocusInWindow();
8
					tfNewValue.requestFocusInWindow();
9
					return false;
9
					return false;
10
				}
10
				}
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.5
Clones locationClones are in the same method
Number of node comparisons5
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)1.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    11
    try
    11
    try
    8
    try
    Differences
    Expression1Expression2Difference
    GLOBAL_ERROR_FORMAT_NUMERICGLOBAL_ERROR_FORMAT_INTEGERVARIABLE_NAME_MISMATCH
    8
    try
                                                                                        
    9
    Integer.parseInt(tfNewValue.getText());
    Preondition Violations
    Unmatched statement Integer.parseInt(tfNewValue.getText()); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    9
    Integer.parseInt(tfNewValue.getText());
    12
    Double.parseDouble(tfNewValue.getText());
    12
    Double.parseDouble(tfNewValue.getText());
    Preondition Violations
    Unmatched statement Double.parseDouble(tfNewValue.getText()); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
                                                                                              
    Precondition Violations (2)
    Row Violation
    1Unmatched statement Integer.parseInt(tfNewValue.getText()); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    2Unmatched statement Double.parseDouble(tfNewValue.getText()); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted