From 0063cf285696951e336b9cec1da8881997b286ce Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 18 Nov 2014 10:01:21 +0200 Subject: java: make fields final where possible found by PMD Change-Id: I87780366119c141cd2dafe6ca1bf2d9798b10aec --- .../DevelopersGuide/Charts/CalcHelper.java | 2 +- .../DevelopersGuide/Charts/ChartHelper.java | 2 +- .../DevelopersGuide/Charts/ChartInCalc.java | 4 +-- .../DevelopersGuide/Charts/ChartInDraw.java | 4 +-- .../DevelopersGuide/Charts/ChartInWriter.java | 4 +-- .../Charts/ListenAtCalcRangeInDraw.java | 6 ++--- .../Charts/SelectionChangeListener.java | 6 ++--- .../ProtocolHandlerAddon.java | 2 +- .../Components/JavaComponent/TestComponentB.java | 2 +- .../dialogcomponent/DialogComponent.java | 2 +- .../DevelopersGuide/Config/ConfigExamples.java | 4 +-- odk/examples/DevelopersGuide/Database/Sales.java | 2 +- .../DevelopersGuide/Database/SalesMan.java | 2 +- odk/examples/DevelopersGuide/Database/sdbcx.java | 5 ++-- .../GUI/RoadmapItemStateChangeListener.java | 2 +- .../DesktopEnvironment/CustomizeView.java | 10 ++++---- .../OfficeDev/DesktopEnvironment/DocumentView.java | 6 ++--- .../DesktopEnvironment/JavaWindowPeerFake.java | 2 +- .../DesktopEnvironment/OnewayExecutor.java | 6 ++--- .../DesktopEnvironment/StatusListener.java | 6 ++--- .../OfficeDev/DesktopEnvironment/StatusView.java | 10 ++++---- .../AsciiFilter/AsciiReplaceFilter.java | 2 +- .../AsciiFilter/FilterOptions.java | 4 +-- .../FlatXmlFilter_java/FlatXml.java | 4 +-- .../OfficeDev/Linguistic/OneInstanceFactory.java | 8 +++--- .../OfficeDev/Linguistic/PropChgHelper.java | 6 ++--- .../OfficeDev/Linguistic/XHyphenatedWord_impl.java | 6 ++--- .../Linguistic/XSpellAlternatives_impl.java | 2 +- .../DevelopersGuide/OfficeDev/Number_Formats.java | 2 +- .../DevelopersGuide/OfficeDev/OfficeConnect.java | 4 +-- .../InterprocessConn/ConnectionAwareClient.java | 8 +++--- .../ScriptSelector/ScriptSelector.java | 8 +++--- .../DevelopersGuide/Spreadsheet/ExampleAddIn.java | 6 ++--- .../Spreadsheet/ExampleDataPilotSource.java | 30 +++++++++++----------- .../DevelopersGuide/Text/TextDocuments.java | 2 +- 35 files changed, 91 insertions(+), 90 deletions(-) (limited to 'odk/examples/DevelopersGuide') diff --git a/odk/examples/DevelopersGuide/Charts/CalcHelper.java b/odk/examples/DevelopersGuide/Charts/CalcHelper.java index 50364bdc0fbd..242e7676853d 100644 --- a/odk/examples/DevelopersGuide/Charts/CalcHelper.java +++ b/odk/examples/DevelopersGuide/Charts/CalcHelper.java @@ -342,7 +342,7 @@ public class CalcHelper private static final String msDataSheetName = "Data"; private static final String msChartSheetName = "Chart"; - private XSpreadsheetDocument maSpreadSheetDoc; + private final XSpreadsheetDocument maSpreadSheetDoc; diff --git a/odk/examples/DevelopersGuide/Charts/ChartHelper.java b/odk/examples/DevelopersGuide/Charts/ChartHelper.java index 043635fe169e..1a79560fa94b 100644 --- a/odk/examples/DevelopersGuide/Charts/ChartHelper.java +++ b/odk/examples/DevelopersGuide/Charts/ChartHelper.java @@ -237,5 +237,5 @@ public class ChartHelper private static final String msChartClassID = "12dcae26-281f-416f-a234-c3086127382e"; - private XModel maContainerDocument; + private final XModel maContainerDocument; } diff --git a/odk/examples/DevelopersGuide/Charts/ChartInCalc.java b/odk/examples/DevelopersGuide/Charts/ChartInCalc.java index 76791e3bb9f9..ed55332e6128 100644 --- a/odk/examples/DevelopersGuide/Charts/ChartInCalc.java +++ b/odk/examples/DevelopersGuide/Charts/ChartInCalc.java @@ -409,6 +409,6 @@ public class ChartInCalc // private members - private XChartDocument maChartDocument; - private XDiagram maDiagram; + private final XChartDocument maChartDocument; + private final XDiagram maDiagram; } diff --git a/odk/examples/DevelopersGuide/Charts/ChartInDraw.java b/odk/examples/DevelopersGuide/Charts/ChartInDraw.java index 19e4855461e5..eec3be116244 100644 --- a/odk/examples/DevelopersGuide/Charts/ChartInDraw.java +++ b/odk/examples/DevelopersGuide/Charts/ChartInDraw.java @@ -286,6 +286,6 @@ public class ChartInDraw // private members - private XChartDocument maChartDocument; - private XDiagram maDiagram; + private final XChartDocument maChartDocument; + private final XDiagram maDiagram; } diff --git a/odk/examples/DevelopersGuide/Charts/ChartInWriter.java b/odk/examples/DevelopersGuide/Charts/ChartInWriter.java index 124616db46be..940a8cfc056b 100644 --- a/odk/examples/DevelopersGuide/Charts/ChartInWriter.java +++ b/odk/examples/DevelopersGuide/Charts/ChartInWriter.java @@ -155,6 +155,6 @@ public class ChartInWriter // private members - private XChartDocument maChartDocument; - private XDiagram maDiagram; + private final XChartDocument maChartDocument; + private final XDiagram maDiagram; } diff --git a/odk/examples/DevelopersGuide/Charts/ListenAtCalcRangeInDraw.java b/odk/examples/DevelopersGuide/Charts/ListenAtCalcRangeInDraw.java index 48108d8b21d1..36e7b3e4ec92 100644 --- a/odk/examples/DevelopersGuide/Charts/ListenAtCalcRangeInDraw.java +++ b/odk/examples/DevelopersGuide/Charts/ListenAtCalcRangeInDraw.java @@ -184,7 +184,7 @@ public class ListenAtCalcRangeInDraw implements XChartDataChangeEventListener // __________ private __________ - private XSpreadsheetDocument maSheetDoc; - private XChartDocument maChartDocument; - private XChartData maChartData; + private final XSpreadsheetDocument maSheetDoc; + private final XChartDocument maChartDocument; + private final XChartData maChartData; } diff --git a/odk/examples/DevelopersGuide/Charts/SelectionChangeListener.java b/odk/examples/DevelopersGuide/Charts/SelectionChangeListener.java index 9cfeb9e81f1f..190f8214fb03 100644 --- a/odk/examples/DevelopersGuide/Charts/SelectionChangeListener.java +++ b/odk/examples/DevelopersGuide/Charts/SelectionChangeListener.java @@ -177,7 +177,7 @@ public class SelectionChangeListener implements XSelectionChangeListener { // __________ private __________ private class MyMessageBox extends Thread{ - private XMultiComponentFactory mMCF; + private final XMultiComponentFactory mMCF; public MyMessageBox(XMultiComponentFactory xMCF){ mMCF = xMCF; @@ -212,6 +212,6 @@ public class SelectionChangeListener implements XSelectionChangeListener { } } - private XChartDocument maChartDocument; - private XComponentContext maContext; + private final XChartDocument maChartDocument; + private final XComponentContext maContext; } diff --git a/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_java/ProtocolHandlerAddon.java b/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_java/ProtocolHandlerAddon.java index 239296cc30e5..a969253bc9c4 100644 --- a/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_java/ProtocolHandlerAddon.java +++ b/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_java/ProtocolHandlerAddon.java @@ -68,7 +68,7 @@ public class ProtocolHandlerAddon { /** The component context, that gives access to the service manager and all registered services. */ - private XComponentContext m_xCmpCtx; + private final XComponentContext m_xCmpCtx; /** The toolkit, that we can create UNO dialogs. */ diff --git a/odk/examples/DevelopersGuide/Components/JavaComponent/TestComponentB.java b/odk/examples/DevelopersGuide/Components/JavaComponent/TestComponentB.java index 15589707be4d..cf28e4c5ae86 100644 --- a/odk/examples/DevelopersGuide/Components/JavaComponent/TestComponentB.java +++ b/odk/examples/DevelopersGuide/Components/JavaComponent/TestComponentB.java @@ -43,7 +43,7 @@ import com.sun.star.uno.Type; public class TestComponentB implements XTypeProvider, XServiceInfo, XSomethingB { static final String __serviceName= "com.sun.star.test.SomethingB"; - private Object[] args; + private final Object[] args; public TestComponentB(XComponentContext context, Object[] args) { this.args= args; diff --git a/odk/examples/DevelopersGuide/Components/dialogcomponent/DialogComponent.java b/odk/examples/DevelopersGuide/Components/dialogcomponent/DialogComponent.java index e184400d8fb9..083347cb69b9 100644 --- a/odk/examples/DevelopersGuide/Components/dialogcomponent/DialogComponent.java +++ b/odk/examples/DevelopersGuide/Components/dialogcomponent/DialogComponent.java @@ -71,7 +71,7 @@ public class DialogComponent { private static final String __serviceName= "com.sun.star.test.TestDialogHandler"; - private XComponentContext m_xCmpCtx; + private final XComponentContext m_xCmpCtx; private XFrame m_xFrame; private XToolkit m_xToolkit; diff --git a/odk/examples/DevelopersGuide/Config/ConfigExamples.java b/odk/examples/DevelopersGuide/Config/ConfigExamples.java index 2cca38513f99..510425d57e32 100644 --- a/odk/examples/DevelopersGuide/Config/ConfigExamples.java +++ b/odk/examples/DevelopersGuide/Config/ConfigExamples.java @@ -82,10 +82,10 @@ import com.sun.star.util.ChangesEvent; public class ConfigExamples { // The ComponentContext interface of the remote component context - private XComponentContext mxContext = null; + private final XComponentContext mxContext; // The MultiComponentFactory interface of the ServiceManager - private XMultiComponentFactory mxServiceManager = null; + private final XMultiComponentFactory mxServiceManager; // The MultiServiceFactory interface of the ConfigurationProvider private XMultiServiceFactory mxProvider = null; diff --git a/odk/examples/DevelopersGuide/Database/Sales.java b/odk/examples/DevelopersGuide/Database/Sales.java index 1733d21930b0..11a22a4fab86 100644 --- a/odk/examples/DevelopersGuide/Database/Sales.java +++ b/odk/examples/DevelopersGuide/Database/Sales.java @@ -38,7 +38,7 @@ import com.sun.star.sdbc.*; public class Sales { - private XConnection con; + private final XConnection con; public Sales(XConnection connection ) { diff --git a/odk/examples/DevelopersGuide/Database/SalesMan.java b/odk/examples/DevelopersGuide/Database/SalesMan.java index 5aead056c4c6..c88e5c86ab63 100644 --- a/odk/examples/DevelopersGuide/Database/SalesMan.java +++ b/odk/examples/DevelopersGuide/Database/SalesMan.java @@ -38,7 +38,7 @@ import com.sun.star.sdbc.*; public class SalesMan { - private XConnection con; + private final XConnection con; public SalesMan(XConnection connection ) { diff --git a/odk/examples/DevelopersGuide/Database/sdbcx.java b/odk/examples/DevelopersGuide/Database/sdbcx.java index fb498591f2ac..ddb263cd938d 100644 --- a/odk/examples/DevelopersGuide/Database/sdbcx.java +++ b/odk/examples/DevelopersGuide/Database/sdbcx.java @@ -44,11 +44,12 @@ import com.sun.star.lang.XMultiServiceFactory; public class sdbcx { - private XMultiServiceFactory xORB; + private final XMultiServiceFactory xORB; private static XConnection con; private XTablesSupplier xTabSup; - public static XMultiServiceFactory rSmgr; + public static XMultiServiceFactory rSmgr; + public static void main(String argv[]) throws java.lang.Exception { try{ diff --git a/odk/examples/DevelopersGuide/GUI/RoadmapItemStateChangeListener.java b/odk/examples/DevelopersGuide/GUI/RoadmapItemStateChangeListener.java index 61fbf5f6958b..caa62f5220f1 100644 --- a/odk/examples/DevelopersGuide/GUI/RoadmapItemStateChangeListener.java +++ b/odk/examples/DevelopersGuide/GUI/RoadmapItemStateChangeListener.java @@ -39,7 +39,7 @@ import com.sun.star.uno.UnoRuntime; public class RoadmapItemStateChangeListener implements XItemListener { - private com.sun.star.lang.XMultiServiceFactory m_xMSFDialogModel; + private final com.sun.star.lang.XMultiServiceFactory m_xMSFDialogModel; public RoadmapItemStateChangeListener(com.sun.star.lang.XMultiServiceFactory xMSFDialogModel) { m_xMSFDialogModel = xMSFDialogModel; 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 m_lParams ; + private final IOnewayLink m_rLink ; + private final int m_nRequest ; + private final ArrayList 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 aLngSvcEvtListeners; + private final ArrayList 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; } diff --git a/odk/examples/DevelopersGuide/ProfUNO/InterprocessConn/ConnectionAwareClient.java b/odk/examples/DevelopersGuide/ProfUNO/InterprocessConn/ConnectionAwareClient.java index 35b15635fbf6..6b1dead7d8fe 100644 --- a/odk/examples/DevelopersGuide/ProfUNO/InterprocessConn/ConnectionAwareClient.java +++ b/odk/examples/DevelopersGuide/ProfUNO/InterprocessConn/ConnectionAwareClient.java @@ -53,11 +53,11 @@ import com.sun.star.bridge.XBridge; public class ConnectionAwareClient extends java.awt.Frame implements ActionListener , com.sun.star.lang.XEventListener { - private Button _btnWriter; - private Label _txtLabel; - private String _url; + private final Button _btnWriter; + private final Label _txtLabel; + private final String _url; - private XComponentContext _ctx; + private final XComponentContext _ctx; private com.sun.star.frame.XComponentLoader _officeComponentLoader; diff --git a/odk/examples/DevelopersGuide/ScriptingFramework/ScriptSelector/ScriptSelector/ScriptSelector.java b/odk/examples/DevelopersGuide/ScriptingFramework/ScriptSelector/ScriptSelector/ScriptSelector.java index b117d7f35c86..2fb6f3c68f24 100644 --- a/odk/examples/DevelopersGuide/ScriptingFramework/ScriptSelector/ScriptSelector/ScriptSelector.java +++ b/odk/examples/DevelopersGuide/ScriptingFramework/ScriptSelector/ScriptSelector/ScriptSelector.java @@ -196,7 +196,7 @@ public class ScriptSelector { class ScriptSelectorPanel extends JPanel { - private XBrowseNode myrootnode = null; + private final XBrowseNode myrootnode; public JTextField textField; public JTree tree; @@ -308,9 +308,9 @@ class ScriptSelectorPanel extends JPanel { class ScriptTreeRenderer extends DefaultTreeCellRenderer { - private ImageIcon sofficeIcon; - private ImageIcon scriptIcon; - private ImageIcon containerIcon; + private final ImageIcon sofficeIcon; + private final ImageIcon scriptIcon; + private final ImageIcon containerIcon; public ScriptTreeRenderer() { sofficeIcon = new ImageIcon(getClass().getResource("soffice.gif")); diff --git a/odk/examples/DevelopersGuide/Spreadsheet/ExampleAddIn.java b/odk/examples/DevelopersGuide/Spreadsheet/ExampleAddIn.java index c30115770325..a3a2e0975204 100644 --- a/odk/examples/DevelopersGuide/Spreadsheet/ExampleAddIn.java +++ b/odk/examples/DevelopersGuide/Spreadsheet/ExampleAddIn.java @@ -36,9 +36,9 @@ import com.sun.star.sheet.XResultListener; class ExampleAddInResult implements com.sun.star.sheet.XVolatileResult { - private String aName; + private final String aName; private int nValue; - private java.util.ArrayList aListeners = new java.util.ArrayList(); + private final java.util.ArrayList aListeners = new java.util.ArrayList(); public ExampleAddInResult( String aNewName ) { @@ -79,7 +79,7 @@ class ExampleAddInResult implements com.sun.star.sheet.XVolatileResult class ExampleAddInThread extends Thread { - private java.util.HashMap aCounters; + private final java.util.HashMap aCounters; public ExampleAddInThread( java.util.HashMap aResults ) { diff --git a/odk/examples/DevelopersGuide/Spreadsheet/ExampleDataPilotSource.java b/odk/examples/DevelopersGuide/Spreadsheet/ExampleDataPilotSource.java index 593e8e572f48..445b75da053e 100644 --- a/odk/examples/DevelopersGuide/Spreadsheet/ExampleDataPilotSource.java +++ b/odk/examples/DevelopersGuide/Spreadsheet/ExampleDataPilotSource.java @@ -60,7 +60,7 @@ class ExampleSettings class ExamplePropertySetInfo implements com.sun.star.beans.XPropertySetInfo { - private com.sun.star.beans.Property[] aProperties; + private final com.sun.star.beans.Property[] aProperties; public ExamplePropertySetInfo( com.sun.star.beans.Property[] aProps ) { @@ -95,7 +95,7 @@ class ExamplePropertySetInfo implements com.sun.star.beans.XPropertySetInfo class ExampleMember implements com.sun.star.container.XNamed, com.sun.star.beans.XPropertySet { - private int nMember; + private final int nMember; public ExampleMember( int nMbr ) { @@ -171,7 +171,7 @@ class ExampleMember implements com.sun.star.container.XNamed, class ExampleMembers implements com.sun.star.container.XNameAccess { - private ExampleSettings aSettings; + private final ExampleSettings aSettings; private ExampleMember[] aMembers; public ExampleMembers( ExampleSettings aSet ) @@ -233,8 +233,8 @@ class ExampleLevel implements com.sun.star.sheet.XDataPilotMemberResults, com.sun.star.beans.XPropertySet { - private ExampleSettings aSettings; - private int nDimension; + private final ExampleSettings aSettings; + private final int nDimension; private ExampleMembers aMembers; public ExampleLevel( ExampleSettings aSet, int nDim ) @@ -379,8 +379,8 @@ class ExampleLevel implements class ExampleLevels implements com.sun.star.container.XNameAccess { - private ExampleSettings aSettings; - private int nDimension; + private final ExampleSettings aSettings; + private final int nDimension; private ExampleLevel aLevel; public ExampleLevels( ExampleSettings aSet, int nDim ) @@ -432,8 +432,8 @@ class ExampleLevels implements com.sun.star.container.XNameAccess class ExampleHierarchy implements com.sun.star.container.XNamed, com.sun.star.sheet.XLevelsSupplier { - private ExampleSettings aSettings; - private int nDimension; + private final ExampleSettings aSettings; + private final int nDimension; private ExampleLevels aLevels; public ExampleHierarchy( ExampleSettings aSet, int nDim ) @@ -468,8 +468,8 @@ class ExampleHierarchy implements com.sun.star.container.XNamed, class ExampleHierarchies implements com.sun.star.container.XNameAccess { - private ExampleSettings aSettings; - private int nDimension; + private final ExampleSettings aSettings; + private final int nDimension; private ExampleHierarchy aHierarchy; public ExampleHierarchies( ExampleSettings aSet, int nDim ) @@ -524,8 +524,8 @@ class ExampleDimension implements com.sun.star.util.XCloneable, com.sun.star.beans.XPropertySet { - private ExampleSettings aSettings; - private int nDimension; + private final ExampleSettings aSettings; + private final int nDimension; private ExampleHierarchies aHierarchies; private com.sun.star.sheet.DataPilotFieldOrientation eOrientation; @@ -694,7 +694,7 @@ class ExampleDimension implements class ExampleDimensions implements com.sun.star.container.XNameAccess { - private ExampleSettings aSettings; + private final ExampleSettings aSettings; private ExampleDimension[] aDimensions; public ExampleDimensions( ExampleSettings aSet ) @@ -763,7 +763,7 @@ public class ExampleDataPilotSource static private final String aServiceName = "com.sun.star.sheet.DataPilotSource"; static private final String aImplName = _ExampleDataPilotSource.class.getName(); - private ExampleSettings aSettings = new ExampleSettings(); + private final ExampleSettings aSettings = new ExampleSettings(); private ExampleDimensions aDimensions; public _ExampleDataPilotSource( com.sun.star.lang.XMultiServiceFactory xFactory ) diff --git a/odk/examples/DevelopersGuide/Text/TextDocuments.java b/odk/examples/DevelopersGuide/Text/TextDocuments.java index d1d09442e6ab..e70e5a640f34 100644 --- a/odk/examples/DevelopersGuide/Text/TextDocuments.java +++ b/odk/examples/DevelopersGuide/Text/TextDocuments.java @@ -110,7 +110,7 @@ public class TextDocuments { // adjust these constant to your local printer! private static String sOutputDir; - private String aPrinterName = "\\\\so-print\\xml3sof"; + private final String aPrinterName = "\\\\so-print\\xml3sof"; private XComponentContext mxRemoteContext = null; private XMultiComponentFactory mxRemoteServiceManager = null; -- cgit