configure.ac | 26 --- scripting/java/com/sun/star/script/framework/io/UCBStreamHandler.java | 2 scripting/java/com/sun/star/script/framework/provider/ScriptProvider.java | 79 +++++----- scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptProviderForBeanShell.java | 3 4 files changed, 44 insertions(+), 66 deletions(-)
New commits: commit 1fba1feac46d808ce801e44f1f29234f7fb3a31f Author: rbuj <robert....@gmail.com> Date: Sun Sep 7 11:49:23 2014 +0200 scripting: the assigned value is never used Change-Id: I61dcf285ecc6d0affdb949ca03d686f96601d884 Reviewed-on: https://gerrit.libreoffice.org/11319 Reviewed-by: Noel Grandin <noelgran...@gmail.com> Tested-by: Noel Grandin <noelgran...@gmail.com> 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 0f48814..075ab66 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 963178d..b49a526 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 09c056c..1fc0d46 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; } commit ce53d3d2ce88a52eced91705c54a89dd51b05ed1 Author: David Tardon <dtar...@redhat.com> Date: Mon Sep 8 10:27:30 2014 +0200 drop obsolete configure options Change-Id: I396998d66bbe4d46b6a19d9ccb3b15d127ead233 diff --git a/configure.ac b/configure.ac index 2ec2226..a814b6a 100644 --- a/configure.ac +++ b/configure.ac @@ -2346,32 +2346,14 @@ AC_ARG_WITH(macosx-version-max-allowed, dnl =================================================================== dnl options for stuff used during cross-compilation build -dnl These are superseded by --with-build-platform-configure-options. -dnl Or are they? Look for the complicated tests for "$cross_compiling" = "yes" -a \( -dnl "$with_system_icu_for_build" = "yes" -o "$with_system_icu_for_build" = "force" \) -dnl far below. Could whoever understands MinGW cross-compilation clean up this please. +dnl Not quite superseded by --with-build-platform-configure-options. +dnl TODO: check, if the "force" option is still needed anywhere. dnl =================================================================== -AC_ARG_WITH(system-boost-for-build, - AS_HELP_STRING([--with-system-boost-for-build], - [Use boost already on system for build tools (cross-compilation only).])) - -AC_ARG_WITH(system-cppunit-for-build, - AS_HELP_STRING([--with-system-cppunit-for-build], - [Use cppunit already on system for build tools (cross-compilation only).])) - -AC_ARG_WITH(system-expat-for-build, - AS_HELP_STRING([--with-system-expat-for-build], - [Use expat already on system for build tools (cross-compilation only).])) - AC_ARG_WITH(system-icu-for-build, AS_HELP_STRING([--with-system-icu-for-build=yes/no/force], [Use icu already on system for build tools (cross-compilation only).])) -AC_ARG_WITH(system-libxml-for-build, - AS_HELP_STRING([--with-system-libxml-for-build], - [Use libxml/libxslt already on system for build tools (cross-compilation only).])) - dnl =================================================================== dnl check for required programs (grep, awk, sed, bash) @@ -4705,11 +4687,7 @@ if test "$cross_compiling" = "yes"; then test -n "$with_ant_home" && sub_conf_opts="$sub_conf_opts --with-ant-home=$with_ant_home" test $with_junit = no && sub_conf_opts="$sub_conf_opts --without-junit" test -n "$TARFILE_LOCATION" && sub_conf_opts="$sub_conf_opts --with-external-tar=$TARFILE_LOCATION" - test -n "$with_system_boost_for_build" && sub_conf_opts="$sub_conf_opts --with-system-boost=$with_system_boost_for_build" - test -n "$with_system_cppunit_for_build" && sub_conf_opts="$sub_conf_opts --with-system-cppunit=$with_system_cppunit_for_build" - test -n "$with_system_expat_for_build" && sub_conf_opts="$sub_conf_opts --with-system-expat=$with_system_expat_for_build" test "$with_system_icu_for_build" = "yes" -o "$with_system_icu_for_build" = "force" && sub_conf_opts="$sub_conf_opts --with-system-icu" - test -n "$with_system_libxml_for_build" && sub_conf_opts="$sub_conf_opts --with-system-libxml=$with_system_libxml_for_build" # we need the msi build tools on mingw if we are creating the # installation set if test "$WITH_MINGW" = "yes"; then _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits