diff options
author | Noel Grandin <noel@peralex.com> | 2014-11-18 10:01:21 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-11-18 12:44:28 +0200 |
commit | 0063cf285696951e336b9cec1da8881997b286ce (patch) | |
tree | be70dfd8127c35f9e4a6d18d4db459a587813bf4 /odk/examples/DevelopersGuide/OfficeDev | |
parent | 250391009aec9930abcc57930ddd4b6f56f4df9c (diff) |
java: make fields final where possible
found by PMD
Change-Id: I87780366119c141cd2dafe6ca1bf2d9798b10aec
Diffstat (limited to 'odk/examples/DevelopersGuide/OfficeDev')
15 files changed, 39 insertions, 39 deletions
diff --git a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/CustomizeView.java b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/CustomizeView.java index 3f86aeff0581..1acb6eae6a40 100644 --- a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/CustomizeView.java +++ b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/CustomizeView.java @@ -80,9 +80,9 @@ public class CustomizeView extends JPanel * @member m_aToolBarListener listener for status events of the tool bar * @member m_aObjectBarListener listener for status events of the object bar */ - private JCheckBox m_cbMenuBar ; - private JCheckBox m_cbToolBar ; - private JCheckBox m_cbObjectBar ; + private final JCheckBox m_cbMenuBar ; + private final JCheckBox m_cbToolBar ; + private final JCheckBox m_cbObjectBar ; private StatusListener m_aMenuBarListener ; private StatusListener m_aToolBarListener ; @@ -175,9 +175,9 @@ public class CustomizeView extends JPanel com.sun.star.lang.XEventListener { /// URL, to toogle the requested UI item - private String m_sURL; + private final String m_sURL; /// name of the property which must be used in combination with the URL - private String m_sProp; + private final String m_sProp; /// we must use this frame to dispatch a request private com.sun.star.frame.XFrame m_xFrame; diff --git a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/DocumentView.java b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/DocumentView.java index 2a3bad305c94..c6e657c06483 100644 --- a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/DocumentView.java +++ b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/DocumentView.java @@ -99,10 +99,10 @@ public class DocumentView extends JFrame private CustomizeView maCustomizeView ; private Interceptor maInterceptor ; - private String msName ; + private final String msName; - private JButton mbtSave ; - private JButton mbtExport ; + private final JButton mbtSave; + private final JButton mbtExport; private boolean mbDead ; diff --git a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/JavaWindowPeerFake.java b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/JavaWindowPeerFake.java index 2d07f9642d9c..51fba4d12725 100644 --- a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/JavaWindowPeerFake.java +++ b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/JavaWindowPeerFake.java @@ -40,7 +40,7 @@ class JavaWindowPeerFake implements com.sun.star.awt.XSystemDependentWindowPeer, com.sun.star.awt.XWindowPeer { - private NativeView maView; + private final NativeView maView; public JavaWindowPeerFake(NativeView aNative) { diff --git a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/OnewayExecutor.java b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/OnewayExecutor.java index cc3b79cf19ea..815355114bc0 100644 --- a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/OnewayExecutor.java +++ b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/OnewayExecutor.java @@ -74,9 +74,9 @@ class OnewayExecutor extends Thread * called oneyway method) * @member m_lParams list of parameters of the original request */ - private IOnewayLink m_rLink ; - private int m_nRequest ; - private ArrayList<Object> m_lParams ; + private final IOnewayLink m_rLink ; + private final int m_nRequest ; + private final ArrayList<Object> m_lParams ; diff --git a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/StatusListener.java b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/StatusListener.java index 02fc79d337e9..038c80ff92f1 100644 --- a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/StatusListener.java +++ b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/StatusListener.java @@ -80,9 +80,9 @@ class StatusListener implements com.sun.star.frame.XStatusListener, * @member m_bIsStatusListener indicates if we are currently registered as a listener for status events or not * @member m_bDead there exist more than one way to finish an object of this class - we must know it sometimes */ - private Component m_rControl ; - private String m_sTrueText ; - private String m_sFalseText ; + private final Component m_rControl ; + private final String m_sTrueText ; + private final String m_sFalseText ; private com.sun.star.frame.XDispatch m_xDispatch ; private com.sun.star.frame.XFrame m_xFrame ; private com.sun.star.util.URL m_aURL ; diff --git a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/StatusView.java b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/StatusView.java index ae7625bfff7e..c4eb32ed4adb 100644 --- a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/StatusView.java +++ b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/StatusView.java @@ -105,11 +105,11 @@ public class StatusView extends JPanel * @member maUnderlineListener threadsafe(!) helper to listen for status event which describe font style underline * @member maItalicListener threadsafe(!) helper to listen for status event which describe font style italic */ - private JLabel m_laFontValue ; - private JLabel m_laSizeValue ; - private JLabel m_laBoldValue ; - private JLabel m_laUnderlineValue ; - private JLabel m_laItalicValue ; + private final JLabel m_laFontValue ; + private final JLabel m_laSizeValue ; + private final JLabel m_laBoldValue ; + private final JLabel m_laUnderlineValue ; + private final JLabel m_laItalicValue ; private StatusListener m_aFontListener ; private StatusListener m_aSizeListener ; diff --git a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/AsciiFilter/AsciiReplaceFilter.java b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/AsciiFilter/AsciiReplaceFilter.java index 04e9b771c391..7930f8595601 100644 --- a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/AsciiFilter/AsciiReplaceFilter.java +++ b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/AsciiFilter/AsciiReplaceFilter.java @@ -112,7 +112,7 @@ public class AsciiReplaceFilter * To see the output inside an office environment * use "soffice ...params... >output.txt" */ - private long m_nStart; + private final long m_nStart; private long m_nLast ; private void measure( String sText ) diff --git a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/AsciiFilter/FilterOptions.java b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/AsciiFilter/FilterOptions.java index d821313ca00d..c740bc4d276d 100644 --- a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/AsciiFilter/FilterOptions.java +++ b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/AsciiFilter/FilterOptions.java @@ -69,8 +69,8 @@ public class FilterOptions // private members for internal things - private XMultiComponentFactory m_xMCF ; - private XComponentContext m_Ctx ; + private final XMultiComponentFactory m_xMCF; + private final XComponentContext m_Ctx; // interface diff --git a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_java/FlatXml.java b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_java/FlatXml.java index e096eb4660b8..e510d7ddf70d 100644 --- a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_java/FlatXml.java +++ b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_java/FlatXml.java @@ -55,9 +55,9 @@ public class FlatXml implements XImportFilter, XExportFilter, XServiceName, /* * private data members */ - private XMultiServiceFactory m_xServiceFactory; + private final XMultiServiceFactory m_xServiceFactory; private XExtendedDocumentHandler m_xHandler; - private boolean m_bPrettyPrint = true; + private final boolean m_bPrettyPrint = true; static private final String __serviceName = "devguide.officedev.samples.filter.FlatXmlJava"; static private final String __implName = "FlatXml"; diff --git a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/OneInstanceFactory.java b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/OneInstanceFactory.java index 9c9978da3ac2..1c3489d5be44 100644 --- a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/OneInstanceFactory.java +++ b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/OneInstanceFactory.java @@ -52,10 +52,10 @@ public class OneInstanceFactory implements XSingleComponentFactory, XServiceInfo { - private Class aMyClass; - private String aSvcImplName; - private String[] aSupportedSvcNames; - private XInterface xInstantiatedService; + private final Class aMyClass; + private final String aSvcImplName; + private final String[] aSupportedSvcNames; + private XInterface xInstantiatedService; public OneInstanceFactory( Class aMyClass, diff --git a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/PropChgHelper.java b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/PropChgHelper.java index 45b2d04d04f7..bc29513e73fe 100644 --- a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/PropChgHelper.java +++ b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/PropChgHelper.java @@ -47,10 +47,10 @@ public class PropChgHelper implements XPropertyChangeListener, XLinguServiceEventBroadcaster { - private XInterface xEvtSource; - private String[] aPropNames; + private final XInterface xEvtSource; + private final String[] aPropNames; private XPropertySet xPropSet; - private ArrayList<XLinguServiceEventListener> aLngSvcEvtListeners; + private final ArrayList<XLinguServiceEventListener> aLngSvcEvtListeners; public PropChgHelper( XInterface xEvtSource, diff --git a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/XHyphenatedWord_impl.java b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/XHyphenatedWord_impl.java index f0200973dfdc..44c8b6239465 100644 --- a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/XHyphenatedWord_impl.java +++ b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/XHyphenatedWord_impl.java @@ -39,10 +39,10 @@ public class XHyphenatedWord_impl implements { private String aWord; private String aHyphenatedWord; - private short nHyphenPos; - private short nHyphenationPos; + private final short nHyphenPos; + private final short nHyphenationPos; private Locale aLang; - private boolean bIsAltSpelling; + private final boolean bIsAltSpelling; public XHyphenatedWord_impl( String aWord, diff --git a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/XSpellAlternatives_impl.java b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/XSpellAlternatives_impl.java index aeb0275c978c..318aba8f6abb 100644 --- a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/XSpellAlternatives_impl.java +++ b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/XSpellAlternatives_impl.java @@ -41,7 +41,7 @@ public class XSpellAlternatives_impl implements private String aWord; private Locale aLanguage; private String[] aAlt; // list of alternatives, may be empty. - private short nType; // type of failure + private final short nType; // type of failure public XSpellAlternatives_impl( String aWord, diff --git a/odk/examples/DevelopersGuide/OfficeDev/Number_Formats.java b/odk/examples/DevelopersGuide/OfficeDev/Number_Formats.java index 4a406a0305a5..5cc323ebb289 100644 --- a/odk/examples/DevelopersGuide/OfficeDev/Number_Formats.java +++ b/odk/examples/DevelopersGuide/OfficeDev/Number_Formats.java @@ -207,7 +207,7 @@ public class Number_Formats // __________ private members and methods __________ - private XSpreadsheetDocument maSpreadsheetDoc; + private final XSpreadsheetDocument maSpreadsheetDoc; private XSpreadsheet maSheet; // the first sheet diff --git a/odk/examples/DevelopersGuide/OfficeDev/OfficeConnect.java b/odk/examples/DevelopersGuide/OfficeDev/OfficeConnect.java index f6ec7bf5a280..94936d6a248a 100644 --- a/odk/examples/DevelopersGuide/OfficeDev/OfficeConnect.java +++ b/odk/examples/DevelopersGuide/OfficeDev/OfficeConnect.java @@ -131,8 +131,8 @@ public class OfficeConnect private static OfficeConnect maConnection; // reference to remote office context - private com.sun.star.uno.XComponentContext mxOfficeContext; + private final com.sun.star.uno.XComponentContext mxOfficeContext; // reference to remote service manager - private com.sun.star.lang.XMultiComponentFactory mxServiceManager; + private final com.sun.star.lang.XMultiComponentFactory mxServiceManager; } |