if (jtextfieldUsername.getText().trim().length() > 31) { bufError.append(i18n.ERROR_USERNAME_MAXLENGTH + CR); if (!focusSet) { jtextfieldUsername.requestFocusInWindow(); focusSet = true; } }
if (new String(jpasswordField1.getPassword()).length() > 31) { bufError.append(i18n.ERROR_PASSWORD_MAXLENGTH + CR); if (!focusSet) { jpasswordField1.requestFocusInWindow(); focusSet = true; } }
Clone fragments detected by clone detection tool
File path: /sql12/plugins/firebirdmanager/src/net/sourceforge/squirrel_sql/plugins/firebirdmanager/gui/FirebirdManagerUserManagerFrame.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() > 31) {
1
if (new String(jpasswordField1.getPassword()).length() > 31) {
2
			bufError.append(i18n.ERROR_USERNAME_MAXLENGTH + CR);
2
						bufError.append(i18n.ERROR_PASSWORD_MAXLENGTH + CR);
3
			if (!focusSet) {
3
						if (!focusSet) {
4
				jtextfieldUsername.requestFocusInWindow();
4
							jpasswordField1.requestFocusInWindow();
5
				focusSet = true;
5
							focusSet = true;
6
			}
6
			
7
			}
7
		}
8
					}
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.2
Clones locationClones are in the same method
Number of node comparisons13
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)2.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    7
    else if (jtextfieldUsername.getText().trim().length() > 31)
    7
    else if (jtextfieldUsername.getText().trim().length() > 31)
    35
    else if (new String(jpasswordField1.getPassword()).length() > 31)
    Differences
    Expression1Expression2Difference
    jtextfieldUsername.getText().trim()new String(jpasswordField1.getPassword())TYPE_COMPATIBLE_REPLACEMENT
    35
    else if (new String(jpasswordField1.getPassword()).length() > 31)
    8
    bufError.append(i18n.ERROR_USERNAME_MAXLENGTH + CR);
    8
    bufError.append(i18n.ERROR_USERNAME_MAXLENGTH + CR);
    36
    bufError.append(i18n.ERROR_PASSWORD_MAXLENGTH + CR);
    Differences
    Expression1Expression2Difference
    ERROR_USERNAME_MAXLENGTHERROR_PASSWORD_MAXLENGTHVARIABLE_NAME_MISMATCH
    36
    bufError.append(i18n.ERROR_PASSWORD_MAXLENGTH + CR);
    9
    if (!focusSet)
    37
    if (!focusSet)
    10
    jtextfieldUsername.requestFocusInWindow();
    10
    jtextfieldUsername.requestFocusInWindow();
    38
    jpasswordField1.requestFocusInWindow();
    Differences
    Expression1Expression2Difference
    jtextfieldUsernamejpasswordField1VARIABLE_NAME_MISMATCH
    javax.swing.JTextFieldjavax.swing.JPasswordFieldSUBCLASS_TYPE_MISMATCH
    38
    jpasswordField1.requestFocusInWindow();
    11
    focusSet = true;
    39
    focusSet = true;
    Precondition Violations (0)
    Row Violation