if (jtextfieldBckPort.getText().trim().length() == 0) { bufError.append(i18n.ERROR_PORT_MISSING + CR); if (!focusSet) { jtextfieldBckPort.requestFocusInWindow(); focusSet = true; } } else { try { Integer.parseInt(jtextfieldBckPort.getText()); } catch (NumberFormatException e) { bufError.append(i18n.ERROR_PORT_NO_INTEGER + CR); if (!focusSet) { jtextfieldBckPort.requestFocusInWindow(); focusSet = true; } } }
if (jtextfieldResPort.getText().trim().length() == 0) { bufError.append(i18n.ERROR_PORT_MISSING + CR); if (!focusSet) { jtextfieldResPort.requestFocusInWindow(); focusSet = true; } } else { try { Integer.parseInt(jtextfieldResPort.getText()); } catch (NumberFormatException e) { bufError.append(i18n.ERROR_PORT_NO_INTEGER + CR); if (!focusSet) { jtextfieldResPort.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 isBackupInputOK() Method name: boolean isRestoreInputOK()
Number of AST nodes: 7 Number of AST nodes: 7
1
if (jtextfieldBckPort.getText().trim().length() == 0) {
1
if (jtextfieldResPort.getText().trim().length() == 0) {
2
			bufError.append(i18n.ERROR_PORT_MISSING + CR);
2
			bufError.append(i18n.ERROR_PORT_MISSING + CR);
3
			if (!focusSet) {
3
			if (!focusSet) {
4
				jtextfieldBckPort.requestFocusInWindow();
4
				jtextfieldResPort.requestFocusInWindow();
5
				focusSet = true;
5
				focusSet = true;
6
			}
6
			}
7
		} else {
7
		} else {
8
			try {
8
			try {
9
				Integer.parseInt(jtextfieldBckPort.getText());
9
				Integer.parseInt(jtextfieldResPort.getText());
10
			} catch (NumberFormatException e) {
10
			} catch (NumberFormatException e) {
11
				bufError.append(i18n.ERROR_PORT_NO_INTEGER + CR);
11
				bufError.append(i18n.ERROR_PORT_NO_INTEGER + CR);
12
				if (!focusSet) {
12
				if (!focusSet) {
13
					jtextfieldBckPort.requestFocusInWindow();
13
					jtextfieldResPort.requestFocusInWindow();
14
					focusSet = true;
14
					focusSet = true;
15
				}
15
				}
16
			}
16
			}
17
		}
17
		}
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.8
Clones locationClones are declared in the same class
Number of node comparisons19
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements7
    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.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    12
    if (jtextfieldBckPort.getText().trim().length() == 0)
    12
    if (jtextfieldBckPort.getText().trim().length() == 0)
    12
    if (jtextfieldResPort.getText().trim().length() == 0)
    Differences
    Expression1Expression2Difference
    jtextfieldBckPortjtextfieldResPortVARIABLE_NAME_MISMATCH
    12
    if (jtextfieldResPort.getText().trim().length() == 0)
    13
    bufError.append(i18n.ERROR_PORT_MISSING + CR);
    13
    bufError.append(i18n.ERROR_PORT_MISSING + CR);
    14
    if (!focusSet)
    14
    if (!focusSet)
    15
    jtextfieldBckPort.requestFocusInWindow();
    15
    jtextfieldBckPort.requestFocusInWindow();
    15
    jtextfieldResPort.requestFocusInWindow();
    Differences
    Expression1Expression2Difference
    jtextfieldBckPortjtextfieldResPortVARIABLE_NAME_MISMATCH
    15
    jtextfieldResPort.requestFocusInWindow();
    16
    focusSet = true;
    16
    focusSet = true;
    17
    try
    17
    try
    17
    try
    Differences
    Expression1Expression2Difference
    jtextfieldBckPortjtextfieldResPortVARIABLE_NAME_MISMATCH
    17
    try
    18
    Integer.parseInt(jtextfieldBckPort.getText());
    18
    Integer.parseInt(jtextfieldBckPort.getText());
    18
    Integer.parseInt(jtextfieldResPort.getText());
    Differences
    Expression1Expression2Difference
    jtextfieldBckPortjtextfieldResPortVARIABLE_NAME_MISMATCH
    18
    Integer.parseInt(jtextfieldResPort.getText());
    Precondition Violations (0)
    Row Violation