File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/gui/StatusBar.java | File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/gui/StatusBar.java | |||
Method name: void setText(String)
|
Method name: void setTextWhenEmpty(String)
|
|||
Number of AST nodes: 6 | Number of AST nodes: 6 | |||
1 | String myText = null;↵ | |||
2 | if (text != null)↵ | |||
3 | {↵ | |||
4 | myText = text.trim();↵ | |||
5 | }↵ | |||
6 | if (myText↵ | 1 | final boolean wasEmpty = _textLbl.getText().equals(_msgWhenEmpty);↵ | |
7 | != null && myText.length() > 0)↵ | 2 | if (value != null && value.length() > 0)↵ | |
8 | {↵ | 3 | {↵ | |
9 | _textLbl.setText(myText);↵ | 4 | _↵ | |
10 | }↵ | |||
11 | else↵ | 5 | msgWhenEmpty = value;↵ | |
6 | }↵ | |||
7 | else↵ | |||
8 | {↵ | |||
9 | _msgWhenEmpty = " ";↵ | |||
10 | }↵ | |||
11 | if (wasEmpty)↵ | |||
12 | {↵ | 12 | {↵ | |
13 | clearText();↵ | 13 | clearText();↵ | |
14 | } | 14 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.3 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 13 |
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 3 |
Time elapsed for statement mapping (ms) | 1.1 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | final boolean wasEmpty = _textLbl.getText().equals(_msgWhenEmpty); | |||||||||||||||
1 | String myText = null; | | |||||||||||||||
4 | if (myText != null && myText.length() > 0) |
| 2 | if (value != null && value.length() > 0) | |||||||||||||
|
| 3 | _msgWhenEmpty = value; | ||||||||||||||
5 | _textLbl.setText(myText); |
| | ||||||||||||||
else | | ||||||||||||||||
|
| 4 | _msgWhenEmpty = " "; | ||||||||||||||
6 | clearText(); | |
Row | Violation |
---|---|
1 | Unmatched statement _msgWhenEmpty=value; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
2 | Unmatched statement _textLbl.setText(myText); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
3 | Unmatched statement _msgWhenEmpty=" "; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
4 | The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero |