Skip to content

Commit c65be0b

Browse files
committed
Tiny cleanup of final/volatile attributes in variable declarations.
Changes to be committed: modified: model/GlobalEventNotifier.java modified: ui/NewVersionPopup.java
1 parent ae515cd commit c65be0b

File tree

2 files changed

+19
-17
lines changed

2 files changed

+19
-17
lines changed

drjava/src/edu/rice/cs/drjava/model/GlobalEventNotifier.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@
5454
* multiple notifications (reads) can occur simultaneously, but only one thread can be adding or removing listeners
5555
* (writing) at a time, and no reads can occur during a write.
5656
* <p>
57-
* <i>No</i> methods on this class should be synchronized using traditional Java synchronization!
57+
* <i>No</i> methods on this class should be synchronized using traditional Java synchronization! Methods in this
58+
* class should be executed in the Dispatch thread, but no run-time checks are performed. Perhaps such checks should be
59+
* inserted in this code.
5860
* <p>
5961
* @version $Id$
6062
*/

drjava/src/edu/rice/cs/drjava/ui/NewVersionPopup.java

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -54,25 +54,25 @@
5454
*/
5555
public class NewVersionPopup extends JDialog {
5656
/** whether to keep displaying this dialog, and for which releases */
57-
private JComboBox<String> _modeBox;
57+
private final JComboBox<String> _modeBox;
5858
/** the button that closes this window */
59-
private JButton _closeButton;
59+
private final JButton _closeButton;
6060
/** the button that updates to the new version */
61-
private JButton _updateButton;
61+
private final JButton _updateButton;
6262
/** the button that downloads the new version */
63-
private JButton _downloadButton;
63+
private final JButton _downloadButton;
6464
/** the parent frame */
65-
private MainFrame _mainFrame;
65+
private final MainFrame _mainFrame;
6666
/** the version information pane */
67-
private JOptionPane _versionPanel;
67+
private volatile JOptionPane _versionPanel;
6868
/** the panel with the buttons and combobox */
69-
private JPanel _bottomPanel;
69+
private final JPanel _bottomPanel;
7070
/** the build time of this version */
71-
private static Date BUILD_TIME = Version.getBuildTime();
71+
private static final Date BUILD_TIME = Version.getBuildTime();
7272
/** the message for the user */
73-
private String[] _msg = null;
73+
private volatile String[] _msg = null;
7474
/** the version string of the new version found, or "" */
75-
private String _newestVersionString = "";
75+
private volatile String _newestVersionString = "";
7676
/** indeterminate progress bar */
7777

7878
/** Creates a window to display whether a new version of DrJava is available.
@@ -110,13 +110,13 @@ public void actionPerformed(ActionEvent e) {
110110
_downloadButton.setEnabled(false);
111111

112112
_bottomPanel = new JPanel(new BorderLayout());
113-
JPanel buttonPanel = new JPanel();
113+
final JPanel buttonPanel = new JPanel();
114114
buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.Y_AXIS));
115115
buttonPanel.add(_updateButton);
116116
buttonPanel.add(_downloadButton);
117117
buttonPanel.add(_closeButton);
118118
_bottomPanel.add(buttonPanel, BorderLayout.CENTER);
119-
JPanel comboPanel = new JPanel();
119+
final JPanel comboPanel = new JPanel();
120120
comboPanel.add(new JLabel("Check for: "));
121121
comboPanel.add(_modeBox);
122122
_bottomPanel.add(comboPanel, BorderLayout.WEST);
@@ -130,7 +130,7 @@ private void updateText() {
130130
JOptionPane.DEFAULT_OPTION,null,
131131
new Object[0]);
132132

133-
JPanel cp = new JPanel(new BorderLayout(5,5));
133+
final JPanel cp = new JPanel(new BorderLayout(5,5));
134134
cp.setBorder(new EmptyBorder(5,5,5,5));
135135
setContentPane(cp);
136136
cp.add(_versionPanel, BorderLayout.CENTER);
@@ -146,7 +146,7 @@ private void updateText() {
146146
_versionPanel = new JOptionPane(msg,JOptionPane.INFORMATION_MESSAGE,
147147
JOptionPane.DEFAULT_OPTION,null,
148148
new Object[0]);
149-
JPanel cp = new JPanel(new BorderLayout(5,5));
149+
final JPanel cp = new JPanel(new BorderLayout(5,5));
150150
cp.setBorder(new EmptyBorder(5,5,5,5));
151151
setContentPane(cp);
152152
cp.add(_versionPanel, BorderLayout.CENTER);
@@ -235,13 +235,13 @@ protected void abortUpdate(String message, boolean close) {
235235
}
236236

237237
protected void updateAction() {
238-
JPanel cp = new JPanel(new BorderLayout(5,5));
238+
final JPanel cp = new JPanel(new BorderLayout(5,5));
239239
cp.setBorder(new EmptyBorder(5,5,5,5));
240240
setContentPane(cp);
241241
cp.add(new JOptionPane("Waiting for www.sourceforge.net ...",JOptionPane.INFORMATION_MESSAGE,
242242
JOptionPane.DEFAULT_OPTION,null,
243243
new Object[0]), BorderLayout.CENTER);
244-
JProgressBar pb = new JProgressBar(0,100);
244+
final JProgressBar pb = new JProgressBar(0,100);
245245
pb.setIndeterminate(true);
246246
cp.add(pb, BorderLayout.SOUTH);
247247
validate();

0 commit comments

Comments
 (0)