File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/CombinedDomainCategoryPlot.java | File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/CombinedDomainXYPlot.java | |||
Method name: void remove(CategoryPlot)
|
Method name: void remove(XYPlot)
|
|||
Number of AST nodes: 18 | Number of AST nodes: 18 | |||
1 | if (subplot == null) {↵ | 1 | if (subplot == null) {↵ | |
2 | throw new IllegalArgumentException("Null 'subplot' argument.");↵ | 2 | throw new IllegalArgumentException(" Null 'subplot' argument.");↵ | |
3 | }↵ | 3 | }↵ | |
4 | int position = -1;↵ | 4 | int position = -1;↵ | |
5 | int size = this.subplots.size();↵ | 5 | int size = this.subplots.size();↵ | |
6 | int i = 0;↵ | 6 | int i = 0;↵ | |
7 | while (position == -1 && i < size) {↵ | 7 | while (position == -1 && i < size) {↵ | |
8 | if (this.subplots.get(i) == subplot) {↵ | 8 | if (this.subplots.get(i) == subplot) {↵ | |
9 | position = i;↵ | 9 | position = i;↵ | |
10 | }↵ | 10 | }↵ | |
11 | i++;↵ | 11 | i++;↵ | |
12 | }↵ | 12 | }↵ | |
13 | if (position != -1) {↵ | 13 | if (position != -1) {↵ | |
14 | this.subplots.remove(position);↵ | 14 | this.subplots.remove(position);↵ | |
15 | subplot.setParent(null);↵ | 15 | subplot.setParent(null);↵ | |
16 | subplot.removeChangeListener(this);↵ | 16 | subplot.removeChangeListener(this);↵ | |
17 | this.totalWeight -= subplot.getWeight();↵ | 17 | this.totalWeight -= subplot.getWeight();↵ | |
18 | CategoryAxis domain = getDomainAxis();↵ | 18 | ValueAxis domain = getDomainAxis();↵ | |
19 | if (domain != null) {↵ | 19 | if (domain != null) {↵ | |
20 | domain.configure();↵ | 20 | domain.configure();↵ | |
21 | }↵ | 21 | }↵ | |
22 | fireChangeEvent();↵ | 22 | fireChangeEvent();↵ | |
23 | } | 23 |
| |
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) | 1.7 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 78 |
Number of mapped statements | 18 |
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) | 135.1 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (subplot == null) |
| 1 | if (subplot == null) | |||||||||||||
2 | throw new IllegalArgumentException("Null 'subplot' argument."); |
| 2 | throw new IllegalArgumentException(" Null 'subplot' argument."); | |||||||||||||
3 | int position = -1; | 3 | int position = -1; | ||||||||||||||
4 | int size = this.subplots.size(); | 4 | int size = this.subplots.size(); | ||||||||||||||
5 | int i = 0; | 5 | int i = 0; | ||||||||||||||
6 | while (position == -1 && i < size) | 6 | while (position == -1 && i < size) | ||||||||||||||
7 | if (this.subplots.get(i) == subplot) |
| 7 | if (this.subplots.get(i) == subplot) | |||||||||||||
8 | position = i; | 8 | position = i; | ||||||||||||||
9 | i++; | 9 | i++; | ||||||||||||||
10 | if (position != -1) | 10 | if (position != -1) | ||||||||||||||
11 | this.subplots.remove(position); | 11 | this.subplots.remove(position); | ||||||||||||||
12 | subplot.setParent(null); |
| 12 | subplot.setParent(null); | |||||||||||||
13 | subplot.removeChangeListener(this); |
| 13 | subplot.removeChangeListener(this); | |||||||||||||
14 | this.totalWeight -= subplot.getWeight(); |
| 14 | this.totalWeight -= subplot.getWeight(); | |||||||||||||
15 | CategoryAxis domain = getDomainAxis(); |
| 15 | ValueAxis domain = getDomainAxis(); | |||||||||||||
16 | if (domain != null) |
| 16 | if (domain != null) | |||||||||||||
17 | domain.configure(); |
| 17 | domain.configure(); | |||||||||||||
18 | fireChangeEvent(); | 18 | fireChangeEvent(); |
Row | Violation |
---|---|
1 | Expression subplot cannot be unified with expression subplot , because common superclass org.jfree.chart.plot.Plot does not declare member(s) public int getWeight() |