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 | |
parent | 250391009aec9930abcc57930ddd4b6f56f4df9c (diff) |
java: make fields final where possible
found by PMD
Change-Id: I87780366119c141cd2dafe6ca1bf2d9798b10aec
Diffstat (limited to 'odk')
39 files changed, 101 insertions, 101 deletions
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<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; } 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<XResultListener> aListeners = new java.util.ArrayList<XResultListener>(); + private final java.util.ArrayList<XResultListener> aListeners = new java.util.ArrayList<XResultListener>(); public ExampleAddInResult( String aNewName ) { @@ -79,7 +79,7 @@ class ExampleAddInResult implements com.sun.star.sheet.XVolatileResult class ExampleAddInThread extends Thread { - private java.util.HashMap<String, ExampleAddInResult> aCounters; + private final java.util.HashMap<String, ExampleAddInResult> aCounters; public ExampleAddInThread( java.util.HashMap<String, ExampleAddInResult> 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; diff --git a/odk/examples/java/ConverterServlet/ConverterServlet.java b/odk/examples/java/ConverterServlet/ConverterServlet.java index 0870f7d75e28..6a22837a7f0b 100644 --- a/odk/examples/java/ConverterServlet/ConverterServlet.java +++ b/odk/examples/java/ConverterServlet/ConverterServlet.java @@ -68,16 +68,15 @@ import com.sun.star.lang.XMultiComponentFactory; public class ConverterServlet extends HttpServlet { /** Specifies the temporary directory on the web server. */ - private String stringWorkingDirectory = - System.getProperty( "java.io.tmpdir" ).replace( '\\', '/' ); + private String stringWorkingDirectory = System.getProperty( "java.io.tmpdir" ).replace( '\\', '/' ); /** Specifies the host for the office server. */ - private String stringHost = "localhost"; + private final String stringHost = "localhost"; /** Specifies the port for the office server. */ - private String stringPort = "2083"; + private final String stringPort = "2083"; /** Called by the server (via the service method) to allow a servlet to handle * a POST request. The file from the client will be uploaded to the web server diff --git a/odk/examples/java/EmbedDocument/EmbeddedObject/EditorFrame.java b/odk/examples/java/EmbedDocument/EmbeddedObject/EditorFrame.java index f923b15ab9fc..003fd572077e 100644 --- a/odk/examples/java/EmbedDocument/EmbeddedObject/EditorFrame.java +++ b/odk/examples/java/EmbedDocument/EmbeddedObject/EditorFrame.java @@ -26,11 +26,11 @@ import javax.imageio.ImageIO; public class EditorFrame extends JFrame { - private OwnEmbeddedObject m_aEmbObj; - private JTextArea m_aTextArea; + private final OwnEmbeddedObject m_aEmbObj; + private final JTextArea m_aTextArea; private BufferedImage m_aBufImage; - private WindowListener m_aCloser = new WindowAdapter() + private final WindowListener m_aCloser = new WindowAdapter() { @Override public void windowClosing( WindowEvent e ) diff --git a/odk/examples/java/Spreadsheet/ChartTypeChange.java b/odk/examples/java/Spreadsheet/ChartTypeChange.java index 271433890617..44673e2b6a50 100644 --- a/odk/examples/java/Spreadsheet/ChartTypeChange.java +++ b/odk/examples/java/Spreadsheet/ChartTypeChange.java @@ -79,11 +79,11 @@ public class ChartTypeChange { /** Service factory */ - private XMultiComponentFactory xMCF = null; + private final XMultiComponentFactory xMCF; /** Component context */ - private XComponentContext xCompContext = null; + private final XComponentContext xCompContext; /** Beginning of the program. * @param args No arguments will be passed to the class. diff --git a/odk/source/com/sun/star/lib/loader/WinRegKey.java b/odk/source/com/sun/star/lib/loader/WinRegKey.java index 9c51fbf95f26..fad5d34a8a76 100644 --- a/odk/source/com/sun/star/lib/loader/WinRegKey.java +++ b/odk/source/com/sun/star/lib/loader/WinRegKey.java @@ -31,8 +31,8 @@ import java.io.InputStream; */ final class WinRegKey { - private String m_rootKeyName; - private String m_subKeyName; + private final String m_rootKeyName; + private final String m_subKeyName; // native methods to access the windows registry private static native boolean winreg_RegOpenClassesRoot( long[] hkresult ); |