if (p instanceof Zoomable) { Zoomable z = (Zoomable) p; // we need to guard against this.zoomPoint being null org.eclipse.swt.graphics.Point zp = (this.zoomPoint != null ? this.zoomPoint : new org.eclipse.swt.graphics.Point(0, 0)); z.zoomDomainAxes(0.0, this.info.getPlotInfo(), SWTUtils.toAwtPoint(zp)); }
if (p instanceof ValueAxisPlot) { Zoomable z = (Zoomable) p; // we need to guard against this.zoomPoint being null org.eclipse.swt.graphics.Point zp = (this.zoomPoint != null ? this.zoomPoint : new org.eclipse.swt.graphics.Point(0, 0)); z.zoomRangeAxes(0.0, this.info.getPlotInfo(), SWTUtils.toAwtPoint(zp)); }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/swt/org/jfree/experimental/chart/swt/ChartComposite.java File path: /jfreechart-1.0.10/swt/org/jfree/experimental/chart/swt/ChartComposite.java
Method name: void restoreAutoDomainBounds() Method name: void restoreAutoRangeBounds()
Number of AST nodes: 4 Number of AST nodes: 4
1
if (p instanceof Zoomable) {
1
if (p instanceof ValueAxisPlot) {
2
            Zoomable z = (Zoomable) p;
2
            Zoomable z = (Zoomable) p;
3
            // we need to guard against this.zoomPoint being null
3
            // we need to guard against this.zoomPoint being null
4
            org.eclipse.swt.graphics.Point zp = 
4
            org.eclipse.swt.graphics.Point zp = 
5
                    (this.zoomPoint != null ? this.zoomPoint 
5
                    (this.zoomPoint != null ? this.zoomPoint 
6
                    : new org.eclipse.swt.graphics.Point(0, 0));
6
                    : new org.eclipse.swt.graphics.Point(0, 0));
7
            z.zoomDomainAxes(0.0, this.info.getPlotInfo(), 
7
            z.zoomRangeAxes(0.0, this.info.getPlotInfo(), 
8
                    SWTUtils.toAwtPoint(zp));
8
                    SWTUtils.toAwtPoint(zp)); 
9
        }
9
        }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.1
Clones locationClones are declared in the same class
Number of node comparisons16
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)19.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    if (p instanceof Zoomable)
    2
    if (p instanceof Zoomable)
    2
    if (p instanceof ValueAxisPlot)
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.Zoomableorg.jfree.chart.plot.ValueAxisPlotVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.plot.Zoomable does not match with type org.jfree.chart.plot.ValueAxisPlot
    • Make classes org.jfree.chart.plot.Zoomable and org.jfree.chart.plot.ValueAxisPlot extend a common superclass
    2
    if (p instanceof ValueAxisPlot)
    3
    Zoomable z = (Zoomable)p;
    3
    Zoomable z = (Zoomable)p;
    4
    org.eclipse.swt.graphics.Point zp = (this.zoomPoint != null ? this.zoomPoint : new org.eclipse.swt.graphics.Point(0, 0));
    4
    org.eclipse.swt.graphics.Point zp = (this.zoomPoint != null ? this.zoomPoint : new org.eclipse.swt.graphics.Point(0, 0));
    5
    z.zoomDomainAxes(0.0, this.info.getPlotInfo(), SWTUtils.toAwtPoint(zp));
    5
    z.zoomDomainAxes(0.0, this.info.getPlotInfo(), SWTUtils.toAwtPoint(zp));
    5
    z.zoomRangeAxes(0.0, this.info.getPlotInfo(), SWTUtils.toAwtPoint(zp));
    Differences
    Expression1Expression2Difference
    zoomDomainAxeszoomRangeAxesMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression z.zoomDomainAxes(0.0,this.info.getPlotInfo(),SWTUtils.toAwtPoint(zp)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression z.zoomRangeAxes(0.0,this.info.getPlotInfo(),SWTUtils.toAwtPoint(zp)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression z.zoomDomainAxes(0.0,this.info.getPlotInfo(),SWTUtils.toAwtPoint(zp)) is a void method call, and thus it cannot be parameterized
    Expression z.zoomRangeAxes(0.0,this.info.getPlotInfo(),SWTUtils.toAwtPoint(zp)) is a void method call, and thus it cannot be parameterized
    5
    z.zoomRangeAxes(0.0, this.info.getPlotInfo(), SWTUtils.toAwtPoint(zp));
    Precondition Violations (5)
    Row Violation
    1Type org.jfree.chart.plot.Zoomable does not match with type org.jfree.chart.plot.ValueAxisPlot
    2Expression z.zoomDomainAxes(0.0,this.info.getPlotInfo(),SWTUtils.toAwtPoint(zp)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression z.zoomRangeAxes(0.0,this.info.getPlotInfo(),SWTUtils.toAwtPoint(zp)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression z.zoomDomainAxes(0.0,this.info.getPlotInfo(),SWTUtils.toAwtPoint(zp)) is a void method call, and thus it cannot be parameterized
    5Expression z.zoomRangeAxes(0.0,this.info.getPlotInfo(),SWTUtils.toAwtPoint(zp)) is a void method call, and thus it cannot be parameterized