File path: /jfreechart-1.0.10/src/org/jfree/chart/editor/DefaultNumberAxisEditor.java | File path: /jfreechart-1.0.10/src/org/jfree/chart/editor/DefaultNumberAxisEditor.java | |||
Method name: void validateMinimum()
|
Method name: void validateMaximum()
|
|||
Number of AST nodes: 7 | Number of AST nodes: 7 | |||
1 | double newMin;↵ | 1 | double newMax;↵ | |
2 | try {↵ | 2 | try {↵ | |
3 | newMin = Double.parseDouble(this.minimumRangeValue.getText());↵ | 3 | newMax = Double.parseDouble(this.maximumRangeValue.getText());↵ | |
4 | if (newMin >= this.maximumValue) {↵ | 4 | if (newMax <= this.minimumValue) {↵ | |
5 | newMin = this.minimumValue;↵ | 5 | newMax = this.maximumValue;↵ | |
6 | }↵ | 6 | }↵ | |
7 | }↵ | 7 | }↵ | |
8 | catch (NumberFormatException e) {↵ | 8 | catch (NumberFormatException e) {↵ | |
9 | newMin = this.minimumValue;↵ | 9 | newMax = this.maximumValue;↵ | |
10 | }↵ | 10 | }↵ | |
11 | this.minimumValue = newMin;↵ | 11 | this.maximumValue = newMax;↵ | |
12 | this.minimumRangeValue.setText(Double.toString(this.minimumValue)); | 12 | this.maximumRangeValue.setText(Double.toString(this.maximumValue)); | |
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.2 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 10 |
Number of mapped statements | 5 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 2.6 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | double newMin; |
| 1 | double newMax; | |||||||||||||||
2 | try |
| 2 | try | |||||||||||||||
3 | newMin = Double.parseDouble(this.minimumRangeValue.getText()); |
| 3 | newMax = Double.parseDouble(this.maximumRangeValue.getText()); | |||||||||||||||
|
| 4 | if (newMax <= this.minimumValue) | ||||||||||||||||
|
| 5 | newMax = this.maximumValue; | ||||||||||||||||
4 | if (newMin >= this.maximumValue) |
| | ||||||||||||||||
5 | newMin = this.minimumValue; |
| | ||||||||||||||||
6 | this.minimumValue = newMin; |
| 6 | this.maximumValue = newMax; | |||||||||||||||
7 | this.minimumRangeValue.setText(Double.toString(this.minimumValue)); |
| 7 | this.maximumRangeValue.setText(Double.toString(this.maximumValue)); |
Row | Violation |
---|---|
1 | Expression this.minimumValue cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression this.maximumValue cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement if(newMax <= this.minimumValue) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Unmatched statement newMax=this.maximumValue; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
5 | Unmatched statement if(newMin >= this.maximumValue) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
6 | Unmatched statement newMin=this.minimumValue; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
7 | Expression this.minimumValue is a field being modified, and thus it cannot be parameterized |
8 | Expression this.maximumValue is a field being modified, and thus it cannot be parameterized |
9 | Expression this.minimumValue cannot be parameterized, because it has dependencies to/from statements that will be extracted |
10 | Expression this.maximumValue cannot be parameterized, because it has dependencies to/from statements that will be extracted |