diff options
author | Noel Grandin <noel@peralex.com> | 2014-12-05 11:03:50 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-12-05 11:15:57 +0200 |
commit | c199b76d882619bf9c4169631bc265e5bd2ca7fe (patch) | |
tree | aca1e89f3bc907a8f7b8e0fe5702bbe619f4a6a8 /scripting/java | |
parent | db203e59d6b54112cbf42923d4f02940b15e3c9f (diff) |
java: remove some unused local variables
Change-Id: Ia01528460e2f4b610d123e29cad66520abc6a965
Diffstat (limited to 'scripting/java')
7 files changed, 12 insertions, 28 deletions
diff --git a/scripting/java/com/sun/star/script/framework/browse/ParcelBrowseNode.java b/scripting/java/com/sun/star/script/framework/browse/ParcelBrowseNode.java index 85b8b3d6c057..c4ae6648d756 100644 --- a/scripting/java/com/sun/star/script/framework/browse/ParcelBrowseNode.java +++ b/scripting/java/com/sun/star/script/framework/browse/ParcelBrowseNode.java @@ -76,18 +76,14 @@ public class ParcelBrowseNode extends PropertySet implements registerProperty("Creatable", new Type(boolean.class), (short)0, "creatable"); registerProperty("Renamable", new Type(boolean.class), (short)0, "renamable"); - String parcelDirUrl = parcel.getPathToParcel(); XComponentContext xCtx = provider.getScriptingContext().getComponentContext(); XMultiComponentFactory xFac = xCtx.getServiceManager(); try { - - XSimpleFileAccess xSFA = - UnoRuntime.queryInterface(XSimpleFileAccess.class, - xFac.createInstanceWithContext( - "com.sun.star.ucb.SimpleFileAccess", - xCtx)); - + UnoRuntime.queryInterface(XSimpleFileAccess.class, + xFac.createInstanceWithContext( + "com.sun.star.ucb.SimpleFileAccess", + xCtx)); } catch (com.sun.star.uno.Exception e) { // TODO propagate potential errors LogUtils.DEBUG("Caught exception creating ParcelBrowseNode " + e); diff --git a/scripting/java/com/sun/star/script/framework/browse/ProviderBrowseNode.java b/scripting/java/com/sun/star/script/framework/browse/ProviderBrowseNode.java index 3bcf706b3dbe..2e9ee6828184 100644 --- a/scripting/java/com/sun/star/script/framework/browse/ProviderBrowseNode.java +++ b/scripting/java/com/sun/star/script/framework/browse/ProviderBrowseNode.java @@ -65,15 +65,13 @@ public class ProviderBrowseNode extends PropertySet implements registerProperty("Deletable", new Type(boolean.class), (short)0, "deletable"); registerProperty("Creatable", new Type(boolean.class), (short)0, "creatable"); registerProperty("Editable", new Type(boolean.class), (short)0, "editable"); - XSimpleFileAccess xSFA = null; XMultiComponentFactory xFac = m_xCtx.getServiceManager(); try { - - xSFA = UnoRuntime.queryInterface(XSimpleFileAccess.class, - xFac.createInstanceWithContext( - "com.sun.star.ucb.SimpleFileAccess", - xCtx)); + UnoRuntime.queryInterface(XSimpleFileAccess.class, + xFac.createInstanceWithContext( + "com.sun.star.ucb.SimpleFileAccess", + xCtx)); } // TODO propage errors catch (com.sun.star.uno.Exception e) { diff --git a/scripting/java/com/sun/star/script/framework/browse/ScriptBrowseNode.java b/scripting/java/com/sun/star/script/framework/browse/ScriptBrowseNode.java index 3c7bfa03f327..903a45f1793e 100644 --- a/scripting/java/com/sun/star/script/framework/browse/ScriptBrowseNode.java +++ b/scripting/java/com/sun/star/script/framework/browse/ScriptBrowseNode.java @@ -71,8 +71,6 @@ public class ScriptBrowseNode extends PropertySet implements XMultiComponentFactory xFac = xCtx.getServiceManager(); try { - ScriptMetaData data = (ScriptMetaData)parent.getByName(name); - XSimpleFileAccess xSFA = UnoRuntime.queryInterface( XSimpleFileAccess.class, xFac.createInstanceWithContext( diff --git a/scripting/java/com/sun/star/script/framework/container/ParcelDescriptor.java b/scripting/java/com/sun/star/script/framework/container/ParcelDescriptor.java index 529332e4eb70..31c9f824ed75 100644 --- a/scripting/java/com/sun/star/script/framework/container/ParcelDescriptor.java +++ b/scripting/java/com/sun/star/script/framework/container/ParcelDescriptor.java @@ -148,7 +148,7 @@ public class ParcelDescriptor { return new ScriptEntry[0]; for (int i = 0; i < len; i++) { - String language, languagename, logicalname, description = ""; + String language, languagename, description = ""; Map<String, String> langProps = new HashMap<String, String>(); NodeList nl; Element tmp; @@ -158,11 +158,9 @@ public class ParcelDescriptor { nl = scriptElement.getElementsByTagName("logicalname"); - if (nl == null) - logicalname = ""; - else { + if (nl != null) + { tmp = (Element)nl.item(0); - logicalname = tmp.getAttribute("value"); } // get the text of the description element diff --git a/scripting/java/com/sun/star/script/framework/container/UnoPkgContainer.java b/scripting/java/com/sun/star/script/framework/container/UnoPkgContainer.java index ec22608f31f7..29d059d754d1 100644 --- a/scripting/java/com/sun/star/script/framework/container/UnoPkgContainer.java +++ b/scripting/java/com/sun/star/script/framework/container/UnoPkgContainer.java @@ -165,7 +165,6 @@ public class UnoPkgContainer extends ParcelContainer { com.sun.star.container.NoSuchElementException, com.sun.star.lang.WrappedTargetException { - ScriptMetaData scriptData = null; String functionName = psu.function; String parcelName = psu.parcel; String location = psu.location; diff --git a/scripting/java/com/sun/star/script/framework/provider/java/ScriptProviderForJava.java b/scripting/java/com/sun/star/script/framework/provider/java/ScriptProviderForJava.java index fb18d34aadd3..5e6686bc24cb 100644 --- a/scripting/java/com/sun/star/script/framework/provider/java/ScriptProviderForJava.java +++ b/scripting/java/com/sun/star/script/framework/provider/java/ScriptProviderForJava.java @@ -180,8 +180,6 @@ class ScriptImpl implements XScript { aOutParamIndex[0] = new short[0]; aOutParam[0] = new Object[0]; - Map<String, String> languageProps = metaData.getLanguageProperties(); - ScriptDescriptor scriptDesc = new ScriptDescriptor(metaData.getLanguageName()); diff --git a/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptProviderForJavaScript.java b/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptProviderForJavaScript.java index a2f78916a1b8..636511d14825 100644 --- a/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptProviderForJavaScript.java +++ b/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptProviderForJavaScript.java @@ -182,11 +182,10 @@ class ScriptImpl implements XScript { aOutParam[0] = new Object[0]; ClassLoader cl = null; - URL sourceUrl = null; try { cl = ClassLoaderFactory.getURLClassLoader(metaData); - sourceUrl = metaData.getSourceURL(); + metaData.getSourceURL(); } catch (java.net.MalformedURLException mfu) { throw new ScriptFrameworkErrorException( mfu.getMessage(), null, @@ -197,14 +196,12 @@ class ScriptImpl implements XScript { Context ctxt = null; try { - String editorURL = sourceUrl.toString(); Object result = null; ScriptEditorForJavaScript editor = ScriptEditorForJavaScript.getEditor(metaData.getSourceURL()); if (editor != null) { - editorURL = editor.getURL(); result = editor.execute(); if (result != null && |