CloneSet64


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
64201.000statement_sequence[9]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
164337
E:/TSE/Projects-CloneDR/jfreechart-1.0.10/src/org/jfree/chart/ChartFactory.java
264463
E:/TSE/Projects-CloneDR/jfreechart-1.0.10/src/org/jfree/chart/ChartFactory.java
Next
Last
Clone Instance
1
Line Count
64
Source Line
337
Source File
E:/TSE/Projects-CloneDR/jfreechart-1.0.10/src/org/jfree/chart/ChartFactory.java

List keys = dataset.getKeys();
DefaultPieDataset series = null;
if (showDifference) {
  series = new DefaultPieDataset();
}
double colorPerPercent = 255.0 / percentDiffForMaxScale;
for (Iterator it = keys.iterator(); it.hasNext();) {
  Comparable key = (Comparable) it.next();
  Number newValue = dataset.getValue(key);
  Number oldValue = previousDataset.getValue(key);
  if (oldValue == null) {
    if (greenForIncrease) {
      plot.setSectionPaint(key, Color.green);
    }
    else {
      plot.setSectionPaint(key, Color.red);
    }
    if (showDifference) {
      series.setValue(key + " (+100%)", newValue);
    }
  }
  else {
    double percentChange = (newValue.doubleValue() / oldValue.doubleValue() - 1.0) * 100.0;
    double shade = (Math.abs(percentChange) >= percentDiffForMaxScale ? 255: Math.abs(percentChange) * colorPerPercent);
    if (greenForIncrease && newValue.doubleValue() > oldValue.doubleValue() || !greenForIncrease && newValue.doubleValue() < oldValue.doubleValue()) {
      plot.setSectionPaint(key, new Color(0, (int) shade, 0));
    }
    else {
      plot.setSectionPaint(key, new Color((int) shade, 0, 0));
    }
    if (showDifference) {
      series.setValue(key + " (" + (percentChange >= 0 ? "+": "") + NumberFormat.getPercentInstance().format(percentChange / 100.0) + ")", newValue);
    }
  }
}
if (showDifference) {
  plot.setDataset(series);
}
JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend);
if (subTitle) {
  TextTitle subtitle = null;
  subtitle = new TextTitle("Bright " + (greenForIncrease ? "red": "green") + "=change >=-" + percentDiffForMaxScale + "%, Bright " + ( !greenForIncrease ? "red": "green") + "=change >=+" + percentDiffForMaxScale + "%", new Font("SansSerif", Font.PLAIN, 10));
  chart.addSubtitle(subtitle);
}
return chart;


First
Previous
Clone Instance
2
Line Count
64
Source Line
463
Source File
E:/TSE/Projects-CloneDR/jfreechart-1.0.10/src/org/jfree/chart/ChartFactory.java

List keys = dataset.getKeys();
DefaultPieDataset series = null;
if (showDifference) {
  series = new DefaultPieDataset();
}
double colorPerPercent = 255.0 / percentDiffForMaxScale;
for (Iterator it = keys.iterator(); it.hasNext();) {
  Comparable key = (Comparable) it.next();
  Number newValue = dataset.getValue(key);
  Number oldValue = previousDataset.getValue(key);
  if (oldValue == null) {
    if (greenForIncrease) {
      plot.setSectionPaint(key, Color.green);
    }
    else {
      plot.setSectionPaint(key, Color.red);
    }
    if (showDifference) {
      series.setValue(key + " (+100%)", newValue);
    }
  }
  else {
    double percentChange = (newValue.doubleValue() / oldValue.doubleValue() - 1.0) * 100.0;
    double shade = (Math.abs(percentChange) >= percentDiffForMaxScale ? 255: Math.abs(percentChange) * colorPerPercent);
    if (greenForIncrease && newValue.doubleValue() > oldValue.doubleValue() || !greenForIncrease && newValue.doubleValue() < oldValue.doubleValue()) {
      plot.setSectionPaint(key, new Color(0, (int) shade, 0));
    }
    else {
      plot.setSectionPaint(key, new Color((int) shade, 0, 0));
    }
    if (showDifference) {
      series.setValue(key + " (" + (percentChange >= 0 ? "+": "") + NumberFormat.getPercentInstance().format(percentChange / 100.0) + ")", newValue);
    }
  }
}
if (showDifference) {
  plot.setDataset(series);
}
JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend);
if (subTitle) {
  TextTitle subtitle = null;
  subtitle = new TextTitle("Bright " + (greenForIncrease ? "red": "green") + "=change >=-" + percentDiffForMaxScale + "%, Bright " + ( !greenForIncrease ? "red": "green") + "=change >=+" + percentDiffForMaxScale + "%", new Font("SansSerif", Font.PLAIN, 10));
  chart.addSubtitle(subtitle);
}
return chart;


Clone AbstractionParameter Count: 0Parameter Bindings

List keys = dataset.getKeys();
DefaultPieDataset series = null;
if (showDifference) {
  series = new DefaultPieDataset();
}
double colorPerPercent = 255.0 / percentDiffForMaxScale;
for (Iterator it = keys.iterator(); it.hasNext();) {
  Comparable key = (Comparable) it.next();
  Number newValue = dataset.getValue(key);
  Number oldValue = previousDataset.getValue(key);
  if (oldValue == null) {
    if (greenForIncrease) {
      plot.setSectionPaint(key, Color.green);
    }
    else {
      plot.setSectionPaint(key, Color.red);
    }
    if (showDifference) {
      series.setValue(key + " (+100%)", newValue);
    }
  }
  else {
    double percentChange = (newValue.doubleValue() / oldValue.doubleValue() - 1.0) * 100.0;
    double shade = (Math.abs(percentChange) >= percentDiffForMaxScale ? 255: Math.abs(percentChange) * colorPerPercent);
    if (greenForIncrease && newValue.doubleValue() > oldValue.doubleValue() || !greenForIncrease && newValue.doubleValue() < oldValue.doubleValue()) {
      plot.setSectionPaint(key, new Color(0, (int) shade, 0));
    }
    else {
      plot.setSectionPaint(key, new Color((int) shade, 0, 0));
    }
    if (showDifference) {
      series.setValue(key + " (" + (percentChange >= 0 ? "+": "") + NumberFormat.getPercentInstance().format(percentChange / 100.0) + ")", newValue);
    }
  }
}
if (showDifference) {
  plot.setDataset(series);
}
JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend);
if (subTitle) {
  TextTitle subtitle = null;
  subtitle = new TextTitle("Bright " + (greenForIncrease ? "red": "green") + "=change >=-" + percentDiffForMaxScale + "%, Bright " + ( !greenForIncrease ? "red": "green") + "=change >=+" + percentDiffForMaxScale + "%", new Font("SansSerif", Font.PLAIN, 10));
  chart.addSubtitle(subtitle);
}
return chart;
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
None