Kaydet (Commit) 1fba1fea authored tarafından rbuj's avatar rbuj Kaydeden (comit) Noel Grandin

scripting: the assigned value is never used

Change-Id: I61dcf285ecc6d0affdb949ca03d686f96601d884
Reviewed-on: https://gerrit.libreoffice.org/11319Reviewed-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
Tested-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
üst ce53d3d2
......@@ -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);
......
......@@ -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;
}
}
......
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment