diff options
author | Noel Grandin <noel@peralex.com> | 2014-11-12 09:55:57 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2014-11-12 11:03:29 +0000 |
commit | bb437029c1e5331bcc3f8fb2fc87837142a52f33 (patch) | |
tree | 56bde4059792a5284e90ae3b10ee4388cc913a54 /framework/qa | |
parent | 84f7f412bfc9e18b1ff8b133ceda7757eae28c36 (diff) |
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 <gerrit@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'framework/qa')
3 files changed, 25 insertions, 27 deletions
diff --git a/framework/qa/complex/framework/autosave/Protocol.java b/framework/qa/complex/framework/autosave/Protocol.java index 144aea8b975a..ac2a61dce79b 100644 --- a/framework/qa/complex/framework/autosave/Protocol.java +++ b/framework/qa/complex/framework/autosave/Protocol.java @@ -148,7 +148,6 @@ public class Protocol extends JComponent private long m_nWarnings ; private long m_nTestMarks; private Timestamp m_aStartTime; - private Timestamp m_aEndTime ; /** @@ -631,8 +630,8 @@ public class Protocol extends JComponent */ public synchronized void logStatistics() { - m_aEndTime = new Timestamp(System.currentTimeMillis()); - Timestamp aDiff = new Timestamp(m_aEndTime.getTime()-m_aStartTime.getTime()); + Timestamp aEndTime = new Timestamp(System.currentTimeMillis()); + Timestamp aDiff = new Timestamp(aEndTime.getTime()-m_aStartTime.getTime()); int nLogType = TYPE_STATISTIC; if (m_nErrors > 0) diff --git a/framework/qa/complex/loadAllDocuments/CheckXComponentLoader.java b/framework/qa/complex/loadAllDocuments/CheckXComponentLoader.java index 8ae6388c2cf3..691453841151 100644 --- a/framework/qa/complex/loadAllDocuments/CheckXComponentLoader.java +++ b/framework/qa/complex/loadAllDocuments/CheckXComponentLoader.java @@ -87,12 +87,6 @@ public class CheckXComponentLoader // member - /** points to the global uno service manager. */ - private XMultiServiceFactory m_xMSF = null; - - /** provides XComponentLoader interface. */ - private XFrame m_xDesktop = null; - /** provides XComponentLoader interface too. */ private XFrame m_xFrame = null; @@ -123,12 +117,13 @@ public class CheckXComponentLoader @Before public void before() { // get uno service manager from global test environment - m_xMSF = getMSF(); + /* points to the global uno service manager. */ + XMultiServiceFactory xMSF = getMSF(); // create stream provider try { - m_xStreamProvider = UnoRuntime.queryInterface(XSimpleFileAccess.class, m_xMSF.createInstance("com.sun.star.ucb.SimpleFileAccess")); + m_xStreamProvider = UnoRuntime.queryInterface(XSimpleFileAccess.class, xMSF.createInstance("com.sun.star.ucb.SimpleFileAccess")); } catch(java.lang.Throwable ex) { @@ -136,9 +131,11 @@ public class CheckXComponentLoader } // create desktop instance + /* provides XComponentLoader interface. */ + XFrame xDesktop = null; try { - m_xDesktop = UnoRuntime.queryInterface(XFrame.class, m_xMSF.createInstance("com.sun.star.frame.Desktop")); + xDesktop = UnoRuntime.queryInterface(XFrame.class, xMSF.createInstance("com.sun.star.frame.Desktop")); } catch(java.lang.Throwable ex) { @@ -146,13 +143,13 @@ public class CheckXComponentLoader } // create frame instance - m_xFrame = m_xDesktop.findFrame("testFrame_componentLoader", + m_xFrame = xDesktop.findFrame("testFrame_componentLoader", FrameSearchFlag.TASKS | FrameSearchFlag.CREATE); assertNotNull("Couldn't create test frame.", m_xFrame); // define default loader for testing // TODO think about using of bot loader instances! - m_xLoader = UnoRuntime.queryInterface(XComponentLoader.class, m_xDesktop); + m_xLoader = UnoRuntime.queryInterface(XComponentLoader.class, xDesktop); assertNotNull("Desktop service doesn't support needed component loader interface.", m_xLoader); // get temp path for this environment diff --git a/framework/qa/complex/loadAllDocuments/StreamSimulator.java b/framework/qa/complex/loadAllDocuments/StreamSimulator.java index f688fb98d41d..34fed390dc5e 100644 --- a/framework/qa/complex/loadAllDocuments/StreamSimulator.java +++ b/framework/qa/complex/loadAllDocuments/StreamSimulator.java @@ -33,21 +33,24 @@ public class StreamSimulator implements com.sun.star.io.XInputStream , { /** - * @member m_sFileName name of the corrsponding file on disk - * @member m_xInStream the internal input stream for reading - * @member m_xOutStream the internal input stream for writing - * @member m_xSeek points at runtime to m_xInStream or m_xOutStream and make it seekable - * - * @member m_bInWasUsed indicates, that the input stream interface was used - * @member m_bOutWasUsed indicates, that the output stream interface was used + * the internal input stream for reading */ - - private String m_sFileName ; private com.sun.star.io.XInputStream m_xInStream ; + /** + * the internal input stream for writing + */ private com.sun.star.io.XOutputStream m_xOutStream ; + /** + * points at runtime to m_xInStream or m_xOutStream and make it seekable + */ private com.sun.star.io.XSeekable m_xSeek ; - + /** + * indicates, that the input stream interface was used + */ public boolean m_bInWasUsed ; + /** + * indicates, that the output stream interface was used + */ public boolean m_bOutWasUsed ; /** @@ -77,7 +80,6 @@ public class StreamSimulator implements com.sun.star.io.XInputStream , String sFileName, boolean bInput) throws com.sun.star.io.NotConnectedException { - m_sFileName = sFileName ; m_bInWasUsed = false ; m_bOutWasUsed = false ; @@ -92,14 +94,14 @@ public class StreamSimulator implements com.sun.star.io.XInputStream , if (bInput) { - m_xInStream = xHelper.openFileRead(m_sFileName); + m_xInStream = xHelper.openFileRead(sFileName); m_xSeek = UnoRuntime.queryInterface( com.sun.star.io.XSeekable.class, m_xInStream); } else { - m_xOutStream = xHelper.openFileWrite(m_sFileName); + m_xOutStream = xHelper.openFileWrite(sFileName); m_xSeek = UnoRuntime.queryInterface( com.sun.star.io.XSeekable.class, m_xOutStream); |