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 | |
parent | db203e59d6b54112cbf42923d4f02940b15e3c9f (diff) |
java: remove some unused local variables
Change-Id: Ia01528460e2f4b610d123e29cad66520abc6a965
21 files changed, 19 insertions, 52 deletions
diff --git a/bean/com/sun/star/comp/beans/LocalOfficeConnection.java b/bean/com/sun/star/comp/beans/LocalOfficeConnection.java index 5a57dcdc8e79..c6f6fa3b0eb2 100644 --- a/bean/com/sun/star/comp/beans/LocalOfficeConnection.java +++ b/bean/com/sun/star/comp/beans/LocalOfficeConnection.java @@ -303,7 +303,7 @@ public class LocalOfficeConnection com.sun.star.comp.helper.Bootstrap.createInitialComponentContext(null); // initial serviceManager - XMultiComponentFactory xLocalServiceManager = xLocalContext.getServiceManager(); + xLocalContext.getServiceManager(); // try to connect to soffice Object aInitialObject = null; @@ -403,7 +403,6 @@ public class LocalOfficeConnection } else { // new style int index = dcp.indexOf(':'); - String url = dcp.substring(0, index).trim(); dcp = dcp.substring(index + 1).trim(); index = dcp.indexOf(';'); diff --git a/filter/qa/complex/filter/misc/FinalizedMandatoryTest.java b/filter/qa/complex/filter/misc/FinalizedMandatoryTest.java index fcf8efdb8a74..fea027b75a63 100644 --- a/filter/qa/complex/filter/misc/FinalizedMandatoryTest.java +++ b/filter/qa/complex/filter/misc/FinalizedMandatoryTest.java @@ -159,7 +159,6 @@ public class FinalizedMandatoryTest System.out.println("------------------------------------------------"); try { - PropertyValue instanceProp = new PropertyValue(); filterName = filterNames[i]; System.out.println(filterName); diff --git a/jurt/com/sun/star/lib/uno/environments/remote/Job.java b/jurt/com/sun/star/lib/uno/environments/remote/Job.java index 1d8b3661467d..a9cd28d5c0df 100644 --- a/jurt/com/sun/star/lib/uno/environments/remote/Job.java +++ b/jurt/com/sun/star/lib/uno/environments/remote/Job.java @@ -77,7 +77,6 @@ public class Job { * @return the result of the message. */ public Object execute() throws Throwable { - Object msgResult = _iMessage.getResult(); if (_iMessage.isRequest()) { Object result = null; Throwable exception = null; diff --git a/jurt/workbench/com/sun/star/comp/urlresolver/UrlResolver_Test.java b/jurt/workbench/com/sun/star/comp/urlresolver/UrlResolver_Test.java index 05b91a1d466c..e0b4ac8e3a1b 100644 --- a/jurt/workbench/com/sun/star/comp/urlresolver/UrlResolver_Test.java +++ b/jurt/workbench/com/sun/star/comp/urlresolver/UrlResolver_Test.java @@ -36,7 +36,7 @@ public class UrlResolver_Test XComponentContext xcomponentcontext = Bootstrap.createInitialComponentContext( null ); // initial serviceManager - XMultiComponentFactory xLocalServiceManager = xcomponentcontext.getServiceManager(); + xcomponentcontext.getServiceManager(); // create a connector, so that it can contact the office XUnoUrlResolver urlResolver diff --git a/jvmfwk/plugins/sunmajor/pluginlib/JREProperties.java b/jvmfwk/plugins/sunmajor/pluginlib/JREProperties.java index bf3aef038701..65c273b91580 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/JREProperties.java +++ b/jvmfwk/plugins/sunmajor/pluginlib/JREProperties.java @@ -53,7 +53,7 @@ public class JREProperties { try{ //This line is needed to get the accessibility properties - Toolkit tk = java.awt.Toolkit.getDefaultToolkit(); + java.awt.Toolkit.getDefaultToolkit(); } catch(Throwable e) { diff --git a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/dialogs/BaseDialog.java b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/dialogs/BaseDialog.java index bf73962151c8..84db9685d6a3 100644 --- a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/dialogs/BaseDialog.java +++ b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/dialogs/BaseDialog.java @@ -90,7 +90,6 @@ public abstract class BaseDialog extends BaseControl { public BaseDialog(XComponentContext context, String title, int x, int y, int width, int height) { super(context); - ModalState modalState = ModalState.Exit; try { xMCF = context.getServiceManager(); setUnoModel(xMCF.createInstanceWithContext("com.sun.star.awt.UnoControlDialogModel", context)); diff --git a/reportbuilder/java/org/libreoffice/report/pentaho/PentahoReportJob.java b/reportbuilder/java/org/libreoffice/report/pentaho/PentahoReportJob.java index a0547946b4b2..fba3625785a5 100644 --- a/reportbuilder/java/org/libreoffice/report/pentaho/PentahoReportJob.java +++ b/reportbuilder/java/org/libreoffice/report/pentaho/PentahoReportJob.java @@ -135,7 +135,6 @@ public class PentahoReportJob implements ReportJob this.masterValues = (ArrayList<?>) jobProperties.getProperty(ReportEngineParameterNames.INPUT_MASTER_VALUES); this.detailColumns = (ArrayList<?>) jobProperties.getProperty(ReportEngineParameterNames.INPUT_DETAIL_COLUMNS); - Integer maxRows=(Integer) jobProperties.getProperty(ReportEngineParameterNames.MAXROWS); this.resourceManager = new ResourceManager(); this.resourceManager.registerDefaults(); diff --git a/reportbuilder/java/org/libreoffice/report/pentaho/output/OfficeDocumentReportTarget.java b/reportbuilder/java/org/libreoffice/report/pentaho/output/OfficeDocumentReportTarget.java index 9c579e84df18..9f07ace82656 100644 --- a/reportbuilder/java/org/libreoffice/report/pentaho/output/OfficeDocumentReportTarget.java +++ b/reportbuilder/java/org/libreoffice/report/pentaho/output/OfficeDocumentReportTarget.java @@ -1037,7 +1037,7 @@ public abstract class OfficeDocumentReportTarget extends AbstractReportTarget DocumentBuilder dBuilder = dbFactory.newDocumentBuilder(); Document document = dBuilder.parse(new InputSource(inputStream)); - NodeList nl = document.getElementsByTagName("document-meta/meta/generator"); + document.getElementsByTagName("document-meta/meta/generator"); Node node = document.getFirstChild().getFirstChild().getFirstChild().getFirstChild(); String creator = node.getNodeValue(); node.setNodeValue(creator + "/report_builder"); 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 && diff --git a/sw/qa/complex/writer/CheckBookmarks.java b/sw/qa/complex/writer/CheckBookmarks.java index 8dc6b76b30a9..607064a80d58 100644 --- a/sw/qa/complex/writer/CheckBookmarks.java +++ b/sw/qa/complex/writer/CheckBookmarks.java @@ -146,9 +146,7 @@ public class CheckBookmarks { throws com.sun.star.uno.Exception { XText xText = m_xDoc.getText(); - XSimpleText xSimpleText = UnoRuntime.queryInterface( - XSimpleText.class, - xText); + UnoRuntime.queryInterface(XSimpleText.class, xText); for(int nPara=0; nPara<10; ++nPara) { for(int nBookmark=0; nBookmark<100; ++nBookmark){ insertBookmark( diff --git a/sw/qa/complex/writer/TextPortionEnumerationTest.java b/sw/qa/complex/writer/TextPortionEnumerationTest.java index e5d64ef5d575..ed5885b0a51a 100644 --- a/sw/qa/complex/writer/TextPortionEnumerationTest.java +++ b/sw/qa/complex/writer/TextPortionEnumerationTest.java @@ -589,7 +589,7 @@ class FuzzyTester TreeNode node = m_BufferExpected.get(i); int j = m_BufferActual.indexOf(node); if (j >= 0) { - TreeNode other = m_BufferActual.get(j); + m_BufferActual.get(j); if (j != i) { //FIXME how bad is this? diff --git a/swext/mediawiki/src/com/sun/star/wiki/Helper.java b/swext/mediawiki/src/com/sun/star/wiki/Helper.java index fa48a3500076..5900e9aa96cd 100644 --- a/swext/mediawiki/src/com/sun/star/wiki/Helper.java +++ b/swext/mediawiki/src/com/sun/star/wiki/Helper.java @@ -608,7 +608,6 @@ public class Helper aProxyPortProp = "ooInetHTTPSProxyPort"; } - String aNoProxyList = AnyConverter.toString( xNameAccess.getByName( "ooInetNoProxy" ) ); String aProxyName = AnyConverter.toString( xNameAccess.getByName( aProxyNameProp ) ); int nProxyPort = 80; diff --git a/swext/mediawiki/src/com/sun/star/wiki/WikiEditorImpl.java b/swext/mediawiki/src/com/sun/star/wiki/WikiEditorImpl.java index 3ad6b5c410b9..8abc01b9e9ed 100644 --- a/swext/mediawiki/src/com/sun/star/wiki/WikiEditorImpl.java +++ b/swext/mediawiki/src/com/sun/star/wiki/WikiEditorImpl.java @@ -107,18 +107,11 @@ public final class WikiEditorImpl extends WeakBase } - private boolean m_bInitialized; public synchronized void initialize( Object[] args ) throws com.sun.star.uno.Exception { - if ( m_bInitialized ) - { - } if ( args.length > 0 ) { - m_bInitialized = true; m_xFrame = UnoRuntime.queryInterface( XFrame.class, args[0] ); - // become close listener - XCloseBroadcaster cb = UnoRuntime.queryInterface( XCloseBroadcaster.class, m_xFrame ); } } @@ -197,7 +190,7 @@ public final class WikiEditorImpl extends WeakBase { try { - URI uri = new URI( uristring ); + new URI( uristring ); // check whether any blogs are live... setListenerState( "command"); diff --git a/toolkit/test/accessibility/TopWindowListener.java b/toolkit/test/accessibility/TopWindowListener.java index 3654b970099f..a35b51a5ff9a 100644 --- a/toolkit/test/accessibility/TopWindowListener.java +++ b/toolkit/test/accessibility/TopWindowListener.java @@ -108,7 +108,6 @@ class TopWindowListener if (aObject instanceof VectorNode && xTopLevelObject != null) { System.out.println ("removing node " + xTopLevelObject); - VectorNode aRoot = (VectorNode) aObject; maModel.removeNode (xTopLevelObject.getAccessibleContext()); } } diff --git a/toolkit/test/accessibility/ov/StateSetView.java b/toolkit/test/accessibility/ov/StateSetView.java index 4829889e1b1d..f967f71d18cb 100644 --- a/toolkit/test/accessibility/ov/StateSetView.java +++ b/toolkit/test/accessibility/ov/StateSetView.java @@ -179,7 +179,6 @@ public static class StateSetAllView XAccessibleStateSet xStateSet = mxContext.getAccessibleStateSet(); if (xStateSet != null) { - short aStates[] = xStateSet.getStates (); final int nMaxStateIndex = AccessibleStateType.MANAGES_DESCENDANTS; int nStateWidth = (aWidgetArea.width-12) / (nMaxStateIndex+1); AffineTransform aTransform = g.getTransform (); |