Skip to content

Commit

Permalink
linting; test shutdown improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
pabender committed Oct 12, 2019
1 parent 81404f8 commit a61bc11
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 13 deletions.
13 changes: 4 additions & 9 deletions java/src/jmri/jmrit/beantable/BlockTableAction.java
Expand Up @@ -3,12 +3,9 @@
import apps.gui.GuiLafPreferencesManager;
import java.awt.Color;
import java.awt.Component;
import java.awt.GridLayout;
import java.awt.Image;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.image.BufferedImage;
Expand Down Expand Up @@ -196,7 +193,7 @@ public Object getValueAt(int row, int col) {
if (col == DIRECTIONCOL) {
return jmri.Path.decodeDirection(b.getDirection());
} else if (col == CURVECOL) {
JComboBox<String> c = new JComboBox<String>(curveOptions);
JComboBox<String> c = new JComboBox<>(curveOptions);
if (b.getCurvature() == Block.NONE) {
c.setSelectedItem(0);
} else if (b.getCurvature() == Block.GRADUAL) {
Expand All @@ -223,7 +220,7 @@ public Object getValueAt(int row, int col) {
if (!speedList.contains(speed)) {
speedList.add(speed);
}
JComboBox<String> c = new JComboBox<String>(speedList);
JComboBox<String> c = new JComboBox<>(speedList);
c.setEditable(true);
c.setSelectedItem(speed);
return c;
Expand All @@ -240,7 +237,7 @@ public Object getValueAt(int row, int col) {
}
} else if (col == SENSORCOL) {
Sensor sensor = b.getSensor();
JComboBox<String> c = new JComboBox<String>(sensorList);
JComboBox<String> c = new JComboBox<>(sensorList);
String name = "";
if (sensor != null) {
name = sensor.getDisplayName();
Expand All @@ -249,7 +246,7 @@ public Object getValueAt(int row, int col) {
return c;
} else if (col == REPORTERCOL) {
Reporter reporter = b.getReporter();
JComboBox<String> rs = new JComboBox<String>(reporterList);
JComboBox<String> rs = new JComboBox<>(reporterList);
String name = "";
if (reporter != null) {
name = reporter.getDisplayName();
Expand Down Expand Up @@ -322,13 +319,11 @@ public void setValueAt(Object value, int row, int col) {
Reporter r = jmri.InstanceManager.getDefault(jmri.ReporterManager.class).getReporter(strReporter);
b.setReporter(r);
fireTableRowsUpdated(row, row);
return;
} else if (col == SENSORCOL) {
@SuppressWarnings("unchecked")
String strSensor = (String) ((JComboBox<String>) value).getSelectedItem();
b.setSensor(strSensor);
fireTableRowsUpdated(row, row);
return;
} else if (col == CURRENTREPCOL) {
boolean boo = ((Boolean) value);
b.setReportingCurrent(boo);
Expand Down
3 changes: 0 additions & 3 deletions java/src/jmri/jmrit/consisttool/ConsistToolPrefsPanel.java
@@ -1,11 +1,8 @@
package jmri.jmrit.consisttool;

import apps.PerformActionModel;
import apps.StartupActionsManager;
import jmri.InstanceManager;
import jmri.swing.PreferencesPanel;
import java.awt.event.ActionEvent;
import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.JPanel;
import javax.swing.JComponent;
Expand Down
2 changes: 1 addition & 1 deletion java/src/jmri/jmrit/timetable/swing/TimeTableStartup.java
Expand Up @@ -15,7 +15,7 @@
public class TimeTableStartup extends AbstractStartupActionFactory {

@Override
public String getTitle(Class<?> clazz, Locale locale) throws IllegalArgumentException {
public String getTitle(Class<?> clazz, Locale locale) {
if (!clazz.equals(TimeTableAction.class)) {
throw new IllegalArgumentException();
}
Expand Down
1 change: 1 addition & 0 deletions java/test/jmri/jmrix/loconet/hexfile/HexFileFrameTest.java
Expand Up @@ -37,6 +37,7 @@ public void testCTor() throws InterruptedException {
p.dispose();
f.sourceThread.stop();
f.sourceThread.join();
f.dispose();
}

// The minimal setup for log4J
Expand Down

0 comments on commit a61bc11

Please sign in to comment.