SwingUtilities.invokeAndWait(new Runnable() { public void run() { _progressBar.setString(text); _progressBar.setValue(_progressBar.getValue() + 1); } }); Thread.yield();
SwingUtilities.invokeLater(new Runnable() { public void run() { bottomBar.setMinimum(min); bottomBar.setMaximum(max); } });
Clone fragments detected by clone detection tool
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/gui/SplashScreen.java File path: /sql12/plugins/dbcopy/src/net/sourceforge/squirrel_sql/plugins/dbcopy/gui/DualProgressBarDialog.java
Method name: void indicateNewTask(String) Method name: void setBottomBarMinMax(int, int)
Number of AST nodes: 2 Number of AST nodes: 1
1
SwingUtilities.invokeAndWait(new Runnable()
1
SwingUtilities.invokeLater(new Runnable()
2
			{
3
				public void run()
4
				{
5
					_progressBar.setString(text);
6
					_progressBar.setValue(_progressBar.getValue() + 1);
7
				}
8
			});
9
			Thread.yield(
2
 {
3
                public void run() {
4
                    bottomBar.setMinimum(min);
5
                    bottomBar.setMaximum(max);
6
                }
10
);
7
            });
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.0
Clones locationClones are in different classes
Number of node comparisons2
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    2
    SwingUtilities.invokeAndWait(new Runnable() {...});
    2
    SwingUtilities.invokeAndWait(new Runnable() {...});
    6
    SwingUtilities.invokeLater(new Runnable() {...});
    Differences
    Expression1Expression2Difference
    textminVARIABLE_NAME_MISMATCH
    java.lang.StringintVARIABLE_TYPE_MISMATCH
    setStringsetMinimumMETHOD_INVOCATION_NAME_MISMATCH
    _progressBarbottomBarVARIABLE_NAME_MISMATCH
    _progressBar.getValue() + 1maxTYPE_COMPATIBLE_REPLACEMENT
    setValuesetMaximumMETHOD_INVOCATION_NAME_MISMATCH
    _progressBarbottomBarVARIABLE_NAME_MISMATCH
    invokeAndWaitinvokeLaterMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Type java.lang.String of variable text does not match with type int of variable min
    Expression _progressBar.setString(text) is a void method call, and thus it cannot be parameterized
    Expression bottomBar.setMinimum(min) is a void method call, and thus it cannot be parameterized
    Expression _progressBar.setValue(_progressBar.getValue() + 1) is a void method call, and thus it cannot be parameterized
    Expression bottomBar.setMaximum(max) is a void method call, and thus it cannot be parameterized
    Expression SwingUtilities.invokeAndWait(new Runnable(){ public void run(){ _progressBar.setString(text); _progressBar.setValue(_progressBar.getValue() + 1); } } ) is a void method call, and thus it cannot be parameterized
    Expression SwingUtilities.invokeLater(new Runnable(){ public void run(){ bottomBar.setMinimum(min); bottomBar.setMaximum(max); } } ) is a void method call, and thus it cannot be parameterized
    6
    SwingUtilities.invokeLater(new Runnable() {...});
    3
    Thread.yield();
                                        
    Precondition Violations (7)
    Row Violation
    1Type java.lang.String of variable text does not match with type int of variable min
    2Expression _progressBar.setString(text) is a void method call, and thus it cannot be parameterized
    3Expression bottomBar.setMinimum(min) is a void method call, and thus it cannot be parameterized
    4Expression _progressBar.setValue(_progressBar.getValue() + 1) is a void method call, and thus it cannot be parameterized
    5Expression bottomBar.setMaximum(max) is a void method call, and thus it cannot be parameterized
    6Expression SwingUtilities.invokeAndWait(new Runnable(){ public void run(){ _progressBar.setString(text); _progressBar.setValue(_progressBar.getValue() + 1); } } ) is a void method call, and thus it cannot be parameterized
    7Expression SwingUtilities.invokeLater(new Runnable(){ public void run(){ bottomBar.setMinimum(min); bottomBar.setMaximum(max); } } ) is a void method call, and thus it cannot be parameterized