File path: /jfreechart-1.0.10/swt/org/jfree/experimental/swt/SWTUtils.java | File path: /jfreechart-1.0.10/swt/org/jfree/experimental/swt/SWTUtils.java | |||
Method name: FontData toSwtFontData(Device, java.awt.Font, boolean)
|
Method name: FontData toSwtFontData(Device, java.awt.Font, boolean)
|
|||
Number of AST nodes: 6 | Number of AST nodes: 6 | |||
1 | while (tmpGC.textExtent(Az).x ↵ | 1 | while (tmpGC.textExtent(Az).x ↵ | |
2 | > DUMMY_PANEL.getFontMetrics(font).stringWidth(Az)) {↵ | 2 | < DUMMY_PANEL.getFontMetrics(font).stringWidth(Az)) {↵ | |
3 | tmpFont.dispose();↵ | 3 | tmpFont.dispose();↵ | |
4 | height--;↵ | 4 | height++;↵ | |
5 | fontData.setHeight(height);↵ | 5 | fontData.setHeight(height);↵ | |
6 | tmpFont = new Font(device, fontData);↵ | 6 | tmpFont = new Font(device, fontData);↵ | |
7 | tmpGC.setFont(tmpFont);↵ | 7 | tmpGC.setFont(tmpFont);↵ | |
8 | } | 8 |
| |
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.6 |
Clones location | Clones are in the same method |
Number of node comparisons | 37 |
Number of mapped statements | 5 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 4.4 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
25 | while (tmpGC.textExtent(Az).x > DUMMY_PANEL.getFontMetrics(font).stringWidth(Az)) |
| 32 | while (tmpGC.textExtent(Az).x < DUMMY_PANEL.getFontMetrics(font).stringWidth(Az)) | ||||||||||
26 | tmpFont.dispose(); | 33 | tmpFont.dispose(); | |||||||||||
27 | height--; |
| | |||||||||||
|
| 34 | height++; | |||||||||||
28 | fontData.setHeight(height); | 35 | fontData.setHeight(height); | |||||||||||
29 | tmpFont = new Font(device, fontData); | 36 | tmpFont = new Font(device, fontData); | |||||||||||
30 | tmpGC.setFont(tmpFont); | 37 | tmpGC.setFont(tmpFont); |
Row | Violation |
---|---|
1 | Unmatched statement height--; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement height++; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |