diff options
author | rbuj <robert.buj@gmail.com> | 2014-09-07 11:49:23 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2014-09-08 03:29:11 -0500 |
commit | 1fba1feac46d808ce801e44f1f29234f7fb3a31f (patch) | |
tree | 6fa013a95a90aaee63bbe542cba11d7f2da7e368 /scripting | |
parent | ce53d3d2ce88a52eced91705c54a89dd51b05ed1 (diff) |
scripting: the assigned value is never used
Change-Id: I61dcf285ecc6d0affdb949ca03d686f96601d884
Reviewed-on: https://gerrit.libreoffice.org/11319
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'scripting')
3 files changed, 42 insertions, 42 deletions
diff --git a/scripting/java/com/sun/star/script/framework/io/UCBStreamHandler.java b/scripting/java/com/sun/star/script/framework/io/UCBStreamHandler.java index 0f48814fa2a5..075ab6641c88 100644 --- a/scripting/java/com/sun/star/script/framework/io/UCBStreamHandler.java +++ b/scripting/java/com/sun/star/script/framework/io/UCBStreamHandler.java @@ -187,7 +187,7 @@ public class UCBStreamHandler extends URLStreamHandler { private InputStream getFileStreamFromJarStream(String file, InputStream is) throws IOException { - ZipEntry entry = null; + ZipEntry entry; ZipInputStream zis = new ZipInputStream(is); diff --git a/scripting/java/com/sun/star/script/framework/provider/ScriptProvider.java b/scripting/java/com/sun/star/script/framework/provider/ScriptProvider.java index 963178d90fc5..b49a5262acff 100644 --- a/scripting/java/com/sun/star/script/framework/provider/ScriptProvider.java +++ b/scripting/java/com/sun/star/script/framework/provider/ScriptProvider.java @@ -361,54 +361,55 @@ public abstract class ScriptProvider public ScriptMetaData getScriptData( /*IN*/String scriptURI ) throws ScriptFrameworkErrorException { - ParsedScriptUri details = null; try { - details = m_container.parseScriptUri( scriptURI ); - ScriptMetaData scriptData = m_container.findScript( details ); - if ( scriptData == null ) + ParsedScriptUri details = m_container.parseScriptUri( scriptURI ); + try { - throw new ScriptFrameworkErrorException( details.function + " does not exist", - null, details.function, language, ScriptFrameworkErrorType.NO_SUCH_SCRIPT ); + ScriptMetaData scriptData = m_container.findScript(details); + if (scriptData == null) + { + throw new ScriptFrameworkErrorException(details.function + " does not exist", + null, details.function, language, ScriptFrameworkErrorType.NO_SUCH_SCRIPT); + } + return scriptData; + } + catch (com.sun.star.container.NoSuchElementException nse) + { + ScriptFrameworkErrorException e2 + = new ScriptFrameworkErrorException( + nse.getMessage(), null, details.function, language, + ScriptFrameworkErrorType.NO_SUCH_SCRIPT); + e2.initCause(nse); + throw e2; + } + catch (com.sun.star.lang.WrappedTargetException wta) + { + // TODO specify the correct error Type + Exception wrapped = (Exception) wta.TargetException; + String message = wta.getMessage(); + if (wrapped != null) + { + message = wrapped.getMessage(); + } + ScriptFrameworkErrorException e2 + = new ScriptFrameworkErrorException( + message, null, details.function, language, + ScriptFrameworkErrorType.UNKNOWN); + e2.initCause(wta); + throw e2; } - return scriptData; - } - catch ( com.sun.star.lang.IllegalArgumentException ila ) - { - // TODO specify the correct error Type - ScriptFrameworkErrorException e2 = - new ScriptFrameworkErrorException( - ila.getMessage(), null, scriptURI, language, - ScriptFrameworkErrorType.UNKNOWN ); - e2.initCause( ila ); - throw e2; - } - catch ( com.sun.star.container.NoSuchElementException nse ) - { - ScriptFrameworkErrorException e2 = - new ScriptFrameworkErrorException( - nse.getMessage(), null, details.function, language, - ScriptFrameworkErrorType.NO_SUCH_SCRIPT ); - e2.initCause( nse ); - throw e2; } - catch ( com.sun.star.lang.WrappedTargetException wta ) + catch (com.sun.star.lang.IllegalArgumentException ila) { // TODO specify the correct error Type - Exception wrapped = (Exception)wta.TargetException; - String message = wta.getMessage(); - if ( wrapped != null ) - { - message = wrapped.getMessage(); - } - ScriptFrameworkErrorException e2 = - new ScriptFrameworkErrorException( - message, null, details.function, language, - ScriptFrameworkErrorType.UNKNOWN ); - e2.initCause( wta ); + ScriptFrameworkErrorException e2 + = new ScriptFrameworkErrorException( + ila.getMessage(), null, scriptURI, language, + ScriptFrameworkErrorType.UNKNOWN); + e2.initCause(ila); throw e2; } - } diff --git a/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptProviderForBeanShell.java b/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptProviderForBeanShell.java index 09c056c0baa4..1fc0d4670d68 100644 --- a/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptProviderForBeanShell.java +++ b/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptProviderForBeanShell.java @@ -61,10 +61,9 @@ public class ScriptProviderForBeanShell throws com.sun.star.uno.RuntimeException, ScriptFrameworkErrorException { - ScriptMetaData scriptData = null; + ScriptMetaData scriptData = getScriptData( scriptURI ); try { - scriptData = getScriptData( scriptURI ); ScriptImpl script = new ScriptImpl( m_xContext, scriptData, m_xModel, m_xInvocContext ); return script; } |