File path: /jfreechart-1.0.10/src/org/jfree/chart/editor/DefaultNumberAxisEditor.java | File path: /jfreechart-1.0.10/src/org/jfree/chart/editor/DefaultPlotEditor.java | |||
Method name: void actionPerformed(ActionEvent)
|
Method name: void actionPerformed(ActionEvent)
|
|||
Number of AST nodes: 12 | Number of AST nodes: 13 | |||
1 | String command = event.getActionCommand();↵ | 1 | String command = event.getActionCommand();↵ | |
2 | if (command.equals("GridStroke")) {↵ | 2 | if (command.equals("BackgroundPaint")) {↵ | |
3 | attemptGridStrokeSelection();↵ | 3 | attemptBackgroundPaintSelection();↵ | |
4 | }↵ | 4 | }↵ | |
5 | else if (command.equals("GridPaint")) {↵ | 5 | else if (command.equals("OutlineStroke")) {↵ | |
6 | attemptGridPaintSelection();↵ | 6 | attemptOutlineStrokeSelection();↵ | |
7 | }↵ | 7 | }↵ | |
8 | else if (command.equals("AutoRangeOnOff")) {↵ | 8 | else if (command.equals("OutlinePaint")) {↵ | |
9 | toggleAutoRange();↵ | 9 | attemptOutlinePaintSelection();↵ | |
10 | }↵ | 10 | }↵ | |
11 | else if (command.equals("MinimumRange")) {↵ | 11 | // else if (command.equals("Insets")) {↵ | |
12 | validateMinimum();↵ | 12 | // editInsets();↵ | |
13 | }↵ | 13 | // }↵ | |
14 | else if (command.equals("MaximumRange")) {↵ | 14 | else if (command.equals("Orientation")) {↵ | |
15 | validateMaximum();↵ | 15 | attemptOrientationSelection();↵ | |
16 | }↵ | 16 | }↵ | |
17 | else {↵ | 17 | else ↵ | |
18 | // pass to the super-class for handling↵ | |||
19 | super.actionPerformed(event↵ | 18 | if (command.equals("DrawLines")) {↵ | |
19 | attemptDrawLinesSelection();↵ | |||
20 | }↵ | |||
21 | else if (command.equals("DrawShapes")) {↵ | |||
20 | );↵ | 22 | attemptDrawShapesSelection();↵ | |
21 | } | 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.4 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 95 |
Number of mapped statements | 11 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 12 |
Time elapsed for statement mapping (ms) | 4.7 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | String command = event.getActionCommand(); | 1 | String command = event.getActionCommand(); | ||||||||||||||
|
| 2 | if (command.equals("BackgroundPaint")) | ||||||||||||||
|
| 3 | attemptBackgroundPaintSelection(); | ||||||||||||||
|
| 4 | else if (command.equals("OutlineStroke")) | ||||||||||||||
2 | if (command.equals("GridStroke")) |
| 4 | if (command.equals("OutlineStroke")) | |||||||||||||
|
| 5 | attemptOutlineStrokeSelection(); | ||||||||||||||
3 | attemptGridStrokeSelection(); |
| 5 | attemptOutlineStrokeSelection(); | |||||||||||||
|
| 6 | else if (command.equals("OutlinePaint")) | ||||||||||||||
|
| 7 | attemptOutlinePaintSelection(); | ||||||||||||||
|
| 8 | else if (command.equals("Orientation")) | ||||||||||||||
|
| 9 | attemptOrientationSelection(); | ||||||||||||||
|
| 10 | else if (command.equals("DrawLines")) | ||||||||||||||
|
| 11 | attemptDrawLinesSelection(); | ||||||||||||||
|
| 12 | else if (command.equals("DrawShapes")) | ||||||||||||||
|
| 13 | attemptDrawShapesSelection(); | ||||||||||||||
4 | else if (command.equals("GridPaint")) |
| 6 | else if (command.equals("OutlinePaint")) | |||||||||||||
5 | attemptGridPaintSelection(); |
| 7 | attemptOutlinePaintSelection(); | |||||||||||||
6 | else if (command.equals("AutoRangeOnOff")) |
| 8 | else if (command.equals("Orientation")) | |||||||||||||
7 | toggleAutoRange(); |
| 9 | attemptOrientationSelection(); | |||||||||||||
8 | else if (command.equals("MinimumRange")) |
| 10 | else if (command.equals("DrawLines")) | |||||||||||||
9 | validateMinimum(); |
| 11 | attemptDrawLinesSelection(); | |||||||||||||
10 | else if (command.equals("MaximumRange")) |
| 12 | else if (command.equals("DrawShapes")) | |||||||||||||
11 | validateMaximum(); |
| 13 | attemptDrawShapesSelection(); | |||||||||||||
else | | ||||||||||||||||
12 | super.actionPerformed(event); | |
Row | Violation |
---|---|
1 | Unmatched statement if(command.equals("BackgroundPaint")) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement attemptBackgroundPaintSelection(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
3 | Unmatched statement if(command.equals("OutlineStroke")) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Unmatched statement attemptOutlineStrokeSelection(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
5 | Expression attemptGridStrokeSelection() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression attemptGridStrokeSelection() is a void method call, and thus it cannot be parameterized |
7 | Expression attemptOutlineStrokeSelection() is a void method call, and thus it cannot be parameterized |
8 | Unmatched statement if(command.equals("OutlinePaint")) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
9 | Unmatched statement attemptOutlinePaintSelection(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
10 | Unmatched statement if(command.equals("Orientation")) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
11 | Unmatched statement attemptOrientationSelection(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
12 | Unmatched statement if(command.equals("DrawLines")) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
13 | Unmatched statement attemptDrawLinesSelection(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
14 | Unmatched statement if(command.equals("DrawShapes")) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
15 | Unmatched statement attemptDrawShapesSelection(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
16 | Expression attemptGridPaintSelection() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
17 | Expression attemptGridPaintSelection() is a void method call, and thus it cannot be parameterized |
18 | Expression attemptOutlinePaintSelection() is a void method call, and thus it cannot be parameterized |
19 | Expression toggleAutoRange() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
20 | Expression toggleAutoRange() is a void method call, and thus it cannot be parameterized |
21 | Expression attemptOrientationSelection() is a void method call, and thus it cannot be parameterized |
22 | Expression validateMinimum() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
23 | Expression validateMinimum() is a void method call, and thus it cannot be parameterized |
24 | Expression attemptDrawLinesSelection() is a void method call, and thus it cannot be parameterized |
25 | Expression validateMaximum() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
26 | Expression validateMaximum() is a void method call, and thus it cannot be parameterized |
27 | Expression attemptDrawShapesSelection() is a void method call, and thus it cannot be parameterized |
28 | The refactoring of the clones is infeasible, because classes org.jfree.chart.editor.DefaultNumberAxisEditor and org.jfree.chart.editor.DefaultPlotEditor do not have a common superclass |