From bb437029c1e5331bcc3f8fb2fc87837142a52f33 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 12 Nov 2014 09:55:57 +0200 Subject: java: convert fields to local variables where possible found by PMD Change-Id: I05b45382b8fb1b734657ce9421a20e6ef6fbe542 Reviewed-on: https://gerrit.libreoffice.org/12376 Tested-by: LibreOffice gerrit bot Reviewed-by: Noel Grandin --- sw/qa/complex/writer/CheckTable.java | 10 ++++------ sw/qa/complex/writer/LoadSaveTest.java | 14 ++++++-------- 2 files changed, 10 insertions(+), 14 deletions(-) (limited to 'sw') diff --git a/sw/qa/complex/writer/CheckTable.java b/sw/qa/complex/writer/CheckTable.java index 54d90afc302a..83b92da818f8 100644 --- a/sw/qa/complex/writer/CheckTable.java +++ b/sw/qa/complex/writer/CheckTable.java @@ -51,18 +51,16 @@ public class CheckTable connection.tearDown(); } - private XMultiServiceFactory m_xMSF = null; - private XComponentContext m_xContext = null; private XTextDocument m_xDoc = null; @Before public void before() throws Exception { - m_xMSF = UnoRuntime.queryInterface( + XMultiServiceFactory xMSF = UnoRuntime.queryInterface( XMultiServiceFactory.class, connection.getComponentContext().getServiceManager()); - m_xContext = connection.getComponentContext(); - assertNotNull("could not get component context.", m_xContext); - m_xDoc = util.WriterTools.createTextDoc(m_xMSF); + XComponentContext xContext = connection.getComponentContext(); + assertNotNull("could not get component context.", xContext); + m_xDoc = util.WriterTools.createTextDoc(xMSF); } @After public void after() diff --git a/sw/qa/complex/writer/LoadSaveTest.java b/sw/qa/complex/writer/LoadSaveTest.java index 323eb8f4e8d5..34426256f8cf 100644 --- a/sw/qa/complex/writer/LoadSaveTest.java +++ b/sw/qa/complex/writer/LoadSaveTest.java @@ -63,9 +63,7 @@ public class LoadSaveTest } private XMultiServiceFactory m_xMSF = null; - private XComponentContext m_xContext = null; private XGlobalEventBroadcaster m_xGEB = null; - private String m_TmpDir = null; private String m_fileURL = "file://"; // these should be parameters or something? @@ -74,13 +72,13 @@ public class LoadSaveTest @Before public void before() throws Exception { - m_xContext = connection.getComponentContext(); - assertNotNull("could not get component context.", m_xContext); + XComponentContext xContext = connection.getComponentContext(); + assertNotNull("could not get component context.", xContext); m_xMSF = UnoRuntime.queryInterface( - XMultiServiceFactory.class, m_xContext.getServiceManager()); - m_xGEB = theGlobalEventBroadcaster.get(m_xContext); - m_TmpDir = util.utils.getOfficeTemp/*Dir*/(m_xMSF); - System.out.println("tempdir: " + m_TmpDir); + XMultiServiceFactory.class, xContext.getServiceManager()); + m_xGEB = theGlobalEventBroadcaster.get(xContext); + String sTmpDir = util.utils.getOfficeTemp/*Dir*/(m_xMSF); + System.out.println("tempdir: " + sTmpDir); System.out.println("sourcedir: " + m_SourceDir); System.out.println("targetdir: " + m_TargetDir); } -- cgit v1.2.1