diff options
author | Noel Grandin <noel@peralex.com> | 2014-08-15 16:28:22 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-08-20 11:47:47 +0200 |
commit | 6884ef6317ddc29a713a342fb102e28ebc8fa5cc (patch) | |
tree | e5c6b203f6c58e118f2000bee4c23769b4cc36da /odk | |
parent | 8c9fdc4a963fd55da59a93c979071f53b84fbc24 (diff) |
java: don't catch and then just rethrow an exception
without doing anything else useful
Change-Id: I5803d84d46e0a70e1759f2202e2c2273087f8723
Diffstat (limited to 'odk')
-rw-r--r-- | odk/examples/java/EmbedDocument/EmbeddedObject/OwnEmbeddedObject.java | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/odk/examples/java/EmbedDocument/EmbeddedObject/OwnEmbeddedObject.java b/odk/examples/java/EmbedDocument/EmbeddedObject/OwnEmbeddedObject.java index 89d08bb23ed1..e51ed23e6970 100644 --- a/odk/examples/java/EmbedDocument/EmbeddedObject/OwnEmbeddedObject.java +++ b/odk/examples/java/EmbedDocument/EmbeddedObject/OwnEmbeddedObject.java @@ -32,6 +32,7 @@ import com.sun.star.io.XTruncate; import com.sun.star.lang.XComponent; import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.lib.uno.helper.WeakBase; +import com.sun.star.lib.util.ExceptionHelper; import com.sun.star.uno.AnyConverter; import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.XComponentContext; @@ -109,17 +110,13 @@ public final class OwnEmbeddedObject extends WeakBase XStorage xOwnStorage = xParentStorage.openStorageElement( aEntryName, com.sun.star.embed.ElementModes.READWRITE ); SwitchOwnPersistence( xParentStorage, xOwnStorage, aEntryName ); } - catch( com.sun.star.uno.RuntimeException e ) - { - throw e; - } catch( com.sun.star.io.IOException e ) { throw e; } catch( com.sun.star.uno.Exception e ) { - throw new com.sun.star.io.IOException( "Error while switching object storage!" ); + throw ExceptionHelper.initCause(new com.sun.star.io.IOException( "Error while switching object storage!" ), e); } } } @@ -170,17 +167,13 @@ public final class OwnEmbeddedObject extends WeakBase xStreamComp.dispose(); } - catch( com.sun.star.uno.RuntimeException e ) - { - throw e; - } catch( com.sun.star.io.IOException e ) { throw e; } catch( com.sun.star.uno.Exception e ) { - throw new com.sun.star.io.IOException( "Error while switching object storage!" ); + throw ExceptionHelper.initCause(new com.sun.star.io.IOException( "Error while switching object storage!" ), e); } } @@ -266,17 +259,13 @@ public final class OwnEmbeddedObject extends WeakBase return aResult; } - catch( com.sun.star.uno.RuntimeException e ) - { - throw e; - } catch( com.sun.star.io.IOException e ) { throw e; } catch( com.sun.star.uno.Exception e ) { - throw new com.sun.star.io.IOException( "Error while reading one of object streams!" ); + throw ExceptionHelper.initCause(new com.sun.star.io.IOException( "Error while reading one of object streams!" ), e); } } |