if (jtextfieldUserId.getText().length() > 0) { try { Integer.parseInt(jtextfieldUserId.getText()); } catch (NumberFormatException e) { bufError.append(i18n.ERROR_NO_NUMBER + CR); if (!focusSet) { jtextfieldUserId.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/FirebirdManagerUserManagerFrame.java File path: /sql12/plugins/firebirdmanager/src/net/sourceforge/squirrel_sql/plugins/firebirdmanager/gui/FirebirdManagerBackupRestoreFrame.java
Method name: boolean isInputOK() Method name: boolean isBackupInputOK()
Number of AST nodes: 3 Number of AST nodes: 2
1
if (jtextfieldUserId.getText().length() > 0) {
2
			try {
1
try {
3
				Integer.parseInt(jtextfieldUserId.getText());
2
				Integer.parseInt(jtextfieldBckPort.getText());
4
			} catch (NumberFormatException e) {
3
			} catch (NumberFormatException e) {
5
				bufError.append(i18n.ERROR_NO_NUMBER + CR);
4
				bufError.append(i18n.ERROR_PORT_NO_INTEGER + CR);
6
				if (!focusSet) {
5
				if (!focusSet) {
7
					jtextfieldUserId.requestFocusInWindow();
6
					jtextfieldBckPort.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
    13
    try
    13
    try
    17
    try
    Differences
    Expression1Expression2Difference
    net.sourceforge.squirrel_sql.plugins.firebirdmanager.gui.FirebirdManagerUserManagerFrame.i18nnet.sourceforge.squirrel_sql.plugins.firebirdmanager.gui.FirebirdManagerBackupRestoreFrame.i18nVARIABLE_TYPE_MISMATCH
    ERROR_NO_NUMBERERROR_PORT_NO_INTEGERVARIABLE_NAME_MISMATCH
    jtextfieldUserIdjtextfieldBckPortVARIABLE_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.FirebirdManagerBackupRestoreFrame.i18n
    • Make classes net.sourceforge.squirrel_sql.plugins.firebirdmanager.gui.FirebirdManagerUserManagerFrame.i18n and net.sourceforge.squirrel_sql.plugins.firebirdmanager.gui.FirebirdManagerBackupRestoreFrame.i18n extend a common superclass
    17
    try
    14
    Integer.parseInt(jtextfieldUserId.getText());
    14
    Integer.parseInt(jtextfieldUserId.getText());
    18
    Integer.parseInt(jtextfieldBckPort.getText());
    Differences
    Expression1Expression2Difference
    jtextfieldUserIdjtextfieldBckPortVARIABLE_NAME_MISMATCH
    18
    Integer.parseInt(jtextfieldBckPort.getText());
    Precondition Violations (2)
    Row Violation
    1Type net.sourceforge.squirrel_sql.plugins.firebirdmanager.gui.FirebirdManagerUserManagerFrame.i18n does not match with type net.sourceforge.squirrel_sql.plugins.firebirdmanager.gui.FirebirdManagerBackupRestoreFrame.i18n
    2Clone fragment #1 returns variables focusSet , while Clone fragment #2 returns variables