SlidingGanttCategoryDataset clone = (SlidingGanttCategoryDataset) super.clone(); if (this.underlying instanceof PublicCloneable) { PublicCloneable pc = (PublicCloneable) this.underlying; clone.underlying = (GanttCategoryDataset) pc.clone(); } return clone;
XYBarDataset clone = (XYBarDataset) super.clone(); if (this.underlying instanceof PublicCloneable) { PublicCloneable pc = (PublicCloneable) this.underlying; clone.underlying = (XYDataset) pc.clone(); } return clone;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/data/gantt/SlidingGanttCategoryDataset.java File path: /jfreechart-1.0.10/src/org/jfree/data/xy/XYBarDataset.java
Method name: Object clone() Method name: Object clone()
Number of AST nodes: 5 Number of AST nodes: 5
1
SlidingGanttCategoryDataset clone
2
                = (SlidingGanttCategoryDataset) super.clone();
1
XYBarDataset clone = (XYBarDataset) super.clone();
3
        if (this.underlying instanceof PublicCloneable) {
2
        if (this.underlying instanceof PublicCloneable) {
4
        	PublicCloneable pc = (PublicCloneable) this.underlying;
3
        	PublicCloneable pc = (PublicCloneable) this.underlying;
5
            clone.underlying = (GanttCategoryDataset) pc.clone();
4
            clone.underlying = (XYDataset) pc.clone();
6
        }
5
        }
7
        return clone;
6
        return clone;
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.3
Clones locationClones are in different classes having the same super class
Number of node comparisons13
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)5.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    SlidingGanttCategoryDataset clone = (SlidingGanttCategoryDataset)super.clone();
    1
    SlidingGanttCategoryDataset clone = (SlidingGanttCategoryDataset)super.clone();
    1
    XYBarDataset clone = (XYBarDataset)super.clone();
    Differences
    Expression1Expression2Difference
    org.jfree.data.gantt.SlidingGanttCategoryDatasetorg.jfree.data.xy.XYBarDatasetSUBCLASS_TYPE_MISMATCH
    org.jfree.data.gantt.SlidingGanttCategoryDatasetorg.jfree.data.xy.XYBarDatasetSUBCLASS_TYPE_MISMATCH
    org.jfree.data.gantt.SlidingGanttCategoryDatasetorg.jfree.data.xy.XYBarDatasetSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Super method call SlidingGanttCategoryDataset clone=(SlidingGanttCategoryDataset)super.clone(); cannot be extracted from method
    Super method call XYBarDataset clone=(XYBarDataset)super.clone(); cannot be extracted from method
    1
    XYBarDataset clone = (XYBarDataset)super.clone();
    2
    if (this.underlying instanceof PublicCloneable)
    2
    if (this.underlying instanceof PublicCloneable)
    2
    if (this.underlying instanceof PublicCloneable)
    Differences
    Expression1Expression2Difference
    org.jfree.data.gantt.GanttCategoryDatasetorg.jfree.data.xy.XYDatasetSUBCLASS_TYPE_MISMATCH
    2
    if (this.underlying instanceof PublicCloneable)
    3
    PublicCloneable pc = (PublicCloneable)this.underlying;
    3
    PublicCloneable pc = (PublicCloneable)this.underlying;
    3
    PublicCloneable pc = (PublicCloneable)this.underlying;
    Differences
    Expression1Expression2Difference
    org.jfree.data.gantt.GanttCategoryDatasetorg.jfree.data.xy.XYDatasetSUBCLASS_TYPE_MISMATCH
    3
    PublicCloneable pc = (PublicCloneable)this.underlying;
    4
    clone.underlying = (GanttCategoryDataset)pc.clone();
    4
    clone.underlying = (GanttCategoryDataset)pc.clone();
    4
    clone.underlying = (XYDataset)pc.clone();
    Differences
    Expression1Expression2Difference
    org.jfree.data.gantt.SlidingGanttCategoryDatasetorg.jfree.data.xy.XYBarDatasetSUBCLASS_TYPE_MISMATCH
    org.jfree.data.gantt.GanttCategoryDatasetorg.jfree.data.xy.XYDatasetSUBCLASS_TYPE_MISMATCH
    org.jfree.data.gantt.GanttCategoryDatasetorg.jfree.data.xy.XYDatasetSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression clone.underlying cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression clone.underlying cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression clone.underlying is a field being modified, and thus it cannot be parameterized
    Expression clone.underlying is a field being modified, and thus it cannot be parameterized
    Expression (GanttCategoryDataset)pc.clone() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression (XYDataset)pc.clone() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4
    clone.underlying = (XYDataset)pc.clone();
    5
    return clone;
    5
    return clone;
    5
    return clone;
    Differences
    Expression1Expression2Difference
    org.jfree.data.gantt.SlidingGanttCategoryDatasetorg.jfree.data.xy.XYBarDatasetSUBCLASS_TYPE_MISMATCH
    5
    return clone;
    Precondition Violations (8)
    Row Violation
    1Super method call SlidingGanttCategoryDataset clone=(SlidingGanttCategoryDataset)super.clone(); cannot be extracted from method
    2Super method call XYBarDataset clone=(XYBarDataset)super.clone(); cannot be extracted from method
    3Expression clone.underlying cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression clone.underlying cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression clone.underlying is a field being modified, and thus it cannot be parameterized
    6Expression clone.underlying is a field being modified, and thus it cannot be parameterized
    7Expression (GanttCategoryDataset)pc.clone() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression (XYDataset)pc.clone() cannot be parameterized, because it has dependencies to/from statements that will be extracted