if (ALIGNMENT) {
button.setVerticalTextPosition(SwingConstants.BOTTOM);
button.setHorizontalTextPosition(SwingConstants.CENTER);
} else {
button.setVerticalTextPosition(SwingConstants.CENTER);
button.setHorizontalTextPosition(SwingConstants.RIGHT);
}
if (ALIGNMENT) {
button.setVerticalTextPosition(SwingConstants.BOTTOM);
button.setHorizontalTextPosition(SwingConstants.CENTER);
} else {
button.setVerticalTextPosition(SwingConstants.CENTER);
button.setHorizontalTextPosition(SwingConstants.RIGHT);
}
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/toolbar/ToolBarButtonFactory.java
|
|
File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/toolbar/ToolBarButtonFactory.java
|
Method name: JButton createButton(AbstractColumbaAction)
|
|
Method name: JButton createButton(String, ImageIcon, boolean)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | if (ALIGNMENT) {↵ | | 1 | if (ALIGNMENT) {↵
|
2 | button.setVerticalTextPosition(SwingConstants.BOTTOM);↵ | | 2 | button.setVerticalTextPosition(SwingConstants.BOTTOM);↵
|
3 | button.setHorizontalTextPosition(SwingConstants.CENTER);↵ | | 3 | button.setHorizontalTextPosition(SwingConstants.CENTER);↵
|
4 | } else {↵ | | 4 | } else {↵
|
5 | button.setVerticalTextPosition(SwingConstants.CENTER);↵ | | 5 | button.setVerticalTextPosition(SwingConstants.CENTER);↵
|
6 | button.setHorizontalTextPosition(SwingConstants.RIGHT);↵ | | 6 | button.setHorizontalTextPosition(SwingConstants.RIGHT);↵
|
7 | } | | 7 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.1 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 26 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 5 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 2.6 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
19 | if (ALIGNMENT) | | 12 | if (ALIGNMENT) |
20 | button.setVerticalTextPosition(SwingConstants.BOTTOM); | | 13 | button.setVerticalTextPosition(SwingConstants.BOTTOM); |
21 | button.setHorizontalTextPosition(SwingConstants.CENTER); | | 14 | button.setHorizontalTextPosition(SwingConstants.CENTER); |
| | | | |
22 | button.setVerticalTextPosition(SwingConstants.CENTER); | | 15 | button.setVerticalTextPosition(SwingConstants.CENTER); |
23 | button.setHorizontalTextPosition(SwingConstants.RIGHT); | | 16 | button.setHorizontalTextPosition(SwingConstants.RIGHT); |
Precondition Violations (0)
Row |
Violation |