xmlgraphics-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sstei...@apache.org
Subject svn commit: r1723030 - /xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/loader/impl/AbstractImageSessionContext.java
Date Tue, 05 Jan 2016 10:00:03 GMT
Author: ssteiner
Date: Tue Jan  5 10:00:03 2016
New Revision: 1723030

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

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

Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/loader/impl/AbstractImageSessionContext.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/loader/impl/AbstractImageSessionContext.java?rev=1723030&r1=1723029&r2=1723030&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/loader/impl/AbstractImageSessionContext.java
(original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/loader/impl/AbstractImageSessionContext.java
Tue Jan  5 10:00:03 2016
@@ -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