You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ye...@apache.org on 2012/10/26 17:40:53 UTC
svn commit: r1402550 -
/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/SlideShow.java
Author: yegor
Date: Fri Oct 26 15:40:53 2012
New Revision: 1402550
URL: http://svn.apache.org/viewvc?rev=1402550&view=rev
Log:
Bug #53707: SlideShow.addPicture declares IOException but throws HSLFException
Modified:
poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/SlideShow.java
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/SlideShow.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/SlideShow.java?rev=1402550&r1=1402549&r2=1402550&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/SlideShow.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/SlideShow.java Fri Oct 26 15:40:53 2012
@@ -853,13 +853,13 @@ public final class SlideShow {
public int addPicture(File pict, int format) throws IOException {
int length = (int) pict.length();
byte[] data = new byte[length];
- try {
- FileInputStream is = new FileInputStream(pict);
+ FileInputStream is = null;
+ try {
+ is = new FileInputStream(pict);
is.read(data);
- is.close();
- } catch (IOException e) {
- throw new HSLFException(e);
- }
+ } finally {
+ if(is != null) is.close();
+ }
return addPicture(data, format);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org