super.paint(g);
if (entered || !mousehover) {
Rectangle r = g.getClipBounds();
g.drawLine(0,
r.height - this.getFontMetrics(this.getFont()).getDescent(),
this.getFontMetrics(this.getFont()).stringWidth(this.getText()),
r.height - this.getFontMetrics(this.getFont()).getDescent());
}
super.paint(g);
if (entered || !mousehover) {
Rectangle r = g.getClipBounds();
g.drawLine(0,
r.height - this.getFontMetrics(this.getFont()).getDescent(),
this.getFontMetrics(this.getFont()).stringWidth(this.getText()),
r.height - this.getFontMetrics(this.getFont()).getDescent());
}
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/base/LinkLabel.java
|
|
File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/util/URLLabel.java
|
Method name: void paint(Graphics)
|
|
Method name: void paint(Graphics)
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | super.paint(g);↵ | | 1 | super.paint(g);↵
|
|
2 | if (entered || !mousehover) {↵ | | 2 | if (entered || !mousehover) {↵
|
3 | Rectangle r = g.getClipBounds();↵ | | 3 | Rectangle r = g.getClipBounds();↵
|
|
4 | g.drawLine(0,↵ | | 4 | g.drawLine(0,↵
|
5 | r.height - this.getFontMetrics(this.getFont()).getDescent(),↵ | | 5 | r.height - this.getFontMetrics(this.getFont()).getDescent(),↵
|
6 | this.getFontMetrics(this.getFont()).stringWidth(this.getText()),↵ | | 6 | this.getFontMetrics(this.getFont()).stringWidth(this.getText()),↵
|
7 | r.height - this.getFontMetrics(this.getFont()).getDescent());↵ | | 7 | r.height - this.getFontMetrics(this.getFont()).getDescent());↵
|
8 | } | | 8 | }
|
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 in different classes having the same super class |
Number of node comparisons | 10 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 4 |
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) | 0.9 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | super.paint(g); | | 1 | super.paint(g); |
2 | if (entered || !mousehover) | | 2 | if (entered || !mousehover) |
3 | Rectangle r = g.getClipBounds(); | | 3 | Rectangle r = g.getClipBounds(); |
4 | g.drawLine(0, r.height - this.getFontMetrics(this.getFont()).getDescent(), this.getFontMetrics(this.getFont()).stringWidth(this.getText()), r.height - this.getFontMetrics(this.getFont()).getDescent()); | | 4 | g.drawLine(0, r.height - this.getFontMetrics(this.getFont()).getDescent(), this.getFontMetrics(this.getFont()).stringWidth(this.getText()), r.height - this.getFontMetrics(this.getFont()).getDescent()); |
Precondition Violations (0)
Row |
Violation |