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 /toolkit/test/accessibility | |
parent | 250391009aec9930abcc57930ddd4b6f56f4df9c (diff) |
java: make fields final where possible
found by PMD
Change-Id: I87780366119c141cd2dafe6ca1bf2d9798b10aec
Diffstat (limited to 'toolkit/test/accessibility')
23 files changed, 60 insertions, 86 deletions
diff --git a/toolkit/test/accessibility/AccessibilityTree.java b/toolkit/test/accessibility/AccessibilityTree.java index 0f7ed8f3141e..844065d3e3b6 100644 --- a/toolkit/test/accessibility/AccessibilityTree.java +++ b/toolkit/test/accessibility/AccessibilityTree.java @@ -293,13 +293,13 @@ public class AccessibilityTree return bIsPopup; } - private AccessibilityTree maTree; + private final AccessibilityTree maTree; } class NodeAction extends AbstractAction { - private int mnIndex; - private AccessibleTreeNode maNode; + private final int mnIndex; + private final AccessibleTreeNode maNode; public NodeAction( String aName, AccessibleTreeNode aNode, int nIndex ) { @@ -317,8 +317,8 @@ public class AccessibilityTree // This action expands all shapes in the subtree rooted in the specified node. class ShapeExpandAction extends AbstractAction { - private AccessibilityTree maTree; - private AccTreeNode maNode; + private final AccessibilityTree maTree; + private final AccTreeNode maNode; public ShapeExpandAction (AccessibilityTree aTree, AccTreeNode aNode) { super ("Expand Shapes"); @@ -334,8 +334,8 @@ public class AccessibilityTree // This action expands all nodes in the subtree rooted in the specified node. class SubtreeExpandAction extends AbstractAction { - private AccessibilityTree maTree; - private AccTreeNode maNode; + private final AccessibilityTree maTree; + private final AccTreeNode maNode; public SubtreeExpandAction (AccessibilityTree aTree, AccTreeNode aNode) { super ("Expand Subtree"); @@ -383,6 +383,6 @@ public class AccessibilityTree protected AccessibleTreeCellRenderer maCellRenderer; - private JTree maTree; + private final JTree maTree; private int mnExpandLevel; } diff --git a/toolkit/test/accessibility/AccessibilityTreeModel.java b/toolkit/test/accessibility/AccessibilityTreeModel.java index ce6b5013583b..cee0f86842b6 100644 --- a/toolkit/test/accessibility/AccessibilityTreeModel.java +++ b/toolkit/test/accessibility/AccessibilityTreeModel.java @@ -494,7 +494,7 @@ public class AccessibilityTreeModel private final XAccessibleEventListener mxListener; // Map to translate from accessible object to corresponding tree node. - private NodeMap maNodeMap; + private final NodeMap maNodeMap; // If the lock count is higher then zero, then no events are processed. private int mnLockCount; diff --git a/toolkit/test/accessibility/AccessibleActionNode.java b/toolkit/test/accessibility/AccessibleActionNode.java index fcb029b4d3cc..c1c927574c9c 100644 --- a/toolkit/test/accessibility/AccessibleActionNode.java +++ b/toolkit/test/accessibility/AccessibleActionNode.java @@ -63,5 +63,5 @@ class AccessibleActionNode JOptionPane.INFORMATION_MESSAGE); } - private int mnActionIndex; + private final int mnActionIndex; } diff --git a/toolkit/test/accessibility/AccessibleTreeNode.java b/toolkit/test/accessibility/AccessibleTreeNode.java index 9398385df714..a127402bd30d 100644 --- a/toolkit/test/accessibility/AccessibleTreeNode.java +++ b/toolkit/test/accessibility/AccessibleTreeNode.java @@ -29,7 +29,7 @@ class AccessibleTreeNode protected AccessibleTreeNode maParent; /// The object to be displayed. - private Object maDisplayObject; + private final Object maDisplayObject; public AccessibleTreeNode (Object aDisplayObject, AccessibleTreeNode aParent) { diff --git a/toolkit/test/accessibility/Canvas.java b/toolkit/test/accessibility/Canvas.java index aca2e1f209d5..0aeec9c24ea6 100644 --- a/toolkit/test/accessibility/Canvas.java +++ b/toolkit/test/accessibility/Canvas.java @@ -451,11 +451,11 @@ class Canvas mnScale; private CanvasShape maActiveObject; - private java.util.HashMap<AccTreeNode, CanvasShape> + private final java.util.HashMap<AccTreeNode, CanvasShape> maObjects; - private List<CanvasShape> + private final List<CanvasShape> maObjectList; - private List<AccTreeNode> + private final List<AccTreeNode> maNodes; private Rectangle maBoundingBox; diff --git a/toolkit/test/accessibility/CanvasShape.java b/toolkit/test/accessibility/CanvasShape.java index 41d82b1230c7..b0767e619a0b 100644 --- a/toolkit/test/accessibility/CanvasShape.java +++ b/toolkit/test/accessibility/CanvasShape.java @@ -299,24 +299,14 @@ class CanvasShape +"x"+maSize.width+"x"+maSize.height+"<"; } - private AccTreeNode - maNode; - private XAccessibleContext - mxContext; - private XAccessibleComponent - mxComponent; - private String - msDescription, - msName; - private Rectangle2D.Double - maShape; - private Point - maPosition; - private Dimension - maSize; - private Color - maFgColor, - maBgColor; + private final AccTreeNode maNode; + private final XAccessibleContext mxContext; + private final XAccessibleComponent mxComponent; + private String msDescription, msName; + private Rectangle2D.Double maShape; + private Point maPosition; + private Dimension maSize; + private Color maFgColor, maBgColor; private boolean // Highlighting objects is an internal concept. Corresponds to selection in the tree view. mbHighlighted, @@ -324,6 +314,5 @@ class CanvasShape mbSelected, // Set when the accessible object is focused. mbFocused; - private int - mnRole; + private int mnRole; } diff --git a/toolkit/test/accessibility/ChildEventHandler.java b/toolkit/test/accessibility/ChildEventHandler.java index 3a3eb5af30ff..e36f3502ad45 100644 --- a/toolkit/test/accessibility/ChildEventHandler.java +++ b/toolkit/test/accessibility/ChildEventHandler.java @@ -61,6 +61,6 @@ class ChildEventHandler } - private XAccessible mxOldChild; - private XAccessible mxNewChild; + private final XAccessible mxOldChild; + private final XAccessible mxNewChild; } diff --git a/toolkit/test/accessibility/EventListener.java b/toolkit/test/accessibility/EventListener.java index d4d1227ac774..43a53774a910 100644 --- a/toolkit/test/accessibility/EventListener.java +++ b/toolkit/test/accessibility/EventListener.java @@ -104,5 +104,5 @@ public class EventListener } - private AccessibilityTreeModel maTreeModel; + private final AccessibilityTreeModel maTreeModel; } diff --git a/toolkit/test/accessibility/EventQueue.java b/toolkit/test/accessibility/EventQueue.java index 684f4027eb1a..5658ce2414d6 100644 --- a/toolkit/test/accessibility/EventQueue.java +++ b/toolkit/test/accessibility/EventQueue.java @@ -133,9 +133,9 @@ class EventQueue } private static EventQueue maInstance = null; - private Object maMonitor; - private LinkedList<Runnable> maRegularQueue; - private LinkedList<Runnable> maDisposingQueue; + private final Object maMonitor; + private final LinkedList<Runnable> maRegularQueue; + private final LinkedList<Runnable> maDisposingQueue; } diff --git a/toolkit/test/accessibility/MessageArea.java b/toolkit/test/accessibility/MessageArea.java index 5b3c1946db14..1b83d567c77c 100644 --- a/toolkit/test/accessibility/MessageArea.java +++ b/toolkit/test/accessibility/MessageArea.java @@ -138,5 +138,5 @@ public class MessageArea private static MessageArea saInstance = null; - private JTextArea maText; + private final JTextArea maText; } diff --git a/toolkit/test/accessibility/NodeFactory.java b/toolkit/test/accessibility/NodeFactory.java index 8c288396e4a2..51b126a7a4ee 100644 --- a/toolkit/test/accessibility/NodeFactory.java +++ b/toolkit/test/accessibility/NodeFactory.java @@ -34,21 +34,6 @@ class NodeFactory private NodeFactory () { - maContextHandler = new AccessibleContextHandler(); - maTextHandler = new AccessibleTextHandler(); - maEditableTextHandler = new AccessibleEditableTextHandler(); - maComponentHandler = new AccessibleComponentHandler(); - maExtendedComponentHandler = new AccessibleExtendedComponentHandler(); - maActionHandler = new AccessibleActionHandler(); - maImageHandler = new AccessibleImageHandler(); - maTableHandler = new AccessibleTableHandler(); - maCellHandler = new AccessibleCellHandler(); - maHypertextHandler = new AccessibleHypertextHandler(); - maHyperlinkHandler = new AccessibleHyperlinkHandler(); - maSelectionHandler = new AccessibleSelectionHandler(); - maRelationHandler = new AccessibleRelationHandler(); - maTreeHandler = new AccessibleTreeHandler(); - maUNOHandler = new AccessibleUNOHandler(); } @@ -139,19 +124,19 @@ class NodeFactory private static NodeFactory maInstance = null; // default handlers - private NodeHandler maContextHandler = new AccessibleContextHandler(); - private NodeHandler maTextHandler = new AccessibleTextHandler(); - private NodeHandler maEditableTextHandler = new AccessibleEditableTextHandler(); - private NodeHandler maComponentHandler = new AccessibleComponentHandler(); - private NodeHandler maExtendedComponentHandler = new AccessibleExtendedComponentHandler(); - private NodeHandler maActionHandler = new AccessibleActionHandler(); - private NodeHandler maImageHandler = new AccessibleImageHandler(); - private NodeHandler maTableHandler = new AccessibleTableHandler(); - private NodeHandler maCellHandler = new AccessibleCellHandler(); - private NodeHandler maHypertextHandler = new AccessibleHypertextHandler(); - private NodeHandler maHyperlinkHandler = new AccessibleHyperlinkHandler(); - private NodeHandler maSelectionHandler = new AccessibleSelectionHandler(); - private NodeHandler maRelationHandler = new AccessibleRelationHandler(); - private NodeHandler maTreeHandler = new AccessibleTreeHandler(); - private NodeHandler maUNOHandler = new AccessibleUNOHandler(); + private final NodeHandler maContextHandler = new AccessibleContextHandler(); + private final NodeHandler maTextHandler = new AccessibleTextHandler(); + private final NodeHandler maEditableTextHandler = new AccessibleEditableTextHandler(); + private final NodeHandler maComponentHandler = new AccessibleComponentHandler(); + private final NodeHandler maExtendedComponentHandler = new AccessibleExtendedComponentHandler(); + private final NodeHandler maActionHandler = new AccessibleActionHandler(); + private final NodeHandler maImageHandler = new AccessibleImageHandler(); + private final NodeHandler maTableHandler = new AccessibleTableHandler(); + private final NodeHandler maCellHandler = new AccessibleCellHandler(); + private final NodeHandler maHypertextHandler = new AccessibleHypertextHandler(); + private final NodeHandler maHyperlinkHandler = new AccessibleHyperlinkHandler(); + private final NodeHandler maSelectionHandler = new AccessibleSelectionHandler(); + private final NodeHandler maRelationHandler = new AccessibleRelationHandler(); + private final NodeHandler maTreeHandler = new AccessibleTreeHandler(); + private final NodeHandler maUNOHandler = new AccessibleUNOHandler(); } diff --git a/toolkit/test/accessibility/NodeMap.java b/toolkit/test/accessibility/NodeMap.java index 6050aa2ef276..aaf4baafff02 100644 --- a/toolkit/test/accessibility/NodeMap.java +++ b/toolkit/test/accessibility/NodeMap.java @@ -126,5 +126,5 @@ class NodeMap - private HashMap<XAccessibleContext, AccessibleTreeNode> maXAccessibleToNode; + private final HashMap<XAccessibleContext, AccessibleTreeNode> maXAccessibleToNode; } diff --git a/toolkit/test/accessibility/OfficeConnection.java b/toolkit/test/accessibility/OfficeConnection.java index 43d4d2e24f9f..eb43847f95db 100644 --- a/toolkit/test/accessibility/OfficeConnection.java +++ b/toolkit/test/accessibility/OfficeConnection.java @@ -95,7 +95,7 @@ public class OfficeConnection } } - private int mnDefaultPort = 5678; + private final int mnDefaultPort; private static final String msDefaultHost = "localhost"; private XMultiServiceFactory maServiceManager = null; diff --git a/toolkit/test/accessibility/QueuedListener.java b/toolkit/test/accessibility/QueuedListener.java index 5235da380cd7..a34b33549734 100644 --- a/toolkit/test/accessibility/QueuedListener.java +++ b/toolkit/test/accessibility/QueuedListener.java @@ -64,7 +64,7 @@ class QueuedListener ); } - private EventListener maListener; + private final EventListener maListener; } diff --git a/toolkit/test/accessibility/QueuedTopWindowListener.java b/toolkit/test/accessibility/QueuedTopWindowListener.java index 921fef1a37fd..96778c718fae 100644 --- a/toolkit/test/accessibility/QueuedTopWindowListener.java +++ b/toolkit/test/accessibility/QueuedTopWindowListener.java @@ -93,5 +93,5 @@ class QueuedTopWindowListener ); } - private TopWindowListener maListener; + private final TopWindowListener maListener; } diff --git a/toolkit/test/accessibility/SelectionDialog.java b/toolkit/test/accessibility/SelectionDialog.java index 10d8413b29f5..6f08532cce8e 100644 --- a/toolkit/test/accessibility/SelectionDialog.java +++ b/toolkit/test/accessibility/SelectionDialog.java @@ -199,5 +199,5 @@ class SelectionDialog extends JDialog private JList maChildrenSelector; private XAccessibleSelection mxSelection; - private AccTreeNode maNode; + private final AccTreeNode maNode; } diff --git a/toolkit/test/accessibility/TopWindowListener.java b/toolkit/test/accessibility/TopWindowListener.java index eeb781534292..3654b970099f 100644 --- a/toolkit/test/accessibility/TopWindowListener.java +++ b/toolkit/test/accessibility/TopWindowListener.java @@ -169,8 +169,8 @@ class TopWindowListener - private AccessibilityTreeModel + private final AccessibilityTreeModel maModel; - private SimpleOffice + private final SimpleOffice maOffice; } diff --git a/toolkit/test/accessibility/VectorNode.java b/toolkit/test/accessibility/VectorNode.java index 68cfbfd66844..c1ffcd650421 100644 --- a/toolkit/test/accessibility/VectorNode.java +++ b/toolkit/test/accessibility/VectorNode.java @@ -26,7 +26,7 @@ import com.sun.star.lang.IndexOutOfBoundsException; class VectorNode extends StringNode { - private ArrayList<AccessibleTreeNode> maChildren; + private final ArrayList<AccessibleTreeNode> maChildren; public VectorNode (String sDisplayObject, AccessibleTreeNode aParent) { diff --git a/toolkit/test/accessibility/ov/ContextView.java b/toolkit/test/accessibility/ov/ContextView.java index a687d7eb61d5..0751ef86e030 100644 --- a/toolkit/test/accessibility/ov/ContextView.java +++ b/toolkit/test/accessibility/ov/ContextView.java @@ -133,7 +133,7 @@ public class ContextView } - private JLabel + private final JLabel maName, maDescription, maRole; diff --git a/toolkit/test/accessibility/ov/FocusView.java b/toolkit/test/accessibility/ov/FocusView.java index 00a9258ad534..8ae028841c4e 100644 --- a/toolkit/test/accessibility/ov/FocusView.java +++ b/toolkit/test/accessibility/ov/FocusView.java @@ -135,7 +135,7 @@ public class FocusView Update (); } - private JLabel maFocused; - private JButton maGrabFocus; + private final JLabel maFocused; + private final JButton maGrabFocus; private XAccessibleComponent mxComponent; } diff --git a/toolkit/test/accessibility/ov/ObjectViewContainer.java b/toolkit/test/accessibility/ov/ObjectViewContainer.java index a22d61ebd9a6..e0b5cc08252e 100644 --- a/toolkit/test/accessibility/ov/ObjectViewContainer.java +++ b/toolkit/test/accessibility/ov/ObjectViewContainer.java @@ -165,7 +165,7 @@ public class ObjectViewContainer } } - private Border maViewBorder; + private final Border maViewBorder; /// List of view templates which are instantiated when new object is set. - private ArrayList<Class> maViewTemplates; + private final ArrayList<Class> maViewTemplates; } diff --git a/toolkit/test/accessibility/ov/StateSetView.java b/toolkit/test/accessibility/ov/StateSetView.java index 8933fb65c197..4829889e1b1d 100644 --- a/toolkit/test/accessibility/ov/StateSetView.java +++ b/toolkit/test/accessibility/ov/StateSetView.java @@ -258,7 +258,7 @@ public static class StateSetSetView } } - private JLabel maStates; + private final JLabel maStates; } } diff --git a/toolkit/test/accessibility/ov/TextView.java b/toolkit/test/accessibility/ov/TextView.java index a38b426b2cf1..9962645b5180 100644 --- a/toolkit/test/accessibility/ov/TextView.java +++ b/toolkit/test/accessibility/ov/TextView.java @@ -132,7 +132,7 @@ public class TextView } } - private JLabel + private final JLabel maTextLabel, maCaretPositionLabel; private XAccessibleText mxText; |