if (last > axisMax) { // this is the last period, but it is only partially visible // so check that the label will fit before displaying it... Rectangle2D bb = TextUtilities.getTextBounds(label, g2, g2.getFontMetrics()); if ((x + bb.getWidth() / 2) > dataArea.getMaxX()) { float xstart = (float) valueToJava2D(Math.max(first, axisMin), dataArea, edge); if (bb.getWidth() < (dataArea.getMaxX() - xstart)) { x = ((float) dataArea.getMaxX() + xstart) / 2.0f; } else { label = null;
if (first < axisMin) { // this is the first period, but it is only partially visible // so check that the label will fit before displaying it... Rectangle2D bb = TextUtilities.getTextBounds(label, g2, g2.getFontMetrics()); if ((x - bb.getWidth() / 2) < dataArea.getX()) { float xlast = (float) valueToJava2D(Math.min(last, axisMax), dataArea, edge); if (bb.getWidth() < (xlast - dataArea.getX())) { x = (xlast + (float) dataArea.getX()) / 2.0f; } else { label = null;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/PeriodAxis.java File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/PeriodAxis.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
if (last > axisMax) {
1
if (first < axisMin) {
2
                // this is the last period, but it is only partially visible 
2
                // this is the first period, but it is only partially visible 
3
                // so check that the label will fit before displaying it...
3
                // so check that the label will fit before displaying it...
4
                Rectangle2D bb = TextUtilities.getTextBounds(label, g2, 
4
                Rectangle2D bb = TextUtilities.getTextBounds(label, g2, 
5
                        g2.getFontMetrics());
5
                        g2.getFontMetrics());
6
                if ((x + bb.getWidth() / 2) > dataArea.getMaxX()) {
6
                if ((x - bb.getWidth() / 2) < dataArea.getX()) {
7
                    float xstart = (float) valueToJava2D(Math.max(first, 
7
                    float xlast = (float) valueToJava2D(Math.min(last, 
8
                            axisMin), dataArea, edge);
8
                            axisMax), dataArea, edge);
9
                    if (bb.getWidth() < (dataArea.getMaxX() - xstart)) {
9
                    if (bb.getWidth() < (xlast - dataArea.getX())) {
10
                        x = ((float) dataArea.getMaxX() + xstart) / 2.0f;   
10
                        x = (xlast + (float) dataArea.getX()) / 2.0f;   
11
                    }
11
                    }
12
                    else {
12
                    else {
13
                        label = null;
13
                        label = null;
14
                    
14
                    
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