Fix some IDE warnings and update some JavaDoc

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1868977 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Dominik Stadler 2019-10-26 05:26:30 +00:00
parent 0783cdeb1f
commit e1237a4f5b
2 changed files with 7 additions and 15 deletions

View File

@ -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
*/

View File

@ -113,11 +113,8 @@ public final class XSSFDrawing extends POIXMLDocumentPart implements Drawing<XSS
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 POIXMLDocumentPart implements Drawing<XSS
* sheet.
* @return the newly created chart
*/
public XSSFChart createChart(ClientAnchor anchor) {
return createChart((XSSFClientAnchor) anchor);
}
@ -265,11 +263,9 @@ public final class XSSFDrawing extends POIXMLDocumentPart implements Drawing<XSS
* @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 POIXMLDocumentPart implements Drawing<XSS
/**
* 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);