You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ce...@apache.org on 2019/10/26 05:26:30 UTC

svn commit: r1868977 - in /poi/trunk/src: java/org/apache/poi/sl/draw/ImageRenderer.java ooxml/java/org/apache/poi/xssf/usermodel/XSSFDrawing.java

Author: centic
Date: Sat Oct 26 05:26:30 2019
New Revision: 1868977

URL: http://svn.apache.org/viewvc?rev=1868977&view=rev
Log:
Fix some IDE warnings and update some JavaDoc

Modified:
    poi/trunk/src/java/org/apache/poi/sl/draw/ImageRenderer.java
    poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFDrawing.java

Modified: poi/trunk/src/java/org/apache/poi/sl/draw/ImageRenderer.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/sl/draw/ImageRenderer.java?rev=1868977&r1=1868976&r2=1868977&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/sl/draw/ImageRenderer.java (original)
+++ poi/trunk/src/java/org/apache/poi/sl/draw/ImageRenderer.java Sat Oct 26 05:26:30 2019
@@ -111,13 +111,13 @@ public interface ImageRenderer {
     void setAlpha(double alpha);
 
     /**
-     * @return the image as buffered image
+     * @return the image as buffered image or null if image could not be loaded
      */
     BufferedImage getImage();
 
     /**
      * @param dim the dimension in pixels of the returned image
-     * @return the image as buffered image
+     * @return the image as buffered image or null if image could not be loaded
      * 
      * @since POI 3.15-beta2
      */

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFDrawing.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFDrawing.java?rev=1868977&r1=1868976&r2=1868977&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFDrawing.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFDrawing.java Sat Oct 26 05:26:30 2019
@@ -113,11 +113,8 @@ public final class XSSFDrawing extends P
         XmlOptions options = new XmlOptions(DEFAULT_XML_OPTIONS);
         // Removing root element
         options.setLoadReplaceDocumentElement(null);
-        InputStream is = part.getInputStream();
-        try {
+        try (InputStream is = part.getInputStream()) {
             drawing = CTDrawing.Factory.parse(is, options);
-        } finally {
-            is.close();
         }
     }
 
@@ -255,6 +252,7 @@ public final class XSSFDrawing extends P
      *            sheet.
      * @return the newly created chart
      */
+
     public XSSFChart createChart(ClientAnchor anchor) {
         return createChart((XSSFClientAnchor) anchor);
     }
@@ -265,11 +263,9 @@ public final class XSSFDrawing extends P
      * @param srcChart
      *            the source chart to be cloned into this drawing.
      * @return the newly created chart.
-     * @throws XmlException
-     * @throws IOException
      * @since 4.0.0
      */
-    public XSSFChart importChart(XSSFChart srcChart) throws IOException, XmlException {
+    public XSSFChart importChart(XSSFChart srcChart) {
         CTTwoCellAnchor anchor = ((XSSFDrawing) srcChart.getParent()).getCTDrawing().getTwoCellAnchorArray(0);
         CTMarker from = (CTMarker) anchor.getFrom().copy();
         CTMarker to = (CTMarker) anchor.getTo().copy();
@@ -284,13 +280,9 @@ public final class XSSFDrawing extends P
     /**
      * Add the indexed picture to this drawing relations
      *
-     * @param pictureIndex
-     *            the index of the picture in the workbook collection of
-     *            pictures,
-     *            {@link org.apache.poi.xssf.usermodel.XSSFWorkbook#getAllPictures()}
-     *            .
+     * @param pictureIndex the index of the picture in the workbook collection of pictures,
+     *            {@link org.apache.poi.xssf.usermodel.XSSFWorkbook#getAllPictures()}           .
      */
-    @SuppressWarnings("resource")
     protected PackageRelationship addPictureReference(int pictureIndex) {
         XSSFWorkbook wb = (XSSFWorkbook) getParent().getParent();
         XSSFPictureData data = wb.getAllPictures().get(pictureIndex);



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org