CloneSet194


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
45220.983class_body_declarations[2]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
145147
E:/TSE/Projects-CloneDR/jfreechart-1.0.10/src/org/jfree/chart/servlet/ServletUtilities.java
252215
E:/TSE/Projects-CloneDR/jfreechart-1.0.10/src/org/jfree/chart/servlet/ServletUtilities.java
Next
Last
Clone Instance
1
Line Count
45
Source Line
147
Source File
E:/TSE/Projects-CloneDR/jfreechart-1.0.10/src/org/jfree/chart/servlet/ServletUtilities.java

/**
 * Saves the chart as a PNG format file in the temporary directory.
 *
 * @param chart  the JFreeChart to be saved.
 * @param width  the width of the chart.
 * @param height  the height of the chart.
 * @param session  the HttpSession of the client (if <code>null</code>, the
 *                 temporary file is marked as "one-time" and deleted by 
 *                 the {@link DisplayChart} servlet right after it is
 *                 streamed to the client).
 *
 * @return The filename of the chart saved in the temporary directory.
 *
 * @throws IOException if there is a problem saving the file.
 */
public static String saveChartAsPNG(JFreeChart chart, int width, int height, HttpSession session) throws IOException {
  return ServletUtilities.saveChartAsPNG(chart, width, height, null, session);
}

/**
 * Saves the chart as a PNG format file in the temporary directory and
 * populates the {@link ChartRenderingInfo} object which can be used to 
 * generate an HTML image map.
 *
 * @param chart  the chart to be saved (<code>null</code> not permitted).
 * @param width  the width of the chart.
 * @param height  the height of the chart.
 * @param info  the ChartRenderingInfo object to be populated 
 *              (<code>null</code> permitted).
 * @param session  the HttpSession of the client (if <code>null</code>, the
 *                 temporary file is marked as "one-time" and deleted by 
 *                 the {@link DisplayChart} servlet right after it is
 *                 streamed to the client).
 *
 * @return The filename of the chart saved in the temporary directory.
 *
 * @throws IOException if there is a problem saving the file.
 */
public static String saveChartAsPNG(JFreeChart chart, int width, int height, ChartRenderingInfo info, HttpSession session) throws IOException {
  if (chart == null) {
    throw new IllegalArgumentException("Null \'chart\' argument.");
  }
  ServletUtilities.createTempDir();
  String prefix = ServletUtilities.tempFilePrefix;
  if (session == null) {
    prefix = ServletUtilities.tempOneTimeFilePrefix;
  }
  File tempFile = File.createTempFile(prefix, ".png", new File(System.getProperty("java.io.tmpdir")));
  ChartUtilities.saveChartAsPNG(tempFile, chart, width, height, info);
  if (session != null) {
    ServletUtilities.registerChartForDeletion(tempFile, session);
  }
  return tempFile.getName();
}


First
Previous
Clone Instance
2
Line Count
52
Source Line
215
Source File
E:/TSE/Projects-CloneDR/jfreechart-1.0.10/src/org/jfree/chart/servlet/ServletUtilities.java

/**
 * Saves the chart as a JPEG format file in the temporary directory.
 * <p>
 * SPECIAL NOTE: Please avoid using JPEG as an image format for charts,
 * it is a "lossy" format that introduces visible distortions in the
 * resulting image - use PNG instead.  In addition, note that JPEG output
 * is supported by JFreeChart only for JRE 1.4.2 or later.
 * 
 * @param chart  the JFreeChart to be saved.
 * @param width  the width of the chart.
 * @param height  the height of the chart.
 * @param session  the HttpSession of the client (if <code>null</code>, the
 *                 temporary file is marked as "one-time" and deleted by 
 *                 the {@link DisplayChart} servlet right after it is
 *                 streamed to the client).
 *
 * @return The filename of the chart saved in the temporary directory.
 *
 * @throws IOException if there is a problem saving the file.
 */
public static String saveChartAsJPEG(JFreeChart chart, int width, int height, HttpSession session) throws IOException {
  return ServletUtilities.saveChartAsJPEG(chart, width, height, null, session);
}

/**
 * Saves the chart as a JPEG format file in the temporary directory and
 * populates the <code>ChartRenderingInfo</code> object which can be used 
 * to generate an HTML image map.
 * <p>
 * SPECIAL NOTE: Please avoid using JPEG as an image format for charts,
 * it is a "lossy" format that introduces visible distortions in the
 * resulting image - use PNG instead.  In addition, note that JPEG output
 * is supported by JFreeChart only for JRE 1.4.2 or later.
 *
 * @param chart  the chart to be saved (<code>null</code> not permitted).
 * @param width  the width of the chart
 * @param height  the height of the chart
 * @param info  the ChartRenderingInfo object to be populated
 * @param session  the HttpSession of the client (if <code>null</code>, the
 *                 temporary file is marked as "one-time" and deleted by 
 *                 the {@link DisplayChart} servlet right after it is
 *                 streamed to the client).
 *
 * @return The filename of the chart saved in the temporary directory
 *
 * @throws IOException if there is a problem saving the file.
 */
public static String saveChartAsJPEG(JFreeChart chart, int width, int height, ChartRenderingInfo info, HttpSession session) throws IOException {
  if (chart == null) {
    throw new IllegalArgumentException("Null \'chart\' argument.");
  }
  ServletUtilities.createTempDir();
  String prefix = ServletUtilities.tempFilePrefix;
  if (session == null) {
    prefix = ServletUtilities.tempOneTimeFilePrefix;
  }
  File tempFile = File.createTempFile(prefix, ".jpeg", new File(System.getProperty("java.io.tmpdir")));
  ChartUtilities.saveChartAsJPEG(tempFile, chart, width, height, info);
  if (session != null) {
    ServletUtilities.registerChartForDeletion(tempFile, session);
  }
  return tempFile.getName();
}


Clone AbstractionParameter Count: 2Parameter Bindings

/**
     * Saves the chart as a PNG format file in the temporary directory.
     *
     * @param chart  the JFreeChart to be saved.
     * @param width  the width of the chart.
     * @param height  the height of the chart.
     * @param session  the HttpSession of the client (if <code>null</code>, the
     *                 temporary file is marked as "one-time" and deleted by 
     *                 the {@link DisplayChart} servlet right after it is
     *                 streamed to the client).
     *
     * @return The filename of the chart saved in the temporary directory.
     *
     * @throws IOException if there is a problem saving the file.
     */
/**
     * Saves the chart as a JPEG format file in the temporary directory.
     * <p>
     * SPECIAL NOTE: Please avoid using JPEG as an image format for charts,
     * it is a "lossy" format that introduces visible distortions in the
     * resulting image - use PNG instead.  In addition, note that JPEG output
     * is supported by JFreeChart only for JRE 1.4.2 or later.
     * 
     * @param chart  the JFreeChart to be saved.
     * @param width  the width of the chart.
     * @param height  the height of the chart.
     * @param session  the HttpSession of the client (if <code>null</code>, the
     *                 temporary file is marked as "one-time" and deleted by 
     *                 the {@link DisplayChart} servlet right after it is
     *                 streamed to the client).
     *
     * @return The filename of the chart saved in the temporary directory.
     *
     * @throws IOException if there is a problem saving the file.
     */
public static String  [[#variable18becd20]](JFreeChart chart, int width, int height, HttpSession session) throws IOException {
  return ServletUtilities. [[#variable18becd20]](chart, width, height, null, session);
}

/**
     * Saves the chart as a PNG format file in the temporary directory and
     * populates the {@link ChartRenderingInfo} object which can be used to 
     * generate an HTML image map.
     *
     * @param chart  the chart to be saved (<code>null</code> not permitted).
     * @param width  the width of the chart.
     * @param height  the height of the chart.
     * @param info  the ChartRenderingInfo object to be populated 
     *              (<code>null</code> permitted).
     * @param session  the HttpSession of the client (if <code>null</code>, the
     *                 temporary file is marked as "one-time" and deleted by 
     *                 the {@link DisplayChart} servlet right after it is
     *                 streamed to the client).
     *
     * @return The filename of the chart saved in the temporary directory.
     *
     * @throws IOException if there is a problem saving the file.
     */
/**
     * Saves the chart as a JPEG format file in the temporary directory and
     * populates the <code>ChartRenderingInfo</code> object which can be used 
     * to generate an HTML image map.
     * <p>
     * SPECIAL NOTE: Please avoid using JPEG as an image format for charts,
     * it is a "lossy" format that introduces visible distortions in the
     * resulting image - use PNG instead.  In addition, note that JPEG output
     * is supported by JFreeChart only for JRE 1.4.2 or later.
     *
     * @param chart  the chart to be saved (<code>null</code> not permitted).
     * @param width  the width of the chart
     * @param height  the height of the chart
     * @param info  the ChartRenderingInfo object to be populated
     * @param session  the HttpSession of the client (if <code>null</code>, the
     *                 temporary file is marked as "one-time" and deleted by 
     *                 the {@link DisplayChart} servlet right after it is
     *                 streamed to the client).
     *
     * @return The filename of the chart saved in the temporary directory
     *
     * @throws IOException if there is a problem saving the file.
     */
public static String  [[#variable18becd20]](JFreeChart chart, int width, int height, ChartRenderingInfo info, HttpSession session) throws IOException {
  if (chart == null) {
    throw new IllegalArgumentException("Null \'chart\' argument.");
  }
  ServletUtilities.createTempDir();
  String prefix = ServletUtilities.tempFilePrefix;
  if (session == null) {
    prefix = ServletUtilities.tempOneTimeFilePrefix;
  }
  File tempFile = File.createTempFile(prefix,  [[#variable1a801140]], new File(System.getProperty("java.io.tmpdir")));
  ChartUtilities. [[#variable18becd20]](tempFile, chart, width, height, info);
  if (session != null) {
    ServletUtilities.registerChartForDeletion(tempFile, session);
  }
  return tempFile.getName();
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#18becd20]]
saveChartAsPNG 
12[[#18becd20]]
saveChartAsJPEG 
21[[#1a801140]]
".png" 
22[[#1a801140]]
".jpeg"