fixed some findbugs issues

This commit is contained in:
hneemann 2017-07-24 09:13:13 +02:00
parent 08fc96c29f
commit 1e527c5033
2 changed files with 1 additions and 17 deletions

View File

@ -34,7 +34,7 @@ public final class Keys {
/** /**
* number of inputs in simple gates like And and Or * number of inputs in simple gates like And and Or
*/ */
public static final Key.KeyInteger INPUT_COUNT // // needs to have the same default value as ADDR_BITS!!! see de.neemann.digital.gui.components.EditorFactory#DataFieldEditor public static final Key.KeyInteger INPUT_COUNT // needs to have the same default value as ADDR_BITS!!! see de.neemann.digital.gui.components.EditorFactory#DataFieldEditor
= new Key.KeyInteger("Inputs", 2) = new Key.KeyInteger("Inputs", 2)
.setComboBoxValues(new Integer[]{2, 3, 4, 5}) .setComboBoxValues(new Integer[]{2, 3, 4, 5})
.setMin(2); .setMin(2);

View File

@ -8,14 +8,11 @@ import de.neemann.digital.core.element.Keys;
import de.neemann.digital.core.wiring.bus.BusModelStateObserver; import de.neemann.digital.core.wiring.bus.BusModelStateObserver;
import de.neemann.digital.core.wiring.bus.CommonBusValue; import de.neemann.digital.core.wiring.bus.CommonBusValue;
import de.neemann.digital.lang.Lang; import de.neemann.digital.lang.Lang;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/** /**
* A simple switch * A simple switch
*/ */
public class Switch implements Element, NodeInterface { public class Switch implements Element, NodeInterface {
private static final Logger LOGGER = LoggerFactory.getLogger(Switch.class);
/** /**
* Defines a direction for the switch. NO means no direction is given, the switch is bidirectional. * Defines a direction for the switch. NO means no direction is given, the switch is bidirectional.
@ -38,10 +35,6 @@ public class Switch implements Element, NodeInterface {
private SwitchModel switchModel; private SwitchModel switchModel;
private Unidirectional unidirectional = Unidirectional.NO; private Unidirectional unidirectional = Unidirectional.NO;
private static int debugSwitchReal;
private static int debugSwitchSimple;
/** /**
* Creates a new instance * Creates a new instance
* *
@ -128,9 +121,6 @@ public class Switch implements Element, NodeInterface {
switchModel = new SimpleSwitch(input2, output1); switchModel = new SimpleSwitch(input2, output1);
break; break;
} }
if (switchModel instanceof RealSwitch) debugSwitchReal++;
else debugSwitchSimple++;
} }
@Override @Override
@ -147,12 +137,6 @@ public class Switch implements Element, NodeInterface {
switchModel.setModel(model); switchModel.setModel(model);
switchModel.setClosed(closed); switchModel.setClosed(closed);
hasChanged(); hasChanged();
if (debugSwitchSimple != 0 || debugSwitchReal != 0) {
LOGGER.debug(debugSwitchSimple + " simple and " + debugSwitchReal + " real switches created");
debugSwitchSimple = 0;
debugSwitchReal = 0;
}
} }
@Override @Override