if (subplot == null) { throw new IllegalArgumentException("Null 'subplot' argument."); } int position = -1; int size = this.subplots.size(); int i = 0; while (position == -1 && i < size) { if (this.subplots.get(i) == subplot) { position = i; } i++; } if (position != -1) { this.subplots.remove(position); subplot.setParent(null); subplot.removeChangeListener(this); this.totalWeight -= subplot.getWeight(); CategoryAxis domain = getDomainAxis(); if (domain != null) { domain.configure(); } fireChangeEvent(); }
if (subplot == null) { throw new IllegalArgumentException(" Null 'subplot' argument."); } int position = -1; int size = this.subplots.size(); int i = 0; while (position == -1 && i < size) { if (this.subplots.get(i) == subplot) { position = i; } i++; } if (position != -1) { this.subplots.remove(position); subplot.setParent(null); subplot.removeChangeListener(this); this.totalWeight -= subplot.getWeight(); ValueAxis domain = getDomainAxis(); if (domain != null) { domain.configure(); } fireChangeEvent(); }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/CombinedDomainCategoryPlot.java File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/CombinedDomainXYPlot.java
Method name: void remove(CategoryPlot) Method name: void remove(XYPlot)
Number of AST nodes: 18 Number of AST nodes: 18
1
if (subplot == null) {
1
if (subplot == null) {
2
            throw new IllegalArgumentException("Null 'subplot' argument.");
2
            throw new IllegalArgumentException(" Null 'subplot' argument.");
3
        }
3
        }
4
        int position = -1;
4
        int position = -1;
5
        int size = this.subplots.size();
5
        int size = this.subplots.size();
6
        int i = 0;
6
        int i = 0;
7
        while (position == -1 && i < size) {
7
        while (position == -1 && i < size) {
8
            if (this.subplots.get(i) == subplot) {
8
            if (this.subplots.get(i) == subplot) {
9
                position = i;
9
                position = i;
10
            }
10
            }
11
            i++;
11
            i++;
12
        }
12
        }
13
        if (position != -1) {
13
        if (position != -1) {
14
            this.subplots.remove(position);
14
            this.subplots.remove(position);
15
            subplot.setParent(null);
15
            subplot.setParent(null);
16
            subplot.removeChangeListener(this);
16
            subplot.removeChangeListener(this);
17
            this.totalWeight -= subplot.getWeight();
17
            this.totalWeight -= subplot.getWeight();
18
            CategoryAxis domain = getDomainAxis();
18
            ValueAxis domain = getDomainAxis();
19
            if (domain != null) {
19
            if (domain != null) {
20
                domain.configure();
20
                domain.configure();
21
            }
21
            }
22
            fireChangeEvent();
22
            fireChangeEvent();
23
        }
23
        }
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)1.7
Clones locationClones are in different classes having the same super class
Number of node comparisons78
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements18
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)135.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (subplot == null)
    1
    if (subplot == null)
    1
    if (subplot == null)
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.CategoryPlotorg.jfree.chart.plot.XYPlotSUBCLASS_TYPE_MISMATCH
    1
    if (subplot == null)
    2
    throw new IllegalArgumentException("Null 'subplot' argument.");
    2
    throw new IllegalArgumentException("Null 'subplot' argument.");
    2
    throw new IllegalArgumentException(" Null 'subplot' argument.");
    Differences
    Expression1Expression2Difference
    "Null 'subplot' argument."" Null 'subplot' argument."LITERAL_VALUE_MISMATCH
    2
    throw new IllegalArgumentException(" Null 'subplot' argument.");
    3
    int position = -1;
    3
    int position = -1;
    4
    int size = this.subplots.size();
    4
    int size = this.subplots.size();
    5
    int i = 0;
    5
    int i = 0;
    6
    while (position == -1 && i < size)
    6
    while (position == -1 && i < size)
    7
    if (this.subplots.get(i) == subplot)
    7
    if (this.subplots.get(i) == subplot)
    7
    if (this.subplots.get(i) == subplot)
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.CategoryPlotorg.jfree.chart.plot.XYPlotSUBCLASS_TYPE_MISMATCH
    7
    if (this.subplots.get(i) == subplot)
    8
    position = i;
    8
    position = i;
    9
    i++;
    9
    i++;
    10
    if (position != -1)
    10
    if (position != -1)
    11
    this.subplots.remove(position);
    11
    this.subplots.remove(position);
    12
    subplot.setParent(null);
    12
    subplot.setParent(null);
    12
    subplot.setParent(null);
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.CategoryPlotorg.jfree.chart.plot.XYPlotSUBCLASS_TYPE_MISMATCH
    12
    subplot.setParent(null);
    13
    subplot.removeChangeListener(this);
    13
    subplot.removeChangeListener(this);
    13
    subplot.removeChangeListener(this);
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.CategoryPlotorg.jfree.chart.plot.XYPlotSUBCLASS_TYPE_MISMATCH
    13
    subplot.removeChangeListener(this);
    14
    this.totalWeight -= subplot.getWeight();
    14
    this.totalWeight -= subplot.getWeight();
    14
    this.totalWeight -= subplot.getWeight();
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.CategoryPlotorg.jfree.chart.plot.XYPlotSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression subplot cannot be unified with expression subplot , because common superclass org.jfree.chart.plot.Plot does not declare member(s) public int getWeight()
    14
    this.totalWeight -= subplot.getWeight();
    15
    CategoryAxis domain = getDomainAxis();
    15
    CategoryAxis domain = getDomainAxis();
    15
    ValueAxis domain = getDomainAxis();
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.CategoryAxisorg.jfree.chart.axis.ValueAxisSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.axis.CategoryAxisorg.jfree.chart.axis.ValueAxisSUBCLASS_TYPE_MISMATCH
    15
    ValueAxis domain = getDomainAxis();
    16
    if (domain != null)
    16
    if (domain != null)
    16
    if (domain != null)
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.CategoryAxisorg.jfree.chart.axis.ValueAxisSUBCLASS_TYPE_MISMATCH
    16
    if (domain != null)
    17
    domain.configure();
    17
    domain.configure();
    17
    domain.configure();
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.CategoryAxisorg.jfree.chart.axis.ValueAxisSUBCLASS_TYPE_MISMATCH
    17
    domain.configure();
    18
    fireChangeEvent();
    18
    fireChangeEvent();
    Precondition Violations (1)
    Row Violation
    1Expression subplot cannot be unified with expression subplot , because common superclass org.jfree.chart.plot.Plot does not declare member(s) public int getWeight()