if (jtextfieldGroupId.getText().length() > 0) { try { Integer.parseInt(jtextfieldGroupId.getText()); } catch (NumberFormatException e) { bufError.append(i18n.ERROR_NO_NUMBER + CR); if (!focusSet) { jtextfieldGroupId.requestFocusInWindow(); focusSet = true; } } }
try { Integer.parseInt(jtextfieldPort.getText()); } catch (NumberFormatException e) { bufError.append(i18n.CREATEDB_ERROR_PORT_NOINTEGER + CR); if (!focusSet) { jtextfieldPort.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/FirebirdManagerCreateDatabaseFrame.java
Method name: boolean isInputOK() Method name: boolean isInputOK()
Number of AST nodes: 3 Number of AST nodes: 2
1
if (jtextfieldGroupId.getText().length() > 0) {
2
			try {
1
try {
3
				Integer.parseInt(jtextfieldGroupId.getText());
2
				Integer.parseInt(jtextfieldPort.getText());
4
			} catch (NumberFormatException e) {
3
			} catch (NumberFormatException e) {
5
				bufError.append(i18n.ERROR_NO_NUMBER + CR);
4
				bufError.append(i18n.CREATEDB_ERROR_PORT_NOINTEGER + CR);
6
				if (!focusSet) {
5
				if (!focusSet) {
7
					jtextfieldGroupId.requestFocusInWindow();
6
					jtextfieldPort.requestFocusInWindow();
8
					focusSet = true;
7
					focusSet = true;
9
				}
8
				}
10
			}
9
			}
11
		}
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.4
Clones locationClones are in different classes having the same super class
Number of node comparisons4
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    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.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    16
    try
    16
    try
    27
    try
    Differences
    Expression1Expression2Difference
    net.sourceforge.squirrel_sql.plugins.firebirdmanager.gui.FirebirdManagerUserManagerFrame.i18nnet.sourceforge.squirrel_sql.plugins.firebirdmanager.gui.FirebirdManagerCreateDatabaseFrame.i18nVARIABLE_TYPE_MISMATCH
    ERROR_NO_NUMBERCREATEDB_ERROR_PORT_NOINTEGERVARIABLE_NAME_MISMATCH
    jtextfieldGroupIdjtextfieldPortVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type net.sourceforge.squirrel_sql.plugins.firebirdmanager.gui.FirebirdManagerUserManagerFrame.i18n does not match with type net.sourceforge.squirrel_sql.plugins.firebirdmanager.gui.FirebirdManagerCreateDatabaseFrame.i18n
    • Make classes net.sourceforge.squirrel_sql.plugins.firebirdmanager.gui.FirebirdManagerUserManagerFrame.i18n and net.sourceforge.squirrel_sql.plugins.firebirdmanager.gui.FirebirdManagerCreateDatabaseFrame.i18n extend a common superclass
    27
    try
    17
    Integer.parseInt(jtextfieldGroupId.getText());
    17
    Integer.parseInt(jtextfieldGroupId.getText());
    28
    Integer.parseInt(jtextfieldPort.getText());
    Differences
    Expression1Expression2Difference
    jtextfieldGroupIdjtextfieldPortVARIABLE_NAME_MISMATCH
    28
    Integer.parseInt(jtextfieldPort.getText());
    Precondition Violations (1)
    Row Violation
    1Type net.sourceforge.squirrel_sql.plugins.firebirdmanager.gui.FirebirdManagerUserManagerFrame.i18n does not match with type net.sourceforge.squirrel_sql.plugins.firebirdmanager.gui.FirebirdManagerCreateDatabaseFrame.i18n