ValueAxis existing = getDomainAxis(index);
if (existing != null) {
existing.removeChangeListener(this);
}
if (axis != null) {
axis.setPlot(this);
}
this.domainAxes.set(index, axis);
if (axis != null) {
axis.configure();
axis.addChangeListener(this);
}
if (notify) {
fireChangeEvent();
}
ValueAxis existing = getRangeAxis(index);
if (existing != null) {
existing.removeChangeListener(this);
}
if (axis != null) {
axis.setPlot(this);
}
this.rangeAxes.set(index, axis);
if (axis != null) {
axis.configure();
axis.addChangeListener(this);
}
if (notify) {
fireChangeEvent();
}
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/XYPlot.java
|
|
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/XYPlot.java
|
Method name: void setDomainAxis(int, ValueAxis, boolean)
|
|
Method name: void setRangeAxis(int, ValueAxis, boolean)
|
Number of AST nodes: 11
|
|
Number of AST nodes: 11
|
|
1 | ValueAxis existing = getDomainAxis(index);↵ | | 1 | ValueAxis existing = getRangeAxis(index);↵
|
2 | if (existing != null) {↵ | | 2 | if (existing != null) {↵
|
3 | existing.removeChangeListener(this);↵ | | 3 | existing.removeChangeListener(this);↵
|
4 | }↵ | | 4 | }↵
|
5 | if (axis != null) {↵ | | 5 | if (axis != null) {↵
|
6 | axis.setPlot(this);↵ | | 6 | axis.setPlot(this);↵
|
7 | }↵ | | 7 | }↵
|
8 | this.domainAxes.set(index, axis);↵ | | 8 | this.rangeAxes.set(index, axis);↵
|
9 | if (axis != null) {↵ | | 9 | if (axis != null) {↵
|
10 | axis.configure();↵ | | 10 | axis.configure();↵
|
11 | axis.addChangeListener(this);↵ | | 11 | axis.addChangeListener(this);↵
|
12 | }↵ | | 12 | }↵
|
13 | if (notify) {↵ | | 13 | if (notify) {↵
|
14 | fireChangeEvent();↵ | | 14 | fireChangeEvent();↵
|
15 | } | | 15 | }
|
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) | 4.9 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 50 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 11 |
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) | 751.5 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | ValueAxis existing = getDomainAxis(index); | | 1 | ValueAxis existing = getRangeAxis(index); |
2 | if (existing != null) | | 2 | if (existing != null) |
3 | existing.removeChangeListener(this); | | 3 | existing.removeChangeListener(this); |
4 | if (axis != null) | | 4 | if (axis != null) |
5 | | | 5 | |
6 | this.domainAxes.set(index, axis); | | 6 | this.rangeAxes.set(index, axis); |
7 | if (axis != null) | | 7 | if (axis != null) |
8 | | | 8 | |
9 | axis.addChangeListener(this); | | 9 | axis.addChangeListener(this); |
10 | if (notify) | | 10 | if (notify) |
11 | | | 11 | |
Precondition Violations (0)
Row |
Violation |