fixed 4 bugs found by FindBugs plugin in Eclipse
This commit is contained in:
parent
02927d0f2d
commit
69130292f2
@ -117,7 +117,7 @@ public abstract class ComponentPresetDatabase extends Database<ComponentPreset>
|
|||||||
@Override
|
@Override
|
||||||
public List<ComponentPreset> listForTypes( List<ComponentPreset.Type> types ) {
|
public List<ComponentPreset> listForTypes( List<ComponentPreset.Type> types ) {
|
||||||
blockUntilLoaded();
|
blockUntilLoaded();
|
||||||
return listForTypes( (ComponentPreset.Type[]) types.toArray() );
|
return listForTypes( types.toArray(new ComponentPreset.Type[types.size()]) );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -49,7 +49,7 @@ public class RocketSaver extends RocketComponentSaver {
|
|||||||
if (id.equals(defId))
|
if (id.equals(defId))
|
||||||
str += " default=\"true\"";
|
str += " default=\"true\"";
|
||||||
|
|
||||||
if (rocket.getMotorConfigurationName(id) == "") {
|
if (rocket.getMotorConfigurationName(id).isEmpty()) {
|
||||||
str += "/>";
|
str += "/>";
|
||||||
} else {
|
} else {
|
||||||
str += "><name>" + net.sf.openrocket.file.RocketSaver.escapeXML(rocket.getMotorConfigurationName(id))
|
str += "><name>" + net.sf.openrocket.file.RocketSaver.escapeXML(rocket.getMotorConfigurationName(id))
|
||||||
|
@ -6,6 +6,7 @@ import java.beans.PropertyChangeListener;
|
|||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.EventObject;
|
import java.util.EventObject;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -299,7 +300,7 @@ public class BooleanModel extends AbstractAction implements StateChangeListener,
|
|||||||
|
|
||||||
PropertyChangeListener[] listeners = this.getPropertyChangeListeners();
|
PropertyChangeListener[] listeners = this.getPropertyChangeListeners();
|
||||||
if (listeners.length > 0) {
|
if (listeners.length > 0) {
|
||||||
log.warn("Invalidating " + this + " while still having listeners " + listeners);
|
log.warn("Invalidating " + this + " while still having listeners " + Arrays.toString(listeners));
|
||||||
for (PropertyChangeListener l : listeners) {
|
for (PropertyChangeListener l : listeners) {
|
||||||
this.removePropertyChangeListener(l);
|
this.removePropertyChangeListener(l);
|
||||||
}
|
}
|
||||||
|
@ -670,7 +670,7 @@ public class RocketPanel extends JPanel implements TreeSelectionListener, Change
|
|||||||
|
|
||||||
// Check whether data is already up to date
|
// Check whether data is already up to date
|
||||||
if (flightDataFunctionalID == configuration.getRocket().getFunctionalModID() &&
|
if (flightDataFunctionalID == configuration.getRocket().getFunctionalModID() &&
|
||||||
flightDataMotorID == configuration.getMotorConfigurationID()) {
|
flightDataMotorID.equals(configuration.getMotorConfigurationID())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user