df = DateFormat.getTimeInstance(); try { df.parse(tfNewValue.getText()); } catch (ParseException ex) { JOptionPane.showMessageDialog(session.getApplication().getMainFrame(), i18n.GLOBAL_ERROR_FORMAT_TIME); 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.getTimeInstance();
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_TIME);
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
					}
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 comparisons6
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    25
    df = DateFormat.getTimeInstance();
    25
    df = DateFormat.getTimeInstance();
    17
    df = DateFormat.getDateInstance();
    Differences
    Expression1Expression2Difference
    getTimeInstancegetDateInstanceMETHOD_INVOCATION_NAME_MISMATCH
    17
    df = DateFormat.getDateInstance();
    26
    try
    26
    try
    18
    try
    Differences
    Expression1Expression2Difference
    GLOBAL_ERROR_FORMAT_TIMEGLOBAL_ERROR_FORMAT_DATEVARIABLE_NAME_MISMATCH
    18
    try
    27
    df.parse(tfNewValue.getText());
    19
    df.parse(tfNewValue.getText());
    Precondition Violations (0)
    Row Violation