if (message != null) { // set up dialog to ask user if it is ok to proceed // IMPORTANT: this dialog is SYNCHRONOUS (ie. we do not proceed until // user gives a response). This is critical since this function provides // a return value to its caller that depends on the user input. // i18n[baseDataSetViewerDestination.warning2=Warning] int option = JOptionPane.showConfirmDialog(null, message, s_stringMgr.getString("baseDataSetViewerDestination.warning2"), JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE); if ( option != JOptionPane.YES_OPTION) { return new int[0]; // no update done to underlying data } }
if (message != null) { // set up dialog to ask user if it is ok to proceed // IMPORTANT: this dialog is SYNCHRONOUS (ie. we do not proceed until // user gives a response). This is critical since this function provides // a return value to its caller that depends on the user input. // i18n[baseDataSetViewerDestination.warning=Warning] int option = JOptionPane.showConfirmDialog(null, message, s_stringMgr.getString("baseDataSetViewerDestination.warning"), JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE); if ( option != JOptionPane.YES_OPTION) { return new int[0]; // no update done to underlying data } }
Clone fragments detected by clone detection tool
File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/datasetviewer/DataSetViewerEditableTablePanel.java File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/datasetviewer/DataSetViewerEditableTablePanel.java
Method name: int[] changeUnderlyingValueAt(int, int, Object, Object) Method name: int[] changeUnderlyingValueAt(int, int, Object, Object)
Number of AST nodes: 4 Number of AST nodes: 4
1
if (message != null) {
1
if (message != null) {
2
			// set up dialog to ask user if it is ok to proceed
2
			// set up dialog to ask user if it is ok to proceed
3
			// IMPORTANT: this dialog is SYNCHRONOUS (ie. we do not proceed until
3
			// IMPORTANT: this dialog is SYNCHRONOUS (ie. we do not proceed until
4
			// user gives a response).  This is critical since this function provides
4
			// user gives a response).  This is critical since this function provides
5
			// a return value to its caller that depends on the user input.
5
			// a return value to its caller that depends on the user input.
6
			// i18n[baseDataSetViewerDestination.warning2=Warning]
6
			// i18n[baseDataSetViewerDestination.warning=Warning]
7
			int option = JOptionPane.showConfirmDialog(null, message, s_stringMgr.getString("baseDataSetViewerDestination.warning2"),
7
			int option = JOptionPane.showConfirmDialog(null, message, s_stringMgr.getString("baseDataSetViewerDestination.warning"),
8
				JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
8
				JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
9
			if ( option != JOptionPane.YES_OPTION)
9
			if ( option != JOptionPane.YES_OPTION)
10
			{
10
			{
11
				return new int[0];	// no update done to underlying data
11
				return new int[0];	// no update done to underlying data
12
			}
12
			}
13
		}
13
		}
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.2
Clones locationClones are in the same method
Number of node comparisons8
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)7.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    17
    if (message != null)
    11
    if (message != null)
    18
    int option = JOptionPane.showConfirmDialog(null, message, s_stringMgr.getString("baseDataSetViewerDestination.warning2"), JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
    18
    int option = JOptionPane.showConfirmDialog(null, message, s_stringMgr.getString("baseDataSetViewerDestination.warning2"), JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
    12
    int option = JOptionPane.showConfirmDialog(null, message, s_stringMgr.getString("baseDataSetViewerDestination.warning"), JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
    Differences
    Expression1Expression2Difference
    "baseDataSetViewerDestination.warning2""baseDataSetViewerDestination.warning"LITERAL_VALUE_MISMATCH
    12
    int option = JOptionPane.showConfirmDialog(null, message, s_stringMgr.getString("baseDataSetViewerDestination.warning"), JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
    19
    if (option != JOptionPane.YES_OPTION)
    13
    if (option != JOptionPane.YES_OPTION)
    20
    return new int[0];
    14
    return new int[0];
    Precondition Violations (1)
    Row Violation
    1Not all possible execution flows end in a return statement