try {
Integer.parseInt(jtextfieldResPort.getText());
} catch (NumberFormatException e) {
bufError.append(i18n.ERROR_PORT_NO_INTEGER + CR);
if (!focusSet) {
jtextfieldResPort.requestFocusInWindow();
focusSet = true;
}
}
try {
Integer.parseInt(jtextfieldBckPort.getText());
} catch (NumberFormatException e) {
bufError.append(i18n.ERROR_PORT_NO_INTEGER + CR);
if (!focusSet) {
jtextfieldBckPort.requestFocusInWindow();
focusSet = true;
}
}
Clone fragments detected by clone detection tool
File path: /sql12/plugins/firebirdmanager/src/net/sourceforge/squirrel_sql/plugins/firebirdmanager/gui/FirebirdManagerBackupRestoreFrame.java
|
|
File path: /sql12/plugins/firebirdmanager/src/net/sourceforge/squirrel_sql/plugins/firebirdmanager/gui/FirebirdManagerBackupRestoreFrame.java
|
Method name: boolean isRestoreInputOK()
|
|
Method name: boolean isBackupInputOK()
|
Number of AST nodes: 2
|
|
Number of AST nodes: 2
|
|
1 | try {↵ | | 1 | try {↵
|
2 | Integer.parseInt(jtextfieldResPort.getText());↵ | | 2 | Integer.parseInt(jtextfieldBckPort.getText());↵
|
3 | } catch (NumberFormatException e) {↵ | | 3 | } catch (NumberFormatException e) {↵
|
4 | bufError.append(i18n.ERROR_PORT_NO_INTEGER + CR);↵ | | 4 | bufError.append(i18n.ERROR_PORT_NO_INTEGER + CR);↵
|
5 | if (!focusSet) {↵ | | 5 | if (!focusSet) {↵
|
6 | jtextfieldResPort.requestFocusInWindow();↵ | | 6 | jtextfieldBckPort.requestFocusInWindow();↵
|
7 | focusSet = true;↵ | | 7 | focusSet = true;↵
|
8 | }↵ | | 8 | }↵
|
9 | } | | 9 | }
|
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.6 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 6 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 2 |
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.3 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
17 | try | | 17 | try |
18 | Integer.parseInt(jtextfieldResPort.getText()); | | 18 | Integer.parseInt(jtextfieldBckPort.getText()); |
Precondition Violations (0)
Row |
Violation |