xmlgraphics-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sstei...@apache.org
Subject svn commit: r1796008 - /xmlgraphics/commons/trunk/src/main/java/org/apache/xmlgraphics/image/loader/impl/AbstractImageSessionContext.java
Date Wed, 24 May 2017 08:16:01 GMT
Author: ssteiner
Date: Wed May 24 08:16:01 2017
New Revision: 1796008

URL: http://svn.apache.org/viewvc?rev=1796008&view=rev
Log:
XGC-98: UndeclaredThrowableException while loading images

Modified:
    xmlgraphics/commons/trunk/src/main/java/org/apache/xmlgraphics/image/loader/impl/AbstractImageSessionContext.java

Modified: xmlgraphics/commons/trunk/src/main/java/org/apache/xmlgraphics/image/loader/impl/AbstractImageSessionContext.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/main/java/org/apache/xmlgraphics/image/loader/impl/AbstractImageSessionContext.java?rev=1796008&r1=1796007&r2=1796008&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/main/java/org/apache/xmlgraphics/image/loader/impl/AbstractImageSessionContext.java
(original)
+++ xmlgraphics/commons/trunk/src/main/java/org/apache/xmlgraphics/image/loader/impl/AbstractImageSessionContext.java
Wed May 24 08:16:01 2017
@@ -24,6 +24,7 @@ import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.InputStream;
 import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.lang.reflect.Proxy;
 import java.net.MalformedURLException;
@@ -119,15 +120,19 @@ public abstract class AbstractImageSessi
 
         /** {@inheritDoc} */
         public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
{
-            if ("close".equals(method.getName())) {
-                try {
+            try {
+                if ("close".equals(method.getName())) {
+                    try {
+                        return method.invoke(iin, args);
+                    } finally {
+                        IOUtils.closeQuietly(this.in);
+                        this.in = null;
+                    }
+                } else {
                     return method.invoke(iin, args);
-                } finally {
-                    IOUtils.closeQuietly(this.in);
-                    this.in = null;
                 }
-            } else {
-                return method.invoke(iin, args);
+            } catch (InvocationTargetException e) {
+                throw e.getCause();
             }
         }
 



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


Mime
View raw message