if (oldValue == null) { if (greenForIncrease) { plot.setSectionPaint(key, Color.green); } else { plot.setSectionPaint(key, Color.red); } if (showDifference) { series.setValue(key + " (+100%)", newValue); } } else { double percentChange = (newValue.doubleValue() / oldValue.doubleValue() - 1.0) * 100.0; double shade = (Math.abs(percentChange) >= percentDiffForMaxScale ? 255 : Math.abs(percentChange) * colorPerPercent); if (greenForIncrease && newValue.doubleValue() > oldValue.doubleValue() || !greenForIncrease && newValue.doubleValue() < oldValue.doubleValue()) { plot.setSectionPaint(key, new Color(0, (int) shade, 0)); } else { plot.setSectionPaint(key, new Color((int) shade, 0, 0)); } if (showDifference) {
if (oldValue == null) { if (greenForIncrease) { plot.setSectionPaint(key, Color.green); } else { plot.setSectionPaint(key, Color.red); } if (showDifference) { series.setValue(key + " (+100%)", newValue); } } else { double percentChange = (newValue.doubleValue() / oldValue.doubleValue() - 1.0) * 100.0; double shade = (Math.abs(percentChange) >= percentDiffForMaxScale ? 255 : Math.abs(percentChange) * colorPerPercent); if (greenForIncrease && newValue.doubleValue() > oldValue.doubleValue() || !greenForIncrease && newValue.doubleValue() < oldValue.doubleValue()) { plot.setSectionPaint(key, new Color(0, (int) shade, 0)); } else { plot.setSectionPaint(key, new Color((int) shade, 0, 0)); } if (showDifference) {
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/ChartFactory.java File path: /jfreechart-1.0.10/src/org/jfree/chart/ChartFactory.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
if (oldValue == null) {
1
if (oldValue == null) {
2
                if (greenForIncrease) {
2
                if (greenForIncrease) {
3
                    plot.setSectionPaint(key, Color.green);
3
                    plot.setSectionPaint(key, Color.green);
4
                } 
4
                } 
5
                else {
5
                else {
6
                    plot.setSectionPaint(key, Color.red);
6
                    plot.setSectionPaint(key, Color.red);
7
                }
7
                }
8
                if (showDifference) {
8
                if (showDifference) {
9
                    series.setValue(key + " (+100%)", newValue);
9
                    series.setValue(key + " (+100%)", newValue);
10
                }
10
                }
11
            }
11
            }
12
            else {
12
            else {
13
                double percentChange = (newValue.doubleValue() 
13
                double percentChange = (newValue.doubleValue() 
14
                        / oldValue.doubleValue() - 1.0) * 100.0;
14
                        / oldValue.doubleValue() - 1.0) * 100.0;
15
                double shade
15
                double shade
16
                    = (Math.abs(percentChange) >= percentDiffForMaxScale ? 255
16
                    = (Math.abs(percentChange) >= percentDiffForMaxScale ? 255
17
                    : Math.abs(percentChange) * colorPerPercent);
17
                    : Math.abs(percentChange) * colorPerPercent);
18
                if (greenForIncrease 
18
                if (greenForIncrease 
19
                        && newValue.doubleValue() > oldValue.doubleValue()
19
                        && newValue.doubleValue() > oldValue.doubleValue()
20
                        || !greenForIncrease && newValue.doubleValue() 
20
                        || !greenForIncrease && newValue.doubleValue() 
21
                        < oldValue.doubleValue()) {
21
                        < oldValue.doubleValue()) {
22
                    plot.setSectionPaint(key, new Color(0, (int) shade, 0));
22
                    plot.setSectionPaint(key, new Color(0, (int) shade, 0));
23
                }
23
                }
24
                else {
24
                else {
25
                    plot.setSectionPaint(key, new Color((int) shade, 0, 0));
25
                    plot.setSectionPaint(key, new Color((int) shade, 0, 0));
26
                }
26
                }
27
                if (showDifference) {
27
                if (showDifference) {
28
                    
28
                    
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones location
Number of node comparisons0