File path: /jfreechart-1.0.10/src/org/jfree/chart/ChartPanel.java | File path: /jfreechart-1.0.10/src/org/jfree/chart/editor/DefaultNumberAxisEditor.java | |||
Method name: void doEditChartProperties()
|
Method name: void attemptGridStrokeSelection()
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | ChartEditor editor = ChartEditorManager.getChartEditor(this.chart↵ | 1 | StrokeChooserPanel panel = new StrokeChooserPanel(↵ | |
2 | null, this.availableStrokeSamples↵ | |||
2 | );↵ | 3 | );↵ | |
3 | int result = JOptionPane.showConfirmDialog(this, editor,↵ | 4 | int result = JOptionPane.showConfirmDialog(↵ | |
4 | localizationResources.getString("Chart_Properties"),↵ | 5 | this, panel, localizationResources.getString("Stroke_Selection"),↵ | |
5 | JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE);↵ | 6 | JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE↵ | |
7 | );↵ | |||
6 | if (result == JOptionPane.OK_OPTION) {↵ | 8 | if (result == JOptionPane.OK_OPTION) {↵ | |
7 | editor.updateChart(this.chart);↵ | 9 | this.gridStrokeSample.setStroke(panel.getSelectedStroke());↵ | |
8 | } | 10 |
| |
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 in different classes having the same super class |
Number of node comparisons | 8 |
Number of mapped statements | 2 |
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.9 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
| 1 | StrokeChooserPanel panel = new StrokeChooserPanel(null, this.availableStrokeSamples); | ||||||||||||||||||
1 | ChartEditor editor = ChartEditorManager.getChartEditor(this.chart); | | |||||||||||||||||||
2 | int result = JOptionPane.showConfirmDialog(this, editor, localizationResources.getString("Chart_Properties"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE); |
| 2 | int result = JOptionPane.showConfirmDialog(this, panel, localizationResources.getString("Stroke_Selection"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE); | |||||||||||||||||
3 | if (result == JOptionPane.OK_OPTION) | 3 | if (result == JOptionPane.OK_OPTION) | ||||||||||||||||||
|
| 4 | this.gridStrokeSample.setStroke(panel.getSelectedStroke()); | ||||||||||||||||||
4 | editor.updateChart(this.chart); |
| |
Row | Violation |
---|---|
1 | Unmatched statement StrokeChooserPanel panel=new StrokeChooserPanel(null,this.availableStrokeSamples); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
2 | Type org.jfree.chart.editor.ChartEditor of variable editor does not match with type org.jfree.ui.StrokeChooserPanel of variable panel |
3 | Unmatched statement this.gridStrokeSample.setStroke(panel.getSelectedStroke()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
4 | Unmatched statement editor.updateChart(this.chart); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
5 | The refactoring of the clones is infeasible, because classes org.jfree.chart.ChartPanel and org.jfree.chart.editor.DefaultNumberAxisEditor do not have a common superclass |