Rectangle insets = this.getClientArea(); int x = (int) ((screenPoint.x - insets.x) / this.scaleX); int y = (int) ((screenPoint.y - insets.y) / this.scaleY); return new Point(x, y);
Rectangle insets = this.getClientArea(); int x = (int) ((screenPoint.x - insets.x) / this.scaleX); int y = (int) ((screenPoint.y - insets.y) / this.scaleY); return new Point2D.Double(x, y);
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: Point translateScreenToJavaSWT(Point) Method name: Point2D translateScreenToJava2D(Point)
Number of AST nodes: 4 Number of AST nodes: 4
1
Rectangle insets = this.getClientArea();
1
Rectangle insets = this.getClientArea();
2
        int x = (int) ((screenPoint.x - insets.x) / this.scaleX);
2
        int x = (int) ((screenPoint.x - insets.x) / this.scaleX);
3
        int y = (int) ((screenPoint.y - insets.y) / this.scaleY);
3
        int y = (int) ((screenPoint.y - insets.y) / this.scaleY);
4
        return new Point(x, y);
4
        return new Point2D.Double(x, y);
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones locationClones are declared in the same class
Number of node comparisons16
  1. {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)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    Rectangle insets = this.getClientArea();
    1
    Rectangle insets = this.getClientArea();
    2
    int x = (int)((screenPoint.x - insets.x) / this.scaleX);
    2
    int x = (int)((screenPoint.x - insets.x) / this.scaleX);
    3
    int y = (int)((screenPoint.y - insets.y) / this.scaleY);
    3
    int y = (int)((screenPoint.y - insets.y) / this.scaleY);
    4
    return new Point(x, y);
    4
    return new Point(x, y);
    4
    return new Point2D.Double(x, y);
    Differences
    Expression1Expression2Difference
    java.awt.Pointjava.awt.geom.Point2D.DoubleSUBCLASS_TYPE_MISMATCH
    PointPoint2D.DoubleTYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression new Point(x,y) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new Point2D.Double(x,y) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4
    return new Point2D.Double(x, y);
    Precondition Violations (2)
    Row Violation
    1Expression new Point(x,y) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression new Point2D.Double(x,y) cannot be parameterized, because it has dependencies to/from statements that will be extracted