if (jtextfieldUsername.getText().trim().length() == 0) {
bufError.append(i18n.CREATEDB_ERROR_USERNAME_MISSING + CR);
if (!focusSet) {
jtextfieldUsername.requestFocusInWindow();
focusSet = true;
}
}
if (jtextfieldUsername.getText().trim().length() > 31) {
bufError.append(i18n.ERROR_USERNAME_MAXLENGTH + CR);
if (!focusSet) {
jtextfieldUsername.requestFocusInWindow();
focusSet = true;
}
}
Clone fragments detected by clone detection tool
File path: /sql12/plugins/firebirdmanager/src/net/sourceforge/squirrel_sql/plugins/firebirdmanager/gui/FirebirdManagerCreateDatabaseFrame.java
|
|
File path: /sql12/plugins/firebirdmanager/src/net/sourceforge/squirrel_sql/plugins/firebirdmanager/gui/FirebirdManagerUserManagerFrame.java
|
Method name: boolean isInputOK()
|
|
Method name: boolean isInputOK()
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | if (jtextfieldUsername.getText().trim().length() == 0) {↵ | | 1 | if (jtextfieldUsername.getText().trim().length() > 31) {↵
|
2 | bufError.append(i18n.CREATEDB_ERROR_USERNAME_MISSING + CR);↵ | | 2 | bufError.append(i18n.ERROR_USERNAME_MAXLENGTH + CR);↵
|
3 | if (!focusSet) {↵ | | 3 | if (!focusSet) {↵
|
4 | jtextfieldUsername.requestFocusInWindow();↵ | | 4 | jtextfieldUsername.requestFocusInWindow();↵
|
5 | focusSet = true;↵ | | 5 | focusSet = true;↵
|
6 | }↵ | | 6 | }↵
|
7 | } | | 7 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.3 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 13 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 5 |
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) | 2.8 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
29 | if (jtextfieldUsername.getText().trim().length() == 0) | | 7 | if (jtextfieldUsername.getText().trim().length() > 31) |
30 | bufError.append(i18n.CREATEDB_ERROR_USERNAME_MISSING + CR); | | 8 | bufError.append(i18n.ERROR_USERNAME_MAXLENGTH + CR); |
31 | | | 9 | |
32 | jtextfieldUsername.requestFocusInWindow(); | | 10 | jtextfieldUsername.requestFocusInWindow(); |
33 | | | 11 | |
Precondition Violations (1)
Row |
Violation |
1 | Type net.sourceforge.squirrel_sql.plugins.firebirdmanager.gui.FirebirdManagerCreateDatabaseFrame.i18n does not match with type net.sourceforge.squirrel_sql.plugins.firebirdmanager.gui.FirebirdManagerUserManagerFrame.i18n |