Comparable key = this.dataset.getColumnKey(c);
Paint p = piePlot.getSectionPaint(key);
if (p == null) {
p = (Paint) this.sectionPaints.get(key);
if (p == null) {
p = getDrawingSupplier().getNextPaint();
}
}
this.sectionPaints.put(key, p);
Comparable key = this.dataset.getRowKey(r);
Paint p = piePlot.getSectionPaint(key);
if (p == null) {
p = (Paint) this.sectionPaints.get(key);
if (p == null) {
p = getDrawingSupplier().getNextPaint();
}
}
this.sectionPaints.put(key, p);
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/MultiplePiePlot.java
|
|
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/MultiplePiePlot.java
|
Method name: void prefetchSectionPaints()
|
|
Method name: void prefetchSectionPaints()
|
Number of AST nodes: 7
|
|
Number of AST nodes: 7
|
|
1 | Comparable key = this.dataset.getColumnKey(c);↵ | | 1 | Comparable key = this.dataset.getRowKey(r);↵
|
2 | Paint p = piePlot.getSectionPaint(key);↵ | | 2 | Paint p = piePlot.getSectionPaint(key);↵
|
3 | if (p == null) {↵ | | 3 | if (p == null) {↵
|
4 | p = (Paint) this.sectionPaints.get(key);↵ | | 4 | p = (Paint) this.sectionPaints.get(key);↵
|
5 | if (p == null) {↵ | | 5 | if (p == null) {↵
|
6 | p = getDrawingSupplier().getNextPaint();↵ | | 6 | p = getDrawingSupplier().getNextPaint();↵
|
7 | }↵ | | 7 | }↵
|
8 | }↵ | | 8 | }↵
|
9 | this.sectionPaints.put(key, p); | | 9 | this.sectionPaints.put(key, p);
|
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.4 |
Clones location | Clones are in the same method |
Number of node comparisons | 18 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 7 |
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.5 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
4 | Comparable key = this.dataset.getColumnKey(c); | | 12 | Comparable key = this.dataset.getRowKey(r); |
5 | Paint p = piePlot.getSectionPaint(key); | | 13 | Paint p = piePlot.getSectionPaint(key); |
6 | if (p == null) | | 14 | if (p == null) |
7 | p = (Paint)this.sectionPaints.get(key); | | 15 | p = (Paint)this.sectionPaints.get(key); |
8 | | | 16 | |
9 | p = getDrawingSupplier().getNextPaint(); | | 17 | p = getDrawingSupplier().getNextPaint(); |
10 | this.sectionPaints.put(key, p); | | 18 | this.sectionPaints.put(key, p); |
Precondition Violations (0)
Row |
Violation |