diff --git a/Java/Debugger/src/edu/umich/soar/debugger/MainFrame.java b/Java/Debugger/src/edu/umich/soar/debugger/MainFrame.java index c2b05a467a..23dc0b3365 100644 --- a/Java/Debugger/src/edu/umich/soar/debugger/MainFrame.java +++ b/Java/Debugger/src/edu/umich/soar/debugger/MainFrame.java @@ -98,13 +98,13 @@ public class MainFrame private static final String kWindowLayoutFile = "SoarDebuggerWindows.dlf"; - private Composite m_Parent; + private final Composite m_Parent; /* The main window that contains everything else */ - private MainWindow m_MainWindow; + private final MainWindow m_MainWindow; /** The menu bar */ - private Menu m_MenuBar; + private final Menu m_MenuBar; /** The menus in the menu bar */ private FileMenu m_FileMenu = null; @@ -124,25 +124,25 @@ public class MainFrame * The main document object -- represents the Soar process. There is only * one of these ever in the debugger. */ - private Document m_Document; + private final Document m_Document; /** Used to script the debugger itself */ - private ScriptCommands m_ScriptCommands; + private final ScriptCommands m_ScriptCommands; /** * Extended commands set that the user could type at the command line (might * fold this into scripts or vice versa one day--not sure) */ - private DebuggerCommands m_DebuggerCommands; + private final DebuggerCommands m_DebuggerCommands; /** Map of module names that are currently in use in this frame */ - private NameRegister m_NameMap = new NameRegister(); + private final NameRegister m_NameMap = new NameRegister(); /** * Each frame has a unique name within the debugger (for the life of one * running of the app) */ - private String m_Name; + private final String m_Name; /** * We associate a default agent with a MainFrame, so that windows within @@ -177,13 +177,11 @@ public Composite getWindow() * Windows can register with the frame to learn when it switches focus to a * different agent */ - private AgentFocusGenerator m_AgentFocusGenerator = new AgentFocusGenerator(); + private final AgentFocusGenerator m_AgentFocusGenerator = new AgentFocusGenerator(); /** The agent this window is currently focused on -- can be null */ private Agent m_AgentFocus; - private SoarChangeListener m_SoarChangeListener; - private boolean m_bClosing = false; // private java.awt.print.PageFormat m_PageFormat = new @@ -193,10 +191,10 @@ public Composite getWindow() * We'll keep a list of colors here that we wish to use elsewhere. When the * frame is disposed we should dispose them */ - public Color m_White; + public final Color m_White; // List of all color objects we own and should dispose of when frame closes - private ArrayList m_Colors = new ArrayList<>(); + private final ArrayList m_Colors = new ArrayList<>(); public MainFrame(Composite parent, Document doc) { @@ -223,11 +221,23 @@ public MainFrame(Composite parent, Document doc) // Listen for changes to the state of Soar and update our menus // accordingly - m_SoarChangeListener = new SoarChangeListener() - { + // If the connection has changed reset the focus to null + // If we're removing the current focus agent then + // set the focus to null for this window. + // If this agent is being closed down then decide if we + // should + // destroy the window or not. + // We need to switch out of this thread because we're in + // a handler for + // the before_agent_destroyed() event and calling + // close() should shutdown the + // kernel if this is the last window. So we thread + // switch. + // If we don't destroy the window we need to set the current + // agent to being nothing + SoarChangeListener m_SoarChangeListener = new SoarChangeListener() { @Override - public void soarConnectionChanged(SoarConnectionEvent e) - { + public void soarConnectionChanged(SoarConnectionEvent e) { // If the connection has changed reset the focus to null clearAgentFocus(false); @@ -235,21 +245,18 @@ public void soarConnectionChanged(SoarConnectionEvent e) } @Override - public void soarAgentListChanged(SoarAgentEvent e) - { + public void soarAgentListChanged(SoarAgentEvent e) { // If we're removing the current focus agent then // set the focus to null for this window. if (e.isAgentRemoved() - && Document.isSameAgent(e.getAgent(), m_AgentFocus)) - { + && Document.isSameAgent(e.getAgent(), m_AgentFocus)) { // If this agent is being closed down then decide if we // should // destroy the window or not. boolean destroyOnClose = m_Document - .isCloseWindowWhenDestroyAgent(); + .isCloseWindowWhenDestroyAgent(); - if (destroyOnClose) - { + if (destroyOnClose) { // We need to switch out of this thread because we're in // a handler for // the before_agent_destroyed() event and calling diff --git a/Java/Debugger/src/edu/umich/soar/debugger/SWTApplication.java b/Java/Debugger/src/edu/umich/soar/debugger/SWTApplication.java index 41e415f58a..52a33fbf20 100644 --- a/Java/Debugger/src/edu/umich/soar/debugger/SWTApplication.java +++ b/Java/Debugger/src/edu/umich/soar/debugger/SWTApplication.java @@ -33,7 +33,6 @@ ************************************************************************/ public class SWTApplication { - private Document m_Document = null; static Display display; @@ -145,7 +144,7 @@ public void startApp(String[] args) throws Exception public void startApp(String[] args, Display display) { // The document manages the Soar process - m_Document = new Document(); + Document m_Document = new Document(); // Check for command line options boolean remote = hasOption(args, "-remote"); diff --git a/Java/Debugger/src/edu/umich/soar/debugger/dialogs/BaseDialog.java b/Java/Debugger/src/edu/umich/soar/debugger/dialogs/BaseDialog.java index 99397c18cf..84db321cdc 100644 --- a/Java/Debugger/src/edu/umich/soar/debugger/dialogs/BaseDialog.java +++ b/Java/Debugger/src/edu/umich/soar/debugger/dialogs/BaseDialog.java @@ -36,13 +36,13 @@ public class BaseDialog { // The dialog box - protected Shell m_Dialog; + protected final Shell m_Dialog; - protected Button m_OK; + protected final Button m_OK; - protected Button m_Cancel; + protected final Button m_Cancel; - protected Composite m_OpenArea; + protected final Composite m_OpenArea; protected boolean m_Cancelled; diff --git a/Java/Debugger/src/edu/umich/soar/debugger/dialogs/LoggingDialog.java b/Java/Debugger/src/edu/umich/soar/debugger/dialogs/LoggingDialog.java index 582fc660a3..3ab731be39 100644 --- a/Java/Debugger/src/edu/umich/soar/debugger/dialogs/LoggingDialog.java +++ b/Java/Debugger/src/edu/umich/soar/debugger/dialogs/LoggingDialog.java @@ -28,14 +28,12 @@ public class LoggingDialog extends BaseDialog { - private AbstractView m_View; + private final AbstractView m_View; - private MainFrame m_Frame; + private final MainFrame m_Frame; private Text m_FilenameText; - private Button m_Browse; - private Button m_Append; private Button m_FlushAfterWrite; @@ -89,7 +87,7 @@ protected void createContents(final Composite window, Logger logger) m_FilenameText.selectAll(); // Browse for a filename - m_Browse = new Button(text, SWT.PUSH); + Button m_Browse = new Button(text, SWT.PUSH); m_Browse.setText("&Browse..."); data = new GridData(GridData.FILL_HORIZONTAL); data.horizontalSpan = 1; diff --git a/Java/Debugger/src/edu/umich/soar/debugger/dialogs/NewWindowDialog.java b/Java/Debugger/src/edu/umich/soar/debugger/dialogs/NewWindowDialog.java index f9d10ce98a..73c61d7b9d 100644 --- a/Java/Debugger/src/edu/umich/soar/debugger/dialogs/NewWindowDialog.java +++ b/Java/Debugger/src/edu/umich/soar/debugger/dialogs/NewWindowDialog.java @@ -36,13 +36,13 @@ public class NewWindowDialog extends BaseDialog { private int m_Result; // Index in module list - private List m_Modules; + private final List m_Modules; - private Text m_Description; + private final Text m_Description; - private ModuleList m_ModuleList; + private final ModuleList m_ModuleList; - private MainFrame m_Frame; + private final MainFrame m_Frame; /******************************************************************************************** * diff --git a/Java/Debugger/src/edu/umich/soar/debugger/dialogs/PropertiesDialog.java b/Java/Debugger/src/edu/umich/soar/debugger/dialogs/PropertiesDialog.java index fadbeab5a3..8db1735fb7 100644 --- a/Java/Debugger/src/edu/umich/soar/debugger/dialogs/PropertiesDialog.java +++ b/Java/Debugger/src/edu/umich/soar/debugger/dialogs/PropertiesDialog.java @@ -40,7 +40,7 @@ public class PropertiesDialog extends BaseDialog { public abstract static class Property { - protected String m_PropertyName; + protected final String m_PropertyName; public Property(String propertyName) { @@ -67,9 +67,9 @@ public static class IntProperty extends Property { protected int m_Value; - protected int m_MinValue; + protected final int m_MinValue; - protected int m_MaxValue; + protected final int m_MaxValue; protected Text m_Text; @@ -396,9 +396,9 @@ public boolean update() } } - protected Property[] m_BaseProperties; + protected final Property[] m_BaseProperties; - protected Composite m_Container; + protected final Composite m_Container; public PropertiesDialog(MainFrame frame, String title, boolean modal, Property[] baseProperties) diff --git a/Java/Debugger/src/edu/umich/soar/debugger/dialogs/RemoteDialog.java b/Java/Debugger/src/edu/umich/soar/debugger/dialogs/RemoteDialog.java index 03ef33cf37..bcb1e82302 100644 --- a/Java/Debugger/src/edu/umich/soar/debugger/dialogs/RemoteDialog.java +++ b/Java/Debugger/src/edu/umich/soar/debugger/dialogs/RemoteDialog.java @@ -50,13 +50,13 @@ public int getPort() } } - private Text m_IP; + private final Text m_IP; - private Text m_Port; + private final Text m_Port; private RemoteInfo m_Result; - private MainFrame m_Frame; + private final MainFrame m_Frame; /******************************************************************************************** * diff --git a/Java/Debugger/src/edu/umich/soar/debugger/dialogs/ReorderButtonsDialog.java b/Java/Debugger/src/edu/umich/soar/debugger/dialogs/ReorderButtonsDialog.java index 15f0b36e79..fd4072f1ac 100644 --- a/Java/Debugger/src/edu/umich/soar/debugger/dialogs/ReorderButtonsDialog.java +++ b/Java/Debugger/src/edu/umich/soar/debugger/dialogs/ReorderButtonsDialog.java @@ -40,11 +40,11 @@ public class ReorderButtonsDialog extends BaseDialog { private ArrayList m_Result; - private List m_ButtonListControl; + private final List m_ButtonListControl; - private ButtonView.ButtonInfo[] m_Buttons; + private final ButtonView.ButtonInfo[] m_Buttons; - private String[] m_ButtonNames; + private final String[] m_ButtonNames; private boolean m_ModifiedList = false; diff --git a/Java/Debugger/src/edu/umich/soar/debugger/dialogs/SearchDialog.java b/Java/Debugger/src/edu/umich/soar/debugger/dialogs/SearchDialog.java index 0daedb86bb..d864b796f5 100644 --- a/Java/Debugger/src/edu/umich/soar/debugger/dialogs/SearchDialog.java +++ b/Java/Debugger/src/edu/umich/soar/debugger/dialogs/SearchDialog.java @@ -32,19 +32,15 @@ ************************************************************************/ public class SearchDialog extends BaseDialog { - // The find and replace buttons - private Button m_DoFind; - private AbstractView m_View; + private final AbstractView m_View; - private MainFrame m_Frame; + private final MainFrame m_Frame; private Text m_FindText; private Button m_Down; - private Button m_Up; - private Button m_Match; private Button m_SearchHidden; @@ -161,7 +157,7 @@ protected void createContents(final Composite window) m_Down = new Button(options, SWT.RADIO); m_Down.setText("D&own"); - m_Up = new Button(options, SWT.RADIO); + Button m_Up = new Button(options, SWT.RADIO); m_Up.setText("&Up"); // Add the keep window checkbox @@ -185,7 +181,8 @@ protected void createContents(final Composite window) buttons.setLayout(new GridLayout()); // Create the Find button - m_DoFind = new Button(buttons, SWT.PUSH); + // The find and replace buttons + Button m_DoFind = new Button(buttons, SWT.PUSH); m_DoFind.setText("&Find Ctrl-F"); m_DoFind.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); diff --git a/Java/Debugger/src/edu/umich/soar/debugger/dialogs/SelectAgentDialog.java b/Java/Debugger/src/edu/umich/soar/debugger/dialogs/SelectAgentDialog.java index 3758b9dc23..baed74cb5f 100644 --- a/Java/Debugger/src/edu/umich/soar/debugger/dialogs/SelectAgentDialog.java +++ b/Java/Debugger/src/edu/umich/soar/debugger/dialogs/SelectAgentDialog.java @@ -30,7 +30,7 @@ public class SelectAgentDialog extends BaseDialog { private String m_Result; - private List m_Agents; + private final List m_Agents; /******************************************************************************************** * diff --git a/Java/Debugger/src/edu/umich/soar/debugger/dialogs/SwtInputDialog.java b/Java/Debugger/src/edu/umich/soar/debugger/dialogs/SwtInputDialog.java index 57d5e4ffc0..9d42c98737 100644 --- a/Java/Debugger/src/edu/umich/soar/debugger/dialogs/SwtInputDialog.java +++ b/Java/Debugger/src/edu/umich/soar/debugger/dialogs/SwtInputDialog.java @@ -33,9 +33,7 @@ public class SwtInputDialog extends BaseDialog { private String m_Result; - private Text m_EntryField; - - private boolean m_MultiLine; + private final Text m_EntryField; /******************************************************************************************** * @@ -114,7 +112,6 @@ private SwtInputDialog(Composite parent, String title, String prompt, super(parent, title, true); int margin = 10; - m_MultiLine = multiLine; getOpenArea().setLayout(new FormLayout()); @@ -124,7 +121,7 @@ private SwtInputDialog(Composite parent, String title, String prompt, promptLabel.setLayoutData(FormDataHelper.anchorTopLeft(margin)); // The field where the user types their response - Text entryField = new Text(getOpenArea(), m_MultiLine ? SWT.MULTI + Text entryField = new Text(getOpenArea(), multiLine ? SWT.MULTI : SWT.NULL); entryField.setText(initialValue); entryField.setFocus(); diff --git a/Java/Debugger/src/edu/umich/soar/debugger/doc/DebuggerCommands.java b/Java/Debugger/src/edu/umich/soar/debugger/doc/DebuggerCommands.java index c96507d37f..b74e635847 100644 --- a/Java/Debugger/src/edu/umich/soar/debugger/doc/DebuggerCommands.java +++ b/Java/Debugger/src/edu/umich/soar/debugger/doc/DebuggerCommands.java @@ -24,9 +24,9 @@ ************************************************************************/ public class DebuggerCommands { - protected MainFrame m_Frame; + protected final MainFrame m_Frame; - protected Document m_Document; + protected final Document m_Document; public final static String kClear = "clear"; @@ -36,7 +36,7 @@ public class DebuggerCommands public final static String kEditProduction = "edit-production"; - protected String[] kCommands = new String[] { kClear, kQuit, kExit, + protected final String[] kCommands = new String[] { kClear, kQuit, kExit, kEditProduction }; public DebuggerCommands(MainFrame frame, Document doc) diff --git a/Java/Debugger/src/edu/umich/soar/debugger/doc/Document.java b/Java/Debugger/src/edu/umich/soar/debugger/doc/Document.java index 103e4e2ead..9f206d7560 100644 --- a/Java/Debugger/src/edu/umich/soar/debugger/doc/Document.java +++ b/Java/Debugger/src/edu/umich/soar/debugger/doc/Document.java @@ -70,7 +70,7 @@ public class Document implements Kernel.AgentEventInterface, * This object is used to get strings for Soar commands in a version * independent way */ - private SoarCommands m_SoarCommands = new SoarCommands(); + private final SoarCommands m_SoarCommands = new SoarCommands(); /** * The properties for this application (holds user preferences). Version @@ -83,9 +83,9 @@ public class Document implements Kernel.AgentEventInterface, * The list of all modules (types of debugger windows) that exist. This is a * list of types, not a list of window instances. */ - private ModuleList m_ModuleList = new ModuleList(); + private final ModuleList m_ModuleList = new ModuleList(); - private SoarChangeGenerator m_SoarChangeGenerator = new SoarChangeGenerator(); + private final SoarChangeGenerator m_SoarChangeGenerator = new SoarChangeGenerator(); /** * Stores the pointer to the Soar kernel we are currently interacting with @@ -106,7 +106,7 @@ public class Document implements Kernel.AgentEventInterface, * The list of all main frames in the application -- each frame has a menu * bar */ - private FrameList m_FrameList = new FrameList(); + private final FrameList m_FrameList = new FrameList(); /** We have to pump messages on this display to keep the app alive */ private Display m_Display = null; @@ -148,7 +148,7 @@ public class Document implements Kernel.AgentEventInterface, */ public static final boolean kDocInOwnThread = true; - private DocumentThread2 m_DocumentThread; + private final DocumentThread2 m_DocumentThread; public static final boolean kShutdownInSeparateThread = true; @@ -1089,7 +1089,7 @@ public void pumpMessagesTillClosed(org.eclipse.swt.widgets.Display display) } catch (Throwable t) { - System.out.println(t); + System.err.println(t); t.printStackTrace(); } } @@ -1229,7 +1229,7 @@ protected Object sendAgentCommandGeneral(DocumentThread2.Command command) return m_DocumentThread.getExecutedCommandResult(command); } - HashMap m_RHSFunctions = new HashMap<>(); + final HashMap m_RHSFunctions = new HashMap<>(); public boolean isRHSFunctionRegistered(String functionName) { diff --git a/Java/Debugger/src/edu/umich/soar/debugger/doc/DocumentThread.java b/Java/Debugger/src/edu/umich/soar/debugger/doc/DocumentThread.java index dfea07e75e..ebdbf9b7f1 100644 --- a/Java/Debugger/src/edu/umich/soar/debugger/doc/DocumentThread.java +++ b/Java/Debugger/src/edu/umich/soar/debugger/doc/DocumentThread.java @@ -32,13 +32,13 @@ public class DocumentThread extends Thread { public static class Command { - private Agent m_Agent; + private final Agent m_Agent; - private String m_Command; + private final String m_Command; private String m_Result; - private ClientAnalyzedXML m_Response; + private final ClientAnalyzedXML m_Response; private boolean m_Executed; @@ -52,13 +52,13 @@ public Command(Agent agent, String command, ClientAnalyzedXML response) } /** The commands waiting to be executed */ - private ArrayList m_ToExecuteQueue = new ArrayList<>(); + private final ArrayList m_ToExecuteQueue = new ArrayList<>(); /** A flag used when we wish to stop this thread (during system shutdown) */ private boolean m_AskedToStop = false; /** The main document (which owns the Soar kernel object etc.) */ - private Document m_Document; + private final Document m_Document; private boolean m_IsExecutingCommand = false; @@ -69,7 +69,7 @@ public Command(Agent agent, String command, ClientAnalyzedXML response) * If true, print trace information as each command is scheduled and * executed */ - private static boolean kTraceCommands = false; + private static final boolean kTraceCommands = false; public DocumentThread(Document doc) { diff --git a/Java/Debugger/src/edu/umich/soar/debugger/doc/DocumentThread2.java b/Java/Debugger/src/edu/umich/soar/debugger/doc/DocumentThread2.java index 1de684267b..057500bdc9 100644 --- a/Java/Debugger/src/edu/umich/soar/debugger/doc/DocumentThread2.java +++ b/Java/Debugger/src/edu/umich/soar/debugger/doc/DocumentThread2.java @@ -45,7 +45,7 @@ public class DocumentThread2 extends Thread */ public abstract static class Command { - protected Agent m_Agent; + protected final Agent m_Agent; protected Object m_Result; @@ -88,7 +88,7 @@ public synchronized Object getResult() public static class CommandExecCommandLine extends Command { - protected String m_Command; + protected final String m_Command; public CommandExecCommandLine(Agent agent, String command) { @@ -113,9 +113,9 @@ public String toString() public static class CommandExecCommandLineXML extends Command { - protected ClientAnalyzedXML m_Response; + protected final ClientAnalyzedXML m_Response; - protected String m_Command; + protected final String m_Command; public CommandExecCommandLineXML(Agent agent, String command, ClientAnalyzedXML response) @@ -142,13 +142,13 @@ public String toString() } /** The commands waiting to be executed */ - private ArrayList m_ToExecuteQueue = new ArrayList<>(); + private final ArrayList m_ToExecuteQueue = new ArrayList<>(); /** A flag used when we wish to stop this thread (during system shutdown) */ private boolean m_AskedToStop = false; /** The main document (which owns the Soar kernel object etc.) */ - private Document m_Document; + private final Document m_Document; private boolean m_IsExecutingCommand = false; @@ -159,7 +159,7 @@ public String toString() * If true, print trace information as each command is scheduled and * executed */ - private static boolean kTraceCommands = false; + private static final boolean kTraceCommands = false; public DocumentThread2(Document doc) { diff --git a/Java/Debugger/src/edu/umich/soar/debugger/doc/Module.java b/Java/Debugger/src/edu/umich/soar/debugger/doc/Module.java index c6ae303a12..ca229a9dc0 100644 --- a/Java/Debugger/src/edu/umich/soar/debugger/doc/Module.java +++ b/Java/Debugger/src/edu/umich/soar/debugger/doc/Module.java @@ -26,13 +26,13 @@ public class Module { /** The name shown to the user for this class */ - private String m_Name; + private final String m_Name; /** A description shown to the user for this class */ - private String m_Description; + private final String m_Description; /** The class itself */ - private Class m_Class; + private final Class m_Class; public Module(String name, String description, Class c) diff --git a/Java/Debugger/src/edu/umich/soar/debugger/doc/ModuleList.java b/Java/Debugger/src/edu/umich/soar/debugger/doc/ModuleList.java index 5069be9818..19bc0869cc 100644 --- a/Java/Debugger/src/edu/umich/soar/debugger/doc/ModuleList.java +++ b/Java/Debugger/src/edu/umich/soar/debugger/doc/ModuleList.java @@ -24,7 +24,7 @@ ********************************************************************************************/ public class ModuleList { - private List m_List = new ArrayList<>(); + private final List m_List = new ArrayList<>(); public int size() { diff --git a/Java/Debugger/src/edu/umich/soar/debugger/doc/NameRegister.java b/Java/Debugger/src/edu/umich/soar/debugger/doc/NameRegister.java index 4a867ea244..65c93d23b4 100644 --- a/Java/Debugger/src/edu/umich/soar/debugger/doc/NameRegister.java +++ b/Java/Debugger/src/edu/umich/soar/debugger/doc/NameRegister.java @@ -23,7 +23,7 @@ ************************************************************************/ public class NameRegister { - private HashMap m_NameMap = new HashMap<>() ; + private final HashMap m_NameMap = new HashMap<>() ; public boolean isNameInUse(String name) { diff --git a/Java/Debugger/src/edu/umich/soar/debugger/doc/ScriptCommands.java b/Java/Debugger/src/edu/umich/soar/debugger/doc/ScriptCommands.java index 2bc520f573..be540b7d7f 100644 --- a/Java/Debugger/src/edu/umich/soar/debugger/doc/ScriptCommands.java +++ b/Java/Debugger/src/edu/umich/soar/debugger/doc/ScriptCommands.java @@ -35,9 +35,9 @@ ************************************************************************/ public class ScriptCommands { - protected MainFrame m_Frame; + protected final MainFrame m_Frame; - protected Document m_Document; + protected final Document m_Document; public ScriptCommands(MainFrame frame, Document doc) { diff --git a/Java/Debugger/src/edu/umich/soar/debugger/doc/events/AgentFocusEvent.java b/Java/Debugger/src/edu/umich/soar/debugger/doc/events/AgentFocusEvent.java index be1bdbf57d..56940a2d5a 100644 --- a/Java/Debugger/src/edu/umich/soar/debugger/doc/events/AgentFocusEvent.java +++ b/Java/Debugger/src/edu/umich/soar/debugger/doc/events/AgentFocusEvent.java @@ -1,12 +1,12 @@ /******************************************************************************************** * * AgentFocusEvent.java - * - * Description: - * + * + * Description: + * * Created on Feb 2, 2005 * @author Douglas Pearson - * + * * Developed by ThreePenny Software www.threepenny.net ********************************************************************************************/ package edu.umich.soar.debugger.doc.events; @@ -14,9 +14,9 @@ import sml.Agent; /************************************************************************ - * + * * Event fired when a frame switches to tracking a different agent. - * + * ************************************************************************/ public class AgentFocusEvent extends java.util.EventObject { @@ -29,9 +29,9 @@ public class AgentFocusEvent extends java.util.EventObject public static final int kGone = 3; // Agent has been deleted (usually // because kernel is gone) - private int m_Event; + private final int m_Event; - private Agent m_Agent; + private final Agent m_Agent; public AgentFocusEvent(Object source, int event, Agent agent) { diff --git a/Java/Debugger/src/edu/umich/soar/debugger/doc/events/AgentFocusGenerator.java b/Java/Debugger/src/edu/umich/soar/debugger/doc/events/AgentFocusGenerator.java index cf5b2bfdc1..944ffded83 100644 --- a/Java/Debugger/src/edu/umich/soar/debugger/doc/events/AgentFocusGenerator.java +++ b/Java/Debugger/src/edu/umich/soar/debugger/doc/events/AgentFocusGenerator.java @@ -20,7 +20,7 @@ ************************************************************************/ public class AgentFocusGenerator { - protected java.util.ArrayList m_Listeners = new java.util.ArrayList<>(); + protected final java.util.ArrayList m_Listeners = new java.util.ArrayList<>(); public synchronized void addAgentFocusListener(AgentFocusListener listener) { diff --git a/Java/Debugger/src/edu/umich/soar/debugger/doc/events/SoarAgentEvent.java b/Java/Debugger/src/edu/umich/soar/debugger/doc/events/SoarAgentEvent.java index 807070af75..deb32e5bfd 100644 --- a/Java/Debugger/src/edu/umich/soar/debugger/doc/events/SoarAgentEvent.java +++ b/Java/Debugger/src/edu/umich/soar/debugger/doc/events/SoarAgentEvent.java @@ -1,12 +1,12 @@ /******************************************************************************************** * * SoarAgentEvent.java - * - * Description: - * + * + * Description: + * * Created on Jan 31, 2005 * @author Douglas Pearson - * + * * Developed by ThreePenny Software www.threepenny.net ********************************************************************************************/ package edu.umich.soar.debugger.doc.events; @@ -14,25 +14,25 @@ import sml.Agent; /************************************************************************ - * + * * Used to report a change to an agent (added, removed etc.) - * + * ************************************************************************/ public class SoarAgentEvent extends java.util.EventObject { private static final long serialVersionUID = -1073490020065002122L; - public static int kAgentAdded = 1; + public static final int kAgentAdded = 1; - public static int kAgentRemoved = 2; + public static final int kAgentRemoved = 2; - public static int kListChanged = 3; // More generic -- just says the list + public static final int kListChanged = 3; // More generic -- just says the list // isn't the same now (use the more // specific event if you can) - private int m_Type; + private final int m_Type; - private Agent m_Agent; + private final Agent m_Agent; public SoarAgentEvent(Object source, int type, Agent agent) { diff --git a/Java/Debugger/src/edu/umich/soar/debugger/doc/events/SoarChangeEvent.java b/Java/Debugger/src/edu/umich/soar/debugger/doc/events/SoarChangeEvent.java index 2e6deab97b..e6eed45678 100644 --- a/Java/Debugger/src/edu/umich/soar/debugger/doc/events/SoarChangeEvent.java +++ b/Java/Debugger/src/edu/umich/soar/debugger/doc/events/SoarChangeEvent.java @@ -1,12 +1,12 @@ /******************************************************************************************** * * SoarChangeEvent.java - * + * * Created on Nov 10, 2003 * * @author Doug * @version - * + * * Developed by ThreePenny Software www.threepenny.net ********************************************************************************************/ package edu.umich.soar.debugger.doc.events; @@ -14,10 +14,10 @@ import java.util.EventObject; /******************************************************************************************** - * + * * Event fired when a change occurs in the soar process (e.g. output is * generated from a command) - * + * ********************************************************************************************/ public class SoarChangeEvent extends EventObject { @@ -27,9 +27,9 @@ public class SoarChangeEvent extends EventObject public final static int kSoarStopped = 2; - private String m_Message; + private final String m_Message; - private int m_Code; + private final int m_Code; public SoarChangeEvent(Object source, int code, String message) { diff --git a/Java/Debugger/src/edu/umich/soar/debugger/doc/events/SoarChangeGenerator.java b/Java/Debugger/src/edu/umich/soar/debugger/doc/events/SoarChangeGenerator.java index d66f8018fe..8a47c6d4e2 100644 --- a/Java/Debugger/src/edu/umich/soar/debugger/doc/events/SoarChangeGenerator.java +++ b/Java/Debugger/src/edu/umich/soar/debugger/doc/events/SoarChangeGenerator.java @@ -22,7 +22,7 @@ ********************************************************************************************/ public class SoarChangeGenerator { - protected java.util.ArrayList m_Listeners = new java.util.ArrayList<>(); + protected final java.util.ArrayList m_Listeners = new java.util.ArrayList<>(); public synchronized void addSoarChangeListener(SoarChangeListener listener) { diff --git a/Java/Debugger/src/edu/umich/soar/debugger/doc/events/SoarConnectionEvent.java b/Java/Debugger/src/edu/umich/soar/debugger/doc/events/SoarConnectionEvent.java index caeb6a872c..5b1b718b92 100644 --- a/Java/Debugger/src/edu/umich/soar/debugger/doc/events/SoarConnectionEvent.java +++ b/Java/Debugger/src/edu/umich/soar/debugger/doc/events/SoarConnectionEvent.java @@ -1,12 +1,12 @@ /******************************************************************************************** * * SoarConnectionEvent.java - * - * Description: - * + * + * Description: + * * Created on Jan 29, 2005 * @author Douglas Pearson - * + * * Developed by ThreePenny Software www.threepenny.net ********************************************************************************************/ package edu.umich.soar.debugger.doc.events; @@ -14,19 +14,19 @@ import java.util.EventObject; /************************************************************************ - * + * * Fired when a kernel is created/destroyed or we connect/disconnect etc. - * + * ************************************************************************/ public class SoarConnectionEvent extends EventObject { private static final long serialVersionUID = -3797441927796559669L; /** True if connecting, false if disconnecting */ - private boolean m_Connect; + private final boolean m_Connect; /** True if remote, false if local */ - private boolean m_Remote; + private final boolean m_Remote; public SoarConnectionEvent(Object source, boolean connect, boolean remote) { diff --git a/Java/Debugger/src/edu/umich/soar/debugger/general/AppProperties.java b/Java/Debugger/src/edu/umich/soar/debugger/general/AppProperties.java index 3f8e4e50a5..e493222d90 100644 --- a/Java/Debugger/src/edu/umich/soar/debugger/general/AppProperties.java +++ b/Java/Debugger/src/edu/umich/soar/debugger/general/AppProperties.java @@ -19,7 +19,7 @@ public class AppProperties extends java.util.Properties protected String m_Filename; - protected String m_Header; + protected final String m_Header; protected final String kVersion = "Version"; diff --git a/Java/Debugger/src/edu/umich/soar/debugger/general/ChooseFontDialog.java b/Java/Debugger/src/edu/umich/soar/debugger/general/ChooseFontDialog.java index d01fd74545..8ed7530139 100644 --- a/Java/Debugger/src/edu/umich/soar/debugger/general/ChooseFontDialog.java +++ b/Java/Debugger/src/edu/umich/soar/debugger/general/ChooseFontDialog.java @@ -54,9 +54,9 @@ public class ChooseFontDialog extends JPanel private boolean m_InitedFixedWidth = false; // The list of fixed width fonts // is initialized later - private JList m_FontList; + private JList m_FontList; - private JList m_StyleList; + private JList m_StyleList; private JTextField m_SizeField; @@ -64,7 +64,7 @@ public class ChooseFontDialog extends JPanel private JCheckBox m_FixedWidthOnly; - private FontStyleDisplay[] m_FontStyles = new FontStyleDisplay[] { + private final FontStyleDisplay[] m_FontStyles = new FontStyleDisplay[] { new FontStyleDisplay("Plain", Font.PLAIN), new FontStyleDisplay("Bold", Font.BOLD), new FontStyleDisplay("Italic", Font.ITALIC), @@ -83,7 +83,7 @@ public class ChooseFontDialog extends JPanel ********************************************************************************************/ private static class FontDisplay { - private Font m_Font; + private final Font m_Font; private boolean m_IsFixedWidth; @@ -117,9 +117,9 @@ public String toString() ********************************************************************************************/ private static class FontStyleDisplay { - private int m_Style; + private final int m_Style; - private String m_Name; + private final String m_Name; public FontStyleDisplay(String name, int style) { @@ -240,8 +240,8 @@ private void Init() m_FixedWidthOnly = new JCheckBox("Fixed width only"); m_FixedWidthOnly.setSelected(false); - m_FontList = new JList(m_AllFontDisplays); - m_StyleList = new JList(m_FontStyles); + m_FontList = new JList<>(m_AllFontDisplays); + m_StyleList = new JList<>(m_FontStyles); m_SizeField = new JTextField(5); m_FontList.addListSelectionListener(e -> selectionChanged()); diff --git a/Java/Debugger/src/edu/umich/soar/debugger/general/JavaElementXML.java b/Java/Debugger/src/edu/umich/soar/debugger/general/JavaElementXML.java index ff0b1e2e34..8cdfb8db37 100644 --- a/Java/Debugger/src/edu/umich/soar/debugger/general/JavaElementXML.java +++ b/Java/Debugger/src/edu/umich/soar/debugger/general/JavaElementXML.java @@ -106,9 +106,9 @@ private static class LexXML *************************************************************************/ private static class Token { - private String m_Value; + private final String m_Value; - private int m_Type; + private final int m_Type; public Token(String value, int type) { @@ -129,7 +129,7 @@ public String getValue() // public void setValue(String s){ this.m_Value = s ; } } - protected BufferedReader m_Input; + protected final BufferedReader m_Input; protected String m_CurrentLine; @@ -564,10 +564,10 @@ public String MustBe(int type) throws Exception .getProperty("line.separator"); /** List of attribute names and string values */ - protected HashMap m_AttributeList = new HashMap<>(); + protected final HashMap m_AttributeList = new HashMap<>(); /** List of elements contained in this element */ - protected ArrayList m_ChildElementList = new ArrayList<>(); + protected final ArrayList m_ChildElementList = new ArrayList<>(); /** The tag for this item */ protected String m_TagName; diff --git a/Java/Debugger/src/edu/umich/soar/debugger/general/OSName.java b/Java/Debugger/src/edu/umich/soar/debugger/general/OSName.java index e3c77c205b..b4be881758 100644 --- a/Java/Debugger/src/edu/umich/soar/debugger/general/OSName.java +++ b/Java/Debugger/src/edu/umich/soar/debugger/general/OSName.java @@ -2,7 +2,7 @@ public class OSName { - // + // // os.name values // Digital Unix // FreeBSD @@ -43,6 +43,6 @@ public static boolean isNotWindowsAndNotMac() return !isWindows() && !isMacOS(); } - public static String kSystemLineSeparator = System + public static final String kSystemLineSeparator = System .getProperty("line.separator"); } diff --git a/Java/Debugger/src/edu/umich/soar/debugger/helpers/CommandHistory.java b/Java/Debugger/src/edu/umich/soar/debugger/helpers/CommandHistory.java index 7ab69adfbc..81dc95f85f 100644 --- a/Java/Debugger/src/edu/umich/soar/debugger/helpers/CommandHistory.java +++ b/Java/Debugger/src/edu/umich/soar/debugger/helpers/CommandHistory.java @@ -23,10 +23,10 @@ public class CommandHistory { /** Max number of items to store in the history */ - public static int kMaxHistorySize = 20; + public static final int kMaxHistorySize = 20; /** The current history */ - private String[] m_History = new String[kMaxHistorySize]; + private final String[] m_History = new String[kMaxHistorySize]; /** The current number of items in the history list */ private int m_HistorySize = 0; diff --git a/Java/Debugger/src/edu/umich/soar/debugger/helpers/FoldingText.java b/Java/Debugger/src/edu/umich/soar/debugger/helpers/FoldingText.java index 7e0af38f94..45a50272d2 100644 --- a/Java/Debugger/src/edu/umich/soar/debugger/helpers/FoldingText.java +++ b/Java/Debugger/src/edu/umich/soar/debugger/helpers/FoldingText.java @@ -38,15 +38,15 @@ ************************************************************************/ public class FoldingText { - protected StyledText m_Text; + protected final StyledText m_Text; - protected Canvas m_IconBar; + protected final Canvas m_IconBar; - protected Composite m_Container; + protected final Composite m_Container; - protected FoldingTextDoc m_FoldingDoc = new FoldingTextDoc(this); + protected final FoldingTextDoc m_FoldingDoc = new FoldingTextDoc(this); - protected FilterDoc m_FilterDoc = new FilterDoc(this); + protected final FilterDoc m_FilterDoc = new FilterDoc(this); protected int m_LastTopIndex; @@ -59,11 +59,11 @@ public class FoldingText public static class FilterRecord { - protected String m_Text; // The text itself + protected final String m_Text; // The text itself - protected boolean m_SubText; // If true this text goes at a sub level + protected final boolean m_SubText; // If true this text goes at a sub level - protected long m_Type; // The type of information stored here, against + protected final long m_Type; // The type of information stored here, against // which we filter. (This is treated as a bit // field). @@ -95,9 +95,9 @@ public long getType() public static class FilterDoc { - protected ArrayList m_AllRecords = new ArrayList<>(); + protected final ArrayList m_AllRecords = new ArrayList<>(); - protected FoldingText m_FoldingText; + protected final FoldingText m_FoldingText; // If type & excludeFilter != 0 we won't display it protected long m_ExcludeFilter = 0; @@ -269,13 +269,13 @@ public void regenerateDisplay() public static class FoldingTextDoc { - protected ArrayList m_TextBlocks = new ArrayList<>(); + protected final ArrayList m_TextBlocks = new ArrayList<>(); protected int m_ShowFilter; protected int m_HideFilter; - protected FoldingText m_FoldingText; + protected final FoldingText m_FoldingText; protected Block m_LastBlock; @@ -567,12 +567,12 @@ public static class Block protected int m_Start; // The first line where this block appears in the // text widget - protected int m_RecordIndex; // Index of first line in master list of + protected final int m_RecordIndex; // Index of first line in master list of // all records stored (used to connect the // view to the full list). -1 => filtering // not enabled - protected ArrayList m_Lines = new ArrayList<>(); + protected final ArrayList m_Lines = new ArrayList<>(); protected StringBuffer m_All = new StringBuffer(); diff --git a/Java/Debugger/src/edu/umich/soar/debugger/helpers/Logger.java b/Java/Debugger/src/edu/umich/soar/debugger/helpers/Logger.java index 153e334c20..473461a75e 100644 --- a/Java/Debugger/src/edu/umich/soar/debugger/helpers/Logger.java +++ b/Java/Debugger/src/edu/umich/soar/debugger/helpers/Logger.java @@ -1,12 +1,12 @@ /******************************************************************************************** * * Logger.java - * + * * Description: Provides support for logging output from a window to a file. - * + * * Created on Feb 9, 2006 * @author Douglas Pearson - * + * * Developed by ThreePenny Software www.threepenny.net ********************************************************************************************/ package edu.umich.soar.debugger.helpers; @@ -121,9 +121,9 @@ public String startLogging(boolean append) } /******************************************************************************************** - * + * * Add this string to the log file (if we're currently logging). - * + * * @param text * The string to log * @param replaceSoarNewLines @@ -154,7 +154,7 @@ public void log(String text, boolean replaceSoarNewLines, } catch (Exception ex) { - System.out.println(ex); + System.err.println(ex); } } @@ -167,7 +167,7 @@ public void stopLogging() } catch (Exception ex) { - System.out.println(ex); + System.err.println(ex); } m_OutputFile = null; m_IsLogging = false; diff --git a/Java/Debugger/src/edu/umich/soar/debugger/helpers/SwtSplitPane.java b/Java/Debugger/src/edu/umich/soar/debugger/helpers/SwtSplitPane.java index 1eaf3950fc..e81e90f1f5 100644 --- a/Java/Debugger/src/edu/umich/soar/debugger/helpers/SwtSplitPane.java +++ b/Java/Debugger/src/edu/umich/soar/debugger/helpers/SwtSplitPane.java @@ -35,17 +35,13 @@ public class SwtSplitPane { private int m_Orientation = SWT.HORIZONTAL; - private Group m_Pane; - - private FormLayout m_Layout; - - private Listener m_SashListener; + private final Group m_Pane; private Control m_Left; private Control m_Right; - private Sash m_Sash; + private final Sash m_Sash; private double m_Position; // 0.0 is left/top ; 1.0 is bottom/right @@ -57,7 +53,7 @@ public class SwtSplitPane public SwtSplitPane(Composite parent, int style) { m_Pane = new Group(parent, 0); - m_Layout = new FormLayout(); + FormLayout m_Layout = new FormLayout(); m_Pane.setLayout(m_Layout); if ((style & SWT.VERTICAL) != 0) @@ -67,7 +63,7 @@ public SwtSplitPane(Composite parent, int style) m_Pane.addListener(SWT.Resize, e -> layoutControls()); - m_SashListener = this::onDragSash; + Listener m_SashListener = this::onDragSash; // The sash uses the inverse orientation m_Sash = new Sash(m_Pane, diff --git a/Java/Debugger/src/edu/umich/soar/debugger/helpers/XmlOutput.java b/Java/Debugger/src/edu/umich/soar/debugger/helpers/XmlOutput.java index 390e5847d8..f8b26bc311 100644 --- a/Java/Debugger/src/edu/umich/soar/debugger/helpers/XmlOutput.java +++ b/Java/Debugger/src/edu/umich/soar/debugger/helpers/XmlOutput.java @@ -32,9 +32,9 @@ public class XmlOutput // --stack in trace window /** Cache some indent strings that we'll need */ - public static String kProdIndent; + public static final String kProdIndent; - public static String kLineProdIndent; + public static final String kLineProdIndent; /** * We cache a series of strings made up of just spaces up to a certain size, diff --git a/Java/Debugger/src/edu/umich/soar/debugger/manager/MainWindow.java b/Java/Debugger/src/edu/umich/soar/debugger/manager/MainWindow.java index e0b11fb5ac..1e7b66d5a8 100644 --- a/Java/Debugger/src/edu/umich/soar/debugger/manager/MainWindow.java +++ b/Java/Debugger/src/edu/umich/soar/debugger/manager/MainWindow.java @@ -56,9 +56,9 @@ public class MainWindow // we're using. private Composite m_Window; - private MainFrame m_Frame; + private final MainFrame m_Frame; - private Document m_Document; + private final Document m_Document; public final static String kAttachKey = "Attach"; @@ -92,7 +92,7 @@ public class MainWindow // with a sash control // The order of this list determines tab order - private ArrayList m_PaneList = new ArrayList<>(); + private final ArrayList m_PaneList = new ArrayList<>(); public MainWindow(MainFrame frame, Document doc, Composite parent) { diff --git a/Java/Debugger/src/edu/umich/soar/debugger/manager/Pane.java b/Java/Debugger/src/edu/umich/soar/debugger/manager/Pane.java index 04694a2505..2383429fc3 100644 --- a/Java/Debugger/src/edu/umich/soar/debugger/manager/Pane.java +++ b/Java/Debugger/src/edu/umich/soar/debugger/manager/Pane.java @@ -43,7 +43,7 @@ public class Pane // List of views attached to this pane // Each view represents a distinct module and only one is visible at a time // (> 1 => we use some form of tab) - private List m_Views = new ArrayList<>(); + private final List m_Views = new ArrayList<>(); private Composite m_Pane; diff --git a/Java/Debugger/src/edu/umich/soar/debugger/menu/AbstractAction.java b/Java/Debugger/src/edu/umich/soar/debugger/menu/AbstractAction.java index f7a0efc427..cefdb4e29a 100644 --- a/Java/Debugger/src/edu/umich/soar/debugger/menu/AbstractAction.java +++ b/Java/Debugger/src/edu/umich/soar/debugger/menu/AbstractAction.java @@ -1,12 +1,12 @@ /******************************************************************************************** * * AbstractAction.java - * - * Description: - * + * + * Description: + * * Created on Feb 15, 2005 * @author Douglas Pearson - * + * * Developed by ThreePenny Software www.threepenny.net ********************************************************************************************/ package edu.umich.soar.debugger.menu; @@ -14,16 +14,16 @@ import org.eclipse.swt.widgets.MenuItem; /************************************************************************ - * + * * My implementation of AbstractAction to bridge the gap from Swing to SWT. - * + * * I don't believe SWT has an Action concept, but the idea seems sound so I'll * implement the class here so I can keep the logic. - * + * ************************************************************************/ public abstract class AbstractAction { - private String m_Label; + private final String m_Label; private boolean m_Enabled; diff --git a/Java/Debugger/src/edu/umich/soar/debugger/menu/AgentMenu.java b/Java/Debugger/src/edu/umich/soar/debugger/menu/AgentMenu.java index 3ee40cda64..dc8a33e232 100644 --- a/Java/Debugger/src/edu/umich/soar/debugger/menu/AgentMenu.java +++ b/Java/Debugger/src/edu/umich/soar/debugger/menu/AgentMenu.java @@ -31,7 +31,7 @@ public class AgentMenu private MainFrame m_Frame = null; - private AbstractAction m_SelectAgent = new AbstractAction( + private final AbstractAction m_SelectAgent = new AbstractAction( "Select Current Agent") { @Override @@ -41,7 +41,7 @@ public void actionPerformed(ActionEvent e) } }; - private AbstractAction m_CreateAgentSame = new AbstractAction( + private final AbstractAction m_CreateAgentSame = new AbstractAction( "Create Agent - Same Window") { @Override @@ -51,7 +51,7 @@ public void actionPerformed(ActionEvent e) } }; - private AbstractAction m_CreateAgentNew = new AbstractAction( + private final AbstractAction m_CreateAgentNew = new AbstractAction( "Create Agent - New Window") { @Override @@ -61,7 +61,7 @@ public void actionPerformed(ActionEvent e) } }; - private AbstractAction m_CreateNewWindow = new AbstractAction( + private final AbstractAction m_CreateNewWindow = new AbstractAction( "Create Window - No New Agent") { @Override @@ -71,7 +71,7 @@ public void actionPerformed(ActionEvent e) } }; - private AbstractAction m_CreateNewOnAgent = new AbstractAction( + private final AbstractAction m_CreateNewOnAgent = new AbstractAction( "Create New Window on Agent Creation") { @Override @@ -81,7 +81,7 @@ public void actionPerformed(ActionEvent e) } }; - private AbstractAction m_CloseOnDestroy = new AbstractAction( + private final AbstractAction m_CloseOnDestroy = new AbstractAction( "Close Window on Agent Destruction") { @Override @@ -91,7 +91,7 @@ public void actionPerformed(ActionEvent e) } }; - private AbstractAction m_DestroyAgent = new AbstractAction("Destroy Agent") + private final AbstractAction m_DestroyAgent = new AbstractAction("Destroy Agent") { @Override public void actionPerformed(ActionEvent e) diff --git a/Java/Debugger/src/edu/umich/soar/debugger/menu/BaseMenu.java b/Java/Debugger/src/edu/umich/soar/debugger/menu/BaseMenu.java index bcbc944d11..80e9134fb6 100644 --- a/Java/Debugger/src/edu/umich/soar/debugger/menu/BaseMenu.java +++ b/Java/Debugger/src/edu/umich/soar/debugger/menu/BaseMenu.java @@ -30,13 +30,11 @@ public class BaseMenu { // The SWT menu object - private Menu m_Menu; - - private MenuItem m_Header; + private final Menu m_Menu; public BaseMenu(Menu bar, String title, final MenuUpdater updater) { - m_Header = new MenuItem(bar, SWT.CASCADE); + MenuItem m_Header = new MenuItem(bar, SWT.CASCADE); m_Header.setText(title); m_Menu = new Menu(bar.getShell(), SWT.DROP_DOWN); diff --git a/Java/Debugger/src/edu/umich/soar/debugger/menu/CommandsMenu.java b/Java/Debugger/src/edu/umich/soar/debugger/menu/CommandsMenu.java index d1964d2e1a..491c47919f 100644 --- a/Java/Debugger/src/edu/umich/soar/debugger/menu/CommandsMenu.java +++ b/Java/Debugger/src/edu/umich/soar/debugger/menu/CommandsMenu.java @@ -27,7 +27,7 @@ public class CommandsMenu private Document m_Document = null; - private AbstractAction m_RestartAgent = new AbstractAction( + private final AbstractAction m_RestartAgent = new AbstractAction( "Clear &working memory") { @Override @@ -37,7 +37,7 @@ public void actionPerformed(ActionEvent e) } }; - private AbstractAction m_ExciseAll = new AbstractAction( + private final AbstractAction m_ExciseAll = new AbstractAction( "Excise &all productions") { @Override @@ -47,7 +47,7 @@ public void actionPerformed(ActionEvent e) } }; - private AbstractAction m_ExciseChunks = new AbstractAction("Excise &chunks") + private final AbstractAction m_ExciseChunks = new AbstractAction("Excise &chunks") { @Override public void actionPerformed(ActionEvent e) @@ -56,7 +56,7 @@ public void actionPerformed(ActionEvent e) } }; - private AbstractAction m_ExciseTask = new AbstractAction( + private final AbstractAction m_ExciseTask = new AbstractAction( "Excise &task productions") { @Override @@ -66,7 +66,7 @@ public void actionPerformed(ActionEvent e) } }; - private AbstractAction m_ExciseUser = new AbstractAction( + private final AbstractAction m_ExciseUser = new AbstractAction( "Excise &user productions") { @Override @@ -76,7 +76,7 @@ public void actionPerformed(ActionEvent e) } }; - private AbstractAction m_ExciseDefault = new AbstractAction( + private final AbstractAction m_ExciseDefault = new AbstractAction( "Excise &default productions") { @Override diff --git a/Java/Debugger/src/edu/umich/soar/debugger/menu/DebugLevelMenu.java b/Java/Debugger/src/edu/umich/soar/debugger/menu/DebugLevelMenu.java index 33800721bc..801b421ca2 100644 --- a/Java/Debugger/src/edu/umich/soar/debugger/menu/DebugLevelMenu.java +++ b/Java/Debugger/src/edu/umich/soar/debugger/menu/DebugLevelMenu.java @@ -29,7 +29,7 @@ public class DebugLevelMenu implements MenuUpdater private Document m_Document = null; - private AbstractAction m_WatchStatus = new AbstractAction( + private final AbstractAction m_WatchStatus = new AbstractAction( "Show current &watch status") { @Override @@ -39,7 +39,7 @@ public void actionPerformed(ActionEvent e) } }; - private AbstractAction m_WatchDecisions = new AbstractAction("1. Decisions") + private final AbstractAction m_WatchDecisions = new AbstractAction("1. Decisions") { @Override public void actionPerformed(ActionEvent e) @@ -48,7 +48,7 @@ public void actionPerformed(ActionEvent e) } }; - private AbstractAction m_WatchPhases = new AbstractAction("2. Phases") + private final AbstractAction m_WatchPhases = new AbstractAction("2. Phases") { @Override public void actionPerformed(ActionEvent e) @@ -57,7 +57,7 @@ public void actionPerformed(ActionEvent e) } }; - private AbstractAction m_WatchAllProductions = new AbstractAction( + private final AbstractAction m_WatchAllProductions = new AbstractAction( "3. All productions") { @Override @@ -67,7 +67,7 @@ public void actionPerformed(ActionEvent e) } }; - private AbstractAction m_WatchNoProductions = new AbstractAction( + private final AbstractAction m_WatchNoProductions = new AbstractAction( "3. No productions") { @Override @@ -77,7 +77,7 @@ public void actionPerformed(ActionEvent e) } }; - private AbstractAction m_WatchUserProductions = new AbstractAction( + private final AbstractAction m_WatchUserProductions = new AbstractAction( " 3a. User productions") { @Override @@ -87,7 +87,7 @@ public void actionPerformed(ActionEvent e) } }; - private AbstractAction m_WatchChunks = new AbstractAction(" 3b. Chunks") + private final AbstractAction m_WatchChunks = new AbstractAction(" 3b. Chunks") { @Override public void actionPerformed(ActionEvent e) @@ -96,7 +96,7 @@ public void actionPerformed(ActionEvent e) } }; - private AbstractAction m_WatchJustifications = new AbstractAction( + private final AbstractAction m_WatchJustifications = new AbstractAction( " 3c. Justifications") { @Override @@ -106,7 +106,7 @@ public void actionPerformed(ActionEvent e) } }; - private AbstractAction m_WatchWmes = new AbstractAction("4. Wmes") + private final AbstractAction m_WatchWmes = new AbstractAction("4. Wmes") { @Override public void actionPerformed(ActionEvent e) @@ -115,7 +115,7 @@ public void actionPerformed(ActionEvent e) } }; - private AbstractAction m_WatchPreferences = new AbstractAction( + private final AbstractAction m_WatchPreferences = new AbstractAction( "5. Preferences") { @Override @@ -125,7 +125,7 @@ public void actionPerformed(ActionEvent e) } }; - private AbstractAction m_WatchNone = new AbstractAction("Watch ¬hing") + private final AbstractAction m_WatchNone = new AbstractAction("Watch ¬hing") { @Override public void actionPerformed(ActionEvent e) @@ -134,7 +134,7 @@ public void actionPerformed(ActionEvent e) } }; - private AbstractAction m_WatchOne = new AbstractAction( + private final AbstractAction m_WatchOne = new AbstractAction( "Watch level &1 only") { @Override @@ -144,7 +144,7 @@ public void actionPerformed(ActionEvent e) } }; - private AbstractAction m_WatchTwo = new AbstractAction( + private final AbstractAction m_WatchTwo = new AbstractAction( "Watch level 1-&2 only") { @Override @@ -154,7 +154,7 @@ public void actionPerformed(ActionEvent e) } }; - private AbstractAction m_WatchThree = new AbstractAction( + private final AbstractAction m_WatchThree = new AbstractAction( "Watch level 1-&3 only") { @Override @@ -164,7 +164,7 @@ public void actionPerformed(ActionEvent e) } }; - private AbstractAction m_WatchFour = new AbstractAction( + private final AbstractAction m_WatchFour = new AbstractAction( "Watch level 1-&4 only") { @Override @@ -174,7 +174,7 @@ public void actionPerformed(ActionEvent e) } }; - private AbstractAction m_WatchFive = new AbstractAction("Watch level 1-&5") + private final AbstractAction m_WatchFive = new AbstractAction("Watch level 1-&5") { @Override public void actionPerformed(ActionEvent e) @@ -183,7 +183,7 @@ public void actionPerformed(ActionEvent e) } }; - private AbstractAction m_WmesNone = new AbstractAction( + private final AbstractAction m_WmesNone = new AbstractAction( "Production wme detail - none") { @Override @@ -193,7 +193,7 @@ public void actionPerformed(ActionEvent e) } }; - private AbstractAction m_WmesTimeTags = new AbstractAction( + private final AbstractAction m_WmesTimeTags = new AbstractAction( "Production wme detail - time tags") { @Override @@ -203,7 +203,7 @@ public void actionPerformed(ActionEvent e) } }; - private AbstractAction m_WmesFull = new AbstractAction( + private final AbstractAction m_WmesFull = new AbstractAction( "Production wme detail - full") { @Override @@ -213,7 +213,7 @@ public void actionPerformed(ActionEvent e) } }; - private AbstractAction m_WatchAliases = new AbstractAction("Watch aliases") + private final AbstractAction m_WatchAliases = new AbstractAction("Watch aliases") { @Override public void actionPerformed(ActionEvent e) @@ -222,7 +222,7 @@ public void actionPerformed(ActionEvent e) } }; - private AbstractAction m_WatchProductionLoading = new AbstractAction( + private final AbstractAction m_WatchProductionLoading = new AbstractAction( "Watch production loading") { @Override @@ -232,7 +232,7 @@ public void actionPerformed(ActionEvent e) } }; - private AbstractAction m_WatchLearnPrint = new AbstractAction( + private final AbstractAction m_WatchLearnPrint = new AbstractAction( "Watch chunks/justifications as created") { @Override @@ -242,7 +242,7 @@ public void actionPerformed(ActionEvent e) } }; - private AbstractAction m_WatchBacktracing = new AbstractAction( + private final AbstractAction m_WatchBacktracing = new AbstractAction( "Watch backtracing as chunks created") { @Override diff --git a/Java/Debugger/src/edu/umich/soar/debugger/menu/EditMenu.java b/Java/Debugger/src/edu/umich/soar/debugger/menu/EditMenu.java index ad202925fa..cbef16fd35 100644 --- a/Java/Debugger/src/edu/umich/soar/debugger/menu/EditMenu.java +++ b/Java/Debugger/src/edu/umich/soar/debugger/menu/EditMenu.java @@ -31,7 +31,7 @@ public class EditMenu private SearchDialog m_SearchDialog = null; - private AbstractAction m_Copy = new AbstractAction("&Copy\t" + SHORTCUT_HINT + "C") + private final AbstractAction m_Copy = new AbstractAction("&Copy\t" + SHORTCUT_HINT + "C") { @Override public void actionPerformed(ActionEvent e) @@ -40,7 +40,7 @@ public void actionPerformed(ActionEvent e) } }; - private AbstractAction m_Paste = new AbstractAction("&Paste\t" + SHORTCUT_HINT + "V") + private final AbstractAction m_Paste = new AbstractAction("&Paste\t" + SHORTCUT_HINT + "V") { @Override public void actionPerformed(ActionEvent e) @@ -49,7 +49,7 @@ public void actionPerformed(ActionEvent e) } }; - private AbstractAction m_Search = new AbstractAction("&Find...\t" + SHORTCUT_HINT + "F") + private final AbstractAction m_Search = new AbstractAction("&Find...\t" + SHORTCUT_HINT + "F") { @Override public void actionPerformed(ActionEvent e) diff --git a/Java/Debugger/src/edu/umich/soar/debugger/menu/FileMenu.java b/Java/Debugger/src/edu/umich/soar/debugger/menu/FileMenu.java index 6dcc122362..6b79b6deb5 100644 --- a/Java/Debugger/src/edu/umich/soar/debugger/menu/FileMenu.java +++ b/Java/Debugger/src/edu/umich/soar/debugger/menu/FileMenu.java @@ -30,7 +30,7 @@ public class FileMenu private Document m_Document = null; - private AbstractAction m_LoadSource = new AbstractAction( + private final AbstractAction m_LoadSource = new AbstractAction( "Load &source file...") { @Override @@ -40,7 +40,7 @@ public void actionPerformed(ActionEvent e) } }; - private AbstractAction m_ChangeDirectory = new AbstractAction( + private final AbstractAction m_ChangeDirectory = new AbstractAction( "&Change current folder...") { @Override @@ -50,7 +50,7 @@ public void actionPerformed(ActionEvent e) } }; - private AbstractAction m_LoadRete = new AbstractAction( + private final AbstractAction m_LoadRete = new AbstractAction( "&Load production memory (rete)...") { @Override @@ -60,7 +60,7 @@ public void actionPerformed(ActionEvent e) } }; - private AbstractAction m_SaveRete = new AbstractAction( + private final AbstractAction m_SaveRete = new AbstractAction( "Save production memory (&rete)...") { @Override @@ -70,7 +70,7 @@ public void actionPerformed(ActionEvent e) } }; - private AbstractAction m_LogNewFile = new AbstractAction( + private final AbstractAction m_LogNewFile = new AbstractAction( "Log &output to file...") { @Override @@ -89,7 +89,7 @@ public void actionPerformed(ActionEvent e) // private AbstractAction m_LogStatus = new // AbstractAction("Logging &status") { public void // actionPerformed(ActionEvent e) { logStatus(e) ; } } ; - private AbstractAction m_Load = new AbstractAction("Load &window layout...") + private final AbstractAction m_Load = new AbstractAction("Load &window layout...") { @Override public void actionPerformed(ActionEvent e) @@ -98,7 +98,7 @@ public void actionPerformed(ActionEvent e) } }; - private AbstractAction m_Save = new AbstractAction("Save w&indow layout...") + private final AbstractAction m_Save = new AbstractAction("Save w&indow layout...") { @Override public void actionPerformed(ActionEvent e) @@ -107,7 +107,7 @@ public void actionPerformed(ActionEvent e) } }; - private AbstractAction m_Exit = new AbstractAction("E&xit") + private final AbstractAction m_Exit = new AbstractAction("E&xit") { @Override public void actionPerformed(ActionEvent e) diff --git a/Java/Debugger/src/edu/umich/soar/debugger/menu/HelpMenu.java b/Java/Debugger/src/edu/umich/soar/debugger/menu/HelpMenu.java index a5bc302086..9112f74acb 100644 --- a/Java/Debugger/src/edu/umich/soar/debugger/menu/HelpMenu.java +++ b/Java/Debugger/src/edu/umich/soar/debugger/menu/HelpMenu.java @@ -27,7 +27,7 @@ public class HelpMenu private MainFrame m_Frame = null; - private AbstractAction m_About = new AbstractAction("About Soar's Debugger") + private final AbstractAction m_About = new AbstractAction("About Soar's Debugger") { @Override public void actionPerformed(ActionEvent e) @@ -36,7 +36,7 @@ public void actionPerformed(ActionEvent e) } }; - private AbstractAction m_Homepage = new AbstractAction("Soar Home page") + private final AbstractAction m_Homepage = new AbstractAction("Soar Home page") { @Override public void actionPerformed(ActionEvent e) @@ -45,7 +45,7 @@ public void actionPerformed(ActionEvent e) } }; - private AbstractAction m_Wiki = new AbstractAction( + private final AbstractAction m_Wiki = new AbstractAction( "Soar Wiki (many topics)") { @Override @@ -55,7 +55,7 @@ public void actionPerformed(ActionEvent e) } }; - private AbstractAction m_CLI = new AbstractAction("Soar Command Line Help") + private final AbstractAction m_CLI = new AbstractAction("Soar Command Line Help") { @Override public void actionPerformed(ActionEvent e) diff --git a/Java/Debugger/src/edu/umich/soar/debugger/menu/KernelMenu.java b/Java/Debugger/src/edu/umich/soar/debugger/menu/KernelMenu.java index 4c6cc186e9..22bf2647db 100644 --- a/Java/Debugger/src/edu/umich/soar/debugger/menu/KernelMenu.java +++ b/Java/Debugger/src/edu/umich/soar/debugger/menu/KernelMenu.java @@ -31,7 +31,7 @@ public class KernelMenu private MainFrame m_Frame = null; - private AbstractAction m_StartKernel = new AbstractAction( + private final AbstractAction m_StartKernel = new AbstractAction( "Create new &local Soar Kernel instance") { @Override @@ -41,7 +41,7 @@ public void actionPerformed(ActionEvent e) } }; - private AbstractAction m_StopKernel = new AbstractAction( + private final AbstractAction m_StopKernel = new AbstractAction( "Delete local &Soar Kernel instance") { @Override @@ -51,7 +51,7 @@ public void actionPerformed(ActionEvent e) } }; - private AbstractAction m_RemoteConnect = new AbstractAction( + private final AbstractAction m_RemoteConnect = new AbstractAction( "Connect to &remote Soar...") { @Override @@ -61,7 +61,7 @@ public void actionPerformed(ActionEvent e) } }; - private AbstractAction m_RemoteDisconnect = new AbstractAction( + private final AbstractAction m_RemoteDisconnect = new AbstractAction( "&Disconnect from remote Soar") { @Override diff --git a/Java/Debugger/src/edu/umich/soar/debugger/menu/LayoutMenu.java b/Java/Debugger/src/edu/umich/soar/debugger/menu/LayoutMenu.java index a4c29518a5..00892cb73e 100644 --- a/Java/Debugger/src/edu/umich/soar/debugger/menu/LayoutMenu.java +++ b/Java/Debugger/src/edu/umich/soar/debugger/menu/LayoutMenu.java @@ -25,7 +25,7 @@ public class LayoutMenu { private MainFrame m_Frame = null; - private AbstractAction m_UseDefaultLayout = new AbstractAction( + private final AbstractAction m_UseDefaultLayout = new AbstractAction( "Use &default window layout") { @Override @@ -35,7 +35,7 @@ public void actionPerformed(ActionEvent e) } }; - private AbstractAction m_UseTreeLayout = new AbstractAction( + private final AbstractAction m_UseTreeLayout = new AbstractAction( "Use &tree view layout") { @Override @@ -45,7 +45,7 @@ public void actionPerformed(ActionEvent e) } }; - private AbstractAction m_UseTextLayout = new AbstractAction( + private final AbstractAction m_UseTextLayout = new AbstractAction( "Use te&xt view layout") { @Override @@ -55,7 +55,7 @@ public void actionPerformed(ActionEvent e) } }; - private AbstractAction m_Load = new AbstractAction("&Load window layout...") + private final AbstractAction m_Load = new AbstractAction("&Load window layout...") { @Override public void actionPerformed(ActionEvent e) @@ -64,7 +64,7 @@ public void actionPerformed(ActionEvent e) } }; - private AbstractAction m_Save = new AbstractAction("&Save window layout...") + private final AbstractAction m_Save = new AbstractAction("&Save window layout...") { @Override public void actionPerformed(ActionEvent e) diff --git a/Java/Debugger/src/edu/umich/soar/debugger/menu/ParseSelectedText.java b/Java/Debugger/src/edu/umich/soar/debugger/menu/ParseSelectedText.java index e1527fac3f..a728f40bb9 100644 --- a/Java/Debugger/src/edu/umich/soar/debugger/menu/ParseSelectedText.java +++ b/Java/Debugger/src/edu/umich/soar/debugger/menu/ParseSelectedText.java @@ -82,7 +82,7 @@ protected void addWindowSubMenu(AbstractView view, Menu menu) public static class SelectedProduction extends SelectedObject { - private String m_Name; + private final String m_Name; public SelectedProduction(String name) { @@ -116,7 +116,7 @@ public void fillMenu(Document doc, AbstractView owningView, public static class SelectedID extends SelectedObject { - private String m_Name; + private final String m_Name; public SelectedID(String id) { @@ -154,11 +154,11 @@ public void fillMenu(Document doc, AbstractView owningView, public static class SelectedWme extends SelectedObject { // Some may be null - private String m_ID; + private final String m_ID; - private String m_Att; + private final String m_Att; - private String m_Value; + private final String m_Value; public SelectedWme(String id, String att, String value) { @@ -196,7 +196,7 @@ public String toString() public static class SelectedUnknown extends SelectedObject { - private String m_Name; + private final String m_Name; public SelectedUnknown(String token) { @@ -225,13 +225,13 @@ public String toString() protected final static int kNextToken = 2; - protected String[] m_Tokens = new String[3]; + protected final String[] m_Tokens = new String[3]; protected final char[] kWhiteSpaceChars = new char[] { ' ', '\n', '\r', ')', '(', '{', '}' }; // The raw values - protected String m_FullText; + protected final String m_FullText; protected int m_SelectionStart; diff --git a/Java/Debugger/src/edu/umich/soar/debugger/menu/PrintMenu.java b/Java/Debugger/src/edu/umich/soar/debugger/menu/PrintMenu.java index 83da02af46..20bdfeaf77 100644 --- a/Java/Debugger/src/edu/umich/soar/debugger/menu/PrintMenu.java +++ b/Java/Debugger/src/edu/umich/soar/debugger/menu/PrintMenu.java @@ -27,7 +27,7 @@ public class PrintMenu private Document m_Document = null; - private AbstractAction m_PrintProductions = new AbstractAction( + private final AbstractAction m_PrintProductions = new AbstractAction( "Print all &productions") { @Override @@ -37,7 +37,7 @@ public void actionPerformed(ActionEvent e) } }; - private AbstractAction m_PrintChunks = new AbstractAction( + private final AbstractAction m_PrintChunks = new AbstractAction( "Print all &chunks") { @Override @@ -47,7 +47,7 @@ public void actionPerformed(ActionEvent e) } }; - private AbstractAction m_PrintJustifications = new AbstractAction( + private final AbstractAction m_PrintJustifications = new AbstractAction( "Print all &justifications") { @Override @@ -57,7 +57,7 @@ public void actionPerformed(ActionEvent e) } }; - private AbstractAction m_PrintStack = new AbstractAction( + private final AbstractAction m_PrintStack = new AbstractAction( "Print &goal/state stack") { @Override @@ -67,7 +67,7 @@ public void actionPerformed(ActionEvent e) } }; - private AbstractAction m_PrintState = new AbstractAction("Print &state") + private final AbstractAction m_PrintState = new AbstractAction("Print &state") { @Override public void actionPerformed(ActionEvent e) @@ -76,7 +76,7 @@ public void actionPerformed(ActionEvent e) } }; - private AbstractAction m_PrintOperator = new AbstractAction( + private final AbstractAction m_PrintOperator = new AbstractAction( "Print &operator") { @Override @@ -86,7 +86,7 @@ public void actionPerformed(ActionEvent e) } }; - private AbstractAction m_PrintTopState = new AbstractAction( + private final AbstractAction m_PrintTopState = new AbstractAction( "Print &top state") { @Override @@ -96,7 +96,7 @@ public void actionPerformed(ActionEvent e) } }; - private AbstractAction m_PrintSuperState = new AbstractAction( + private final AbstractAction m_PrintSuperState = new AbstractAction( "Print s&uper state") { @Override diff --git a/Java/Debugger/src/edu/umich/soar/debugger/menu/ViewMenu.java b/Java/Debugger/src/edu/umich/soar/debugger/menu/ViewMenu.java index e218875746..634590cd2f 100644 --- a/Java/Debugger/src/edu/umich/soar/debugger/menu/ViewMenu.java +++ b/Java/Debugger/src/edu/umich/soar/debugger/menu/ViewMenu.java @@ -1,7 +1,6 @@ package edu.umich.soar.debugger.menu; import edu.umich.soar.debugger.MainFrame; -import org.eclipse.swt.SWT; import org.eclipse.swt.graphics.Font; import org.eclipse.swt.graphics.FontData; import org.eclipse.swt.widgets.Menu; diff --git a/Java/Debugger/src/edu/umich/soar/debugger/modules/AbstractComboView.java b/Java/Debugger/src/edu/umich/soar/debugger/modules/AbstractComboView.java index 16b50849da..1711d3d90f 100644 --- a/Java/Debugger/src/edu/umich/soar/debugger/modules/AbstractComboView.java +++ b/Java/Debugger/src/edu/umich/soar/debugger/modules/AbstractComboView.java @@ -85,7 +85,7 @@ public abstract class AbstractComboView extends AbstractUpdateView implements protected String m_CurrentCommand; /** The history of commands for this window */ - protected CommandHistory m_CommandHistory = new CommandHistory(); + protected final CommandHistory m_CommandHistory = new CommandHistory(); protected long m_PrintCallback = -1; @@ -271,7 +271,7 @@ public void widgetSelected(SelectionEvent e) // SWT.TRAVERSE_TAB_NEXT event (through event.type) // is too late in the sequence it turns out. That's why we listen for // SWT.Traverse and then look at the detail. - protected Listener m_Tab = new Listener() + protected final Listener m_Tab = new Listener() { @Override public void handleEvent(Event e) diff --git a/Java/Debugger/src/edu/umich/soar/debugger/modules/AbstractView.java b/Java/Debugger/src/edu/umich/soar/debugger/modules/AbstractView.java index 0dcc4716a9..eab9967808 100644 --- a/Java/Debugger/src/edu/umich/soar/debugger/modules/AbstractView.java +++ b/Java/Debugger/src/edu/umich/soar/debugger/modules/AbstractView.java @@ -65,7 +65,7 @@ public abstract class AbstractView implements AgentFocusListener protected Composite m_Container; /** A class to help with logging, should this window wish to offer that **/ - protected Logger m_Logger = new Logger(); + protected final Logger m_Logger = new Logger(); /** The line separator Soar uses and that we therefore use. */ public static final String kLineSeparator = "\n"; @@ -205,7 +205,7 @@ public void paste() // Adding a key listener for this event allows us to call our paste method // so commands are pasted into the command // buffer rather than into the window. - protected Listener m_ControlV = e -> { + protected final Listener m_ControlV = e -> { if (e.type == SWT.KeyDown) { int key = e.keyCode; diff --git a/Java/Debugger/src/edu/umich/soar/debugger/modules/EditorView.java b/Java/Debugger/src/edu/umich/soar/debugger/modules/EditorView.java index a48e43f2b8..1ca658e1f1 100644 --- a/Java/Debugger/src/edu/umich/soar/debugger/modules/EditorView.java +++ b/Java/Debugger/src/edu/umich/soar/debugger/modules/EditorView.java @@ -58,7 +58,7 @@ public class EditorView extends AbstractView protected boolean m_ComboAtTop = true; /** The history of commands for this window */ - protected CommandHistory m_CommandHistory = new CommandHistory(); + protected final CommandHistory m_CommandHistory = new CommandHistory(); // The constructor must take no arguments so it can be called // from the loading code and the new window dialog diff --git a/Java/Debugger/src/edu/umich/soar/debugger/modules/FoldingTextView.java b/Java/Debugger/src/edu/umich/soar/debugger/modules/FoldingTextView.java index fbeedad3c9..ec1f07dc24 100644 --- a/Java/Debugger/src/edu/umich/soar/debugger/modules/FoldingTextView.java +++ b/Java/Debugger/src/edu/umich/soar/debugger/modules/FoldingTextView.java @@ -123,7 +123,7 @@ public class FoldingTextView extends AbstractComboView implements */ protected static class TreeData { - protected ArrayList m_Lines = new ArrayList<>(); + protected final ArrayList m_Lines = new ArrayList<>(); public void addLine(String text) { @@ -1279,11 +1279,11 @@ else if (xmlTrace.IsTagError()) public static class RunWrapper implements Runnable { - FoldingTextView m_View; + final FoldingTextView m_View; - Agent m_Agent; + final Agent m_Agent; - ClientXML m_XML; + final ClientXML m_XML; public RunWrapper(FoldingTextView view, Agent agent, ClientXML xml) { diff --git a/Java/Debugger/src/edu/umich/soar/debugger/modules/KeepCommandView.java b/Java/Debugger/src/edu/umich/soar/debugger/modules/KeepCommandView.java index 222820a849..1725075278 100644 --- a/Java/Debugger/src/edu/umich/soar/debugger/modules/KeepCommandView.java +++ b/Java/Debugger/src/edu/umich/soar/debugger/modules/KeepCommandView.java @@ -21,7 +21,6 @@ public class KeepCommandView extends AbstractSingleTextView { public KeepCommandView() { - m_ClearComboEachCommand = false; m_ClearEachCommand = false; m_UpdateOnStop = false; m_ClearComboEachCommand = true; diff --git a/Java/Debugger/src/edu/umich/soar/debugger/modules/PhaseView.java b/Java/Debugger/src/edu/umich/soar/debugger/modules/PhaseView.java index 434f7166db..3d6acc93c9 100644 --- a/Java/Debugger/src/edu/umich/soar/debugger/modules/PhaseView.java +++ b/Java/Debugger/src/edu/umich/soar/debugger/modules/PhaseView.java @@ -46,7 +46,7 @@ public class PhaseView extends AbstractFixedView implements { protected Canvas m_PhaseDiagram; - protected String[] m_ImageNames = { "phase-none.png", "phase-input.png", + protected final String[] m_ImageNames = { "phase-none.png", "phase-input.png", "phase-proposal.png", "phase-decision.png", "phase-apply.png", "phase-output.png", "phase-world.png", "phase-stop-cursor.png", "phase-stop-cursor2.png", "phase-stop-cursor-shadow.png", @@ -127,8 +127,8 @@ public void init(MainFrame frame, Document doc, Pane parentPane) } catch (Exception ex) { - System.out.println("Error reading image " + m_ImageNames[i]); - System.out.println(ex); + System.err.println("Error reading image " + m_ImageNames[i]); + System.err.println(ex); } } diff --git a/Java/Debugger/src/edu/umich/soar/debugger/modules/RHSBarChartView.java b/Java/Debugger/src/edu/umich/soar/debugger/modules/RHSBarChartView.java index f908c21aee..63eb618a27 100644 --- a/Java/Debugger/src/edu/umich/soar/debugger/modules/RHSBarChartView.java +++ b/Java/Debugger/src/edu/umich/soar/debugger/modules/RHSBarChartView.java @@ -91,9 +91,9 @@ static class OrderedString implements Comparable this.value = ov.value; } - public String string; + public final String string; - public Integer value; + public final Integer value; // This is backwards because descending iterator is a java 1.6 feature @Override @@ -125,11 +125,11 @@ public int hashCode() boolean clear = false; // category -> series -> value - HashMap> categoryToSeriesMap = new HashMap<>(); + final HashMap> categoryToSeriesMap = new HashMap<>(); - TreeSet categoryOrderSet = new TreeSet<>(); + final TreeSet categoryOrderSet = new TreeSet<>(); - TreeSet seriesOrderSet = new TreeSet<>(); + final TreeSet seriesOrderSet = new TreeSet<>(); @Override public String rhsFunctionHandler(int eventID, Object data, diff --git a/Java/Debugger/src/edu/umich/soar/debugger/modules/RHSObjectTextView.java b/Java/Debugger/src/edu/umich/soar/debugger/modules/RHSObjectTextView.java index 3d0f6c17b9..879f7ee7f8 100644 --- a/Java/Debugger/src/edu/umich/soar/debugger/modules/RHSObjectTextView.java +++ b/Java/Debugger/src/edu/umich/soar/debugger/modules/RHSObjectTextView.java @@ -115,7 +115,7 @@ public String getIdentifier() return this.id; } - protected String id; + protected final String id; protected int order = 0; @@ -207,10 +207,10 @@ public String toString() } // Identifier to metadata map - HashMap idToOrdered = new HashMap<>(); + final HashMap idToOrdered = new HashMap<>(); // The sorted objects - TreeSet sortedIdentifiers = new TreeSet<>(); + final TreeSet sortedIdentifiers = new TreeSet<>(); @Override public String rhsFunctionHandler(int eventID, Object data,