df = DateFormat.getDateTimeInstance();
try
{
df.parse(tfNewValue.getText());
}
catch (ParseException ex)
{
JOptionPane.showMessageDialog(session.getApplication().getMainFrame(), i18n.GLOBAL_ERROR_FORMAT_DATETIME);
tfNewValue.requestFocusInWindow();
return false;
}
df = DateFormat.getDateInstance();
try
{
df.parse(tfNewValue.getText());
}
catch (ParseException ex)
{
JOptionPane.showMessageDialog(session.getApplication().getMainFrame(), i18n.GLOBAL_ERROR_FORMAT_DATE);
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: 3
|
|
Number of AST nodes: 3
|
|
1 | df = DateFormat.getDateTimeInstance();↵ | | 1 | df = DateFormat.getDateInstance();↵
|
2 | try↵ | | 2 | try↵
|
3 | {↵ | | 3 | {↵
|
4 | df.parse(tfNewValue.getText());↵ | | 4 | df.parse(tfNewValue.getText());↵
|
5 | }↵ | | 5 | }↵
|
6 | catch (ParseException ex)↵ | | 6 | catch (ParseException ex)↵
|
7 | {↵ | | 7 | {↵
|
8 | JOptionPane.showMessageDialog(session.getApplication().getMainFrame(), i18n.GLOBAL_ERROR_FORMAT_DATETIME);↵ | | 8 | JOptionPane.showMessageDialog(session.getApplication().getMainFrame(), i18n.GLOBAL_ERROR_FORMAT_DATE);↵
|
9 | tfNewValue.requestFocusInWindow();↵ | | 9 | tfNewValue.requestFocusInWindow();↵
|
10 | return false;↵ | | 10 | return false;↵
|
11 | } | | 11 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.5 |
Clones location | Clones are in the same method |
Number of node comparisons | 6 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 1.9 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
21 | df = DateFormat.getDateTimeInstance(); | | 17 | df = DateFormat.getDateInstance(); |
22 | try | | 18 | try |
23 | df.parse(tfNewValue.getText()); | | 19 | df.parse(tfNewValue.getText()); |
Precondition Violations (0)
Row |
Violation |