diff --git a/Ghidra/Features/ProgramDiff/src/test.slow/java/ghidra/app/plugin/core/diff/DiffGet2Test.java b/Ghidra/Features/ProgramDiff/src/test.slow/java/ghidra/app/plugin/core/diff/DiffGet2Test.java index a10e33b2f0..8b9a35c5dc 100644 --- a/Ghidra/Features/ProgramDiff/src/test.slow/java/ghidra/app/plugin/core/diff/DiffGet2Test.java +++ b/Ghidra/Features/ProgramDiff/src/test.slow/java/ghidra/app/plugin/core/diff/DiffGet2Test.java @@ -15,27 +15,14 @@ */ package ghidra.app.plugin.core.diff; -import static org.junit.Assert.assertEquals; +import static org.junit.Assert.*; import javax.swing.JDialog; -import org.junit.Before; import org.junit.Test; public class DiffGet2Test extends DiffTestAdapter { - public DiffGet2Test() { - super(); - } - - @Override - @Before - public void setUp() throws Exception { - super.setUp(); -// programBuilderDiffTest1.createMemory("d4", "0x400", 0x100); -// programBuilderDiffTest2.createMemory("d2", "0x200", 0x100); - } - @Test public void testGetByteDiffsAction() throws Exception { getDiffDialog(diffTestP1, diffTestP2); @@ -43,7 +30,7 @@ public class DiffGet2Test extends DiffTestAdapter { byteCB.setSelected(true); waitForPostedSwingRunnables(); pressButtonByText(getDiffsDialog, "OK"); - JDialog dialog = waitForJDialog(tool.getToolFrame(), "Memory Differs", 2000); + JDialog dialog = waitForJDialog("Memory Differs"); pressButtonByText(dialog, "OK"); waitForPostedSwingRunnables(); waitForDiff(); @@ -58,7 +45,7 @@ public class DiffGet2Test extends DiffTestAdapter { codeUnitCB.setSelected(true); waitForPostedSwingRunnables(); pressButtonByText(getDiffsDialog, "OK"); - JDialog dialog = waitForJDialog(tool.getToolFrame(), "Memory Differs", 2000); + JDialog dialog = waitForJDialog("Memory Differs"); pressButtonByText(dialog, "OK"); waitForPostedSwingRunnables(); waitForDiff(); @@ -73,7 +60,7 @@ public class DiffGet2Test extends DiffTestAdapter { programContextCB.setSelected(true); waitForPostedSwingRunnables(); pressButtonByText(getDiffsDialog, "OK"); - JDialog dialog = waitForJDialog(tool.getToolFrame(), "Memory Differs", 2000); + JDialog dialog = waitForJDialog("Memory Differs"); pressButtonByText(dialog, "OK"); waitForPostedSwingRunnables(); waitForDiff(); @@ -87,7 +74,7 @@ public class DiffGet2Test extends DiffTestAdapter { bookmarkCB.setSelected(true); waitForPostedSwingRunnables(); pressButtonByText(getDiffsDialog, "OK"); - JDialog dialog = waitForJDialog(tool.getToolFrame(), "Memory Differs", 2000); + JDialog dialog = waitForJDialog("Memory Differs"); pressButtonByText(dialog, "OK"); waitForPostedSwingRunnables(); waitForDiff(); @@ -101,7 +88,7 @@ public class DiffGet2Test extends DiffTestAdapter { commentCB.setSelected(true); waitForPostedSwingRunnables(); pressButtonByText(getDiffsDialog, "OK"); - JDialog dialog = waitForJDialog(tool.getToolFrame(), "Memory Differs", 2000); + JDialog dialog = waitForJDialog("Memory Differs"); pressButtonByText(dialog, "OK"); waitForPostedSwingRunnables(); waitForDiff(); diff --git a/Ghidra/Features/ProgramDiff/src/test.slow/java/ghidra/app/plugin/core/diff/DiffIgnoreTest.java b/Ghidra/Features/ProgramDiff/src/test.slow/java/ghidra/app/plugin/core/diff/DiffIgnoreTest.java index 1468bbea1c..a7cc1abbd4 100644 --- a/Ghidra/Features/ProgramDiff/src/test.slow/java/ghidra/app/plugin/core/diff/DiffIgnoreTest.java +++ b/Ghidra/Features/ProgramDiff/src/test.slow/java/ghidra/app/plugin/core/diff/DiffIgnoreTest.java @@ -27,22 +27,18 @@ import ghidra.program.model.address.AddressSet; import ghidra.program.model.symbol.Equate; /** - * Tests the Ignore function of the Diff Tool, such that the current - * difference is ignored and the next difference is selected. + * Tests the Ignore function of the Diff Tool, such that the current difference is ignored and + * the next difference is selected */ public class DiffIgnoreTest extends DiffApplyTestAdapter { - public DiffIgnoreTest() { - super(); - } - /** - * Tests to see if a difference is ignored and the next difference is selected - * @throws Exception + /* + * Tests that a difference is ignored and the next difference is selected */ @Test public void testIgnoreDiffsNextActionFirst() throws Exception { openDiff(diffTestP1, diffTestP2); - JDialog dialog = waitForJDialog(tool.getToolFrame(), "Memory Differs", 2000); + JDialog dialog = waitForJDialog("Memory Differs"); pressButtonByText(dialog, "OK"); waitForPostedSwingRunnables(); @@ -61,14 +57,13 @@ public class DiffIgnoreTest extends DiffApplyTestAdapter { assertEquals((byte) 0xac, bytes[0]); } - /** - * Tests to see if Equate Tables are properly ignored and the next difference is properly selected - * @throws Exception + /* + * Test that Equate Tables are properly ignored and the next difference is properly selected */ @Test public void testIgnoreDiffsNextActionMiddle() throws Exception { openDiff(diffTestP1, diffTestP2); - JDialog dialog = waitForJDialog(tool.getToolFrame(), "Memory Differs", 2000); + JDialog dialog = waitForJDialog("Memory Differs"); pressButtonByText(dialog, "OK"); waitForPostedSwingRunnables(); @@ -86,14 +81,13 @@ public class DiffIgnoreTest extends DiffApplyTestAdapter { assertEquals(0, eqs.size()); } - /** - * Tests to see if the ignore button is disabled after ignoring the last difference - * @throws Exception + /* + * Tests that the ignore button is disabled after ignoring the last difference */ @Test public void testIgnoreDiffsNextActionLast() throws Exception { openDiff(diffTestP1, diffTestP2); - JDialog dialog = waitForJDialog(tool.getToolFrame(), "Memory Differs", 2000); + JDialog dialog = waitForJDialog("Memory Differs"); pressButtonByText(dialog, "OK"); waitForPostedSwingRunnables(); diff --git a/Ghidra/Framework/Docking/src/main/java/docking/DockingWindowManager.java b/Ghidra/Framework/Docking/src/main/java/docking/DockingWindowManager.java index 9eaaaf4a34..69935507db 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/DockingWindowManager.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/DockingWindowManager.java @@ -44,17 +44,17 @@ import util.CollectionUtils; import utilities.util.reflection.ReflectionUtilities; /** - * Manages the "Docking" arrangement of a set of components and actions. The components can be "docked" + * Manages the "Docking" arrangement of a set of components and actions. The components can be "docked" * together or exist in their own window. Actions can be associated with components so they * "move" with the component as it moved from one location to another. *
* Components are added via ComponentProviders. A ComponentProvider is an interface for getting * a component and its related information. The docking window manager will get the component * from the provider as needed. It is up to the provider if it wants to reuse the component or - * recreate a new one when the component is requested. When the user hides a component (by using + * recreate a new one when the component is requested. When the user hides a component (by using * the x button on the component header), the docking window manager removes all * knowledge of the component and will request it again from the provider if the component - * is again shown. The provider is also notified whenever a component is hidden and shown. + * is again shown. The provider is also notified whenever a component is hidden and shown. */ public class DockingWindowManager implements PropertyChangeListener, PlaceholderInstaller { @@ -64,9 +64,9 @@ public class DockingWindowManager implements PropertyChangeListener, Placeholder private static Object objectUnderMouse; /** - * The owner name for docking windows actions. + * The owner name for docking windows actions. *
Warning: Any action with this owner will get removed every time the 'Window' menu is - * rebuilt, with the exception if reserved key bindings. + * rebuilt, with the exception if reserved key bindings. */ public static final String DOCKING_WINDOWS_OWNER = "DockingWindows"; public static final String TOOL_PREFERENCES_XML_NAME = "PREFERENCES"; @@ -122,7 +122,7 @@ public class DockingWindowManager implements PropertyChangeListener, Placeholder /** * Constructs a new DockingWindowManager - * + * * @param tool the tool * @param images the list of icons to set on the window * @param modal if true then the root window will be a modal dialog instead of a frame @@ -244,7 +244,7 @@ public class DockingWindowManager implements PropertyChangeListener, Placeholder */ public static synchronized DockingWindowManager getActiveInstance() { // - // Assumption: the managers are put into the list in the order they are created. The + // Assumption: the managers are put into the list in the order they are created. The // most recently created manager is the last shown manager, making it the // most active. Any time we change the active manager, it will be placed // in the back of the list. @@ -279,7 +279,7 @@ public class DockingWindowManager implements PropertyChangeListener, Placeholder /** * Register a specific Help content URL for a component. * The DocWinListener will be notified with the helpURL if the specified - * component 'c' has focus and the help key is pressed. + * component 'c' has focus and the help key is pressed. * @param c component on which to set help. * @param helpLocation help content location */ @@ -306,7 +306,7 @@ public class DockingWindowManager implements PropertyChangeListener, Placeholder /** * Returns true if this manager contains the given provider. - * + * * @param provider the provider for which to check * @return true if this manager contains the given provider. */ @@ -538,7 +538,7 @@ public class DockingWindowManager implements PropertyChangeListener, Placeholder /** * The first provider instance with a class equal to that of the given class - * + * * @param clazz the class of the desired provider * @return the first provider instance with a class equal to that of the given class. * @see #getComponentProviders(Class) @@ -551,7 +551,7 @@ public class DockingWindowManager implements PropertyChangeListener, Placeholder /** * Gets all components providers with a matching class. Some component providers will have * multiple instances in the tool - * + * * @param clazz The class of the provider * @return all found provider instances */ @@ -568,9 +568,9 @@ public class DockingWindowManager implements PropertyChangeListener, Placeholder /** * Returns the component provider that is the conceptual parent of the given component. More - * precisely, this will return the component provider whose + * precisely, this will return the component provider whose * {@link ComponentProvider#getComponent() component} is the parent of the given component. - * + * * @param component the component for which to find a provider * @return the provider; null if the component is not the child of a provider */ @@ -707,8 +707,8 @@ public class DockingWindowManager implements PropertyChangeListener, Placeholder Action getActionForKeyStroke(KeyStroke keyStroke) { DockingToolActions toolActions = tool.getToolActions(); if (toolActions instanceof ToolActions) { - // Using a cast here; it didn't make sense to include this 'getAction' on the - // DockingToolActions + // Using a cast here; it didn't make sense to include this 'getAction' on the + // DockingToolActions return ((ToolActions) toolActions).getAction(keyStroke); } return null; @@ -728,7 +728,7 @@ public class DockingWindowManager implements PropertyChangeListener, Placeholder *
* The default group for a cascaded submenu is the name of the submenu.
*
- *
+ *
* @param menuPath menu name path where the last element corresponds to the specified group name.
* @param group group name
- * @param menuSubGroup the name used to sort the cascaded menu within other menu items at
- * its level
+ * @param menuSubGroup the name used to sort the cascaded menu within other menu items at
+ * its level
*/
public void setMenuGroup(String[] menuPath, String group, String menuSubGroup) {
actionToGuiMapper.setMenuGroup(menuPath, group, menuSubGroup);
@@ -2143,10 +2150,10 @@ public class DockingWindowManager implements PropertyChangeListener, Placeholder
}
/**
- * Returns a list of temporary popup actions to be returned. Only those actions which have
- * a suitable popup menu path will be considered. This mechanism allows clients to
+ * Returns a list of temporary popup actions to be returned. Only those actions which have
+ * a suitable popup menu path will be considered. This mechanism allows clients to
* add transient actions to be added to the tool without the accompanying management overhead.
- *
+ *
* @param context the ActionContext
* @return list of temporary actions
* @see #addPopupActionProvider(PopupActionProvider)
@@ -2185,7 +2192,7 @@ public class DockingWindowManager implements PropertyChangeListener, Placeholder
* be the context from the currently focused {@link ComponentProvider}. If that
* context is not valid for the given action and the action supports using the default
* tool context, then the default tool context will be returned. Otherwise, returns null.
- *
+ *
* @param action the action for which to get an {@link ActionContext}
* @return the {@link ActionContext} appropriate for the given action or null
*/
@@ -2223,7 +2230,7 @@ public class DockingWindowManager implements PropertyChangeListener, Placeholder
/**
* Registers a callback to be notified when the given component has been parented to
* a docking window manager
- *
+ *
* @param component the component that will be parented in a docking window system
* @param listener the listener to be notified the component was parented
*/
@@ -2254,7 +2261,7 @@ public class DockingWindowManager implements PropertyChangeListener, Placeholder
return;
}
- // Unable to find the manager. This can happen during testing; only report if
+ // Unable to find the manager. This can happen during testing; only report if
// it is unexpected
maybeReportMissingManager();
}
@@ -2282,10 +2289,10 @@ public class DockingWindowManager implements PropertyChangeListener, Placeholder
//==================================================================================================
// Inner Classes
-//==================================================================================================
+//==================================================================================================
/**
- * A class that tracks placeholders that are activated (brought to the front). If a
+ * A class that tracks placeholders that are activated (brought to the front). If a
* placeholder is activated too frequently, this class will emphasize that window, under the
* assumption that the user doesn't see the window.
*/
diff --git a/Ghidra/Framework/Docking/src/test.slow/java/docking/framework/SplashScreenTest.java b/Ghidra/Framework/Docking/src/test.slow/java/docking/framework/SplashScreenTest.java
index 5c68926866..c3ef15bca8 100644
--- a/Ghidra/Framework/Docking/src/test.slow/java/docking/framework/SplashScreenTest.java
+++ b/Ghidra/Framework/Docking/src/test.slow/java/docking/framework/SplashScreenTest.java
@@ -110,10 +110,10 @@ public class SplashScreenTest extends AbstractDockingTest {
showSplashScreen(false);
}
- /**
+ /*
* Test that the modal password dialog does not get hidden behind the
- * splash screen.
- *
+ * splash screen.
+ *
* @since Tracker Id 275
*/
@Test
@@ -125,7 +125,7 @@ public class SplashScreenTest extends AbstractDockingTest {
// show a modal dialog with no parent (this will use the Splash Screen's parent)
showModalPasswordDialog(null);
- // When the splash screen and the dialog share a parent, then the dialog should NOT
+ // When the splash screen and the dialog share a parent, then the dialog should NOT
// cause the splash screen to go away
ensureSpashScreenVisible(true);
}
@@ -145,7 +145,7 @@ public class SplashScreenTest extends AbstractDockingTest {
//==================================================================================================
// Private Methods
-//==================================================================================================
+//==================================================================================================
private void ensureSplashScreenWillClose() {
waitForCondition(() -> {
@@ -172,7 +172,7 @@ public class SplashScreenTest extends AbstractDockingTest {
return (DockingDialog) dialog;
}
- // handles showing the modal info window, which must be done from a thread outside of the
+ // handles showing the modal info window, which must be done from a thread outside of the
// test thread
private void showModalInfoWindow(final JFrame parentFrame) {
// create a thread to show the modal dialog so that the current thread doesn't block
* Note: This method will not show the given provider if it has not previously been
* added via addComponent(...)
.
- *
+ *
* @param provider the provider of the component to be hidden or shown.
* @param visibleState true to show the component, false to hide it.
* @see #addComponent(ComponentProvider)
@@ -767,7 +767,7 @@ public class DockingWindowManager implements PropertyChangeListener, Placeholder
//
// Handle the window being minimized (Windows doesn't always raise the window when
// calling setVisible()
- //
+ //
if (window instanceof Frame) {
Frame frame = (Frame) window;
int state = frame.getState();
@@ -784,7 +784,7 @@ public class DockingWindowManager implements PropertyChangeListener, Placeholder
//
// Handle the window being minimized (Linux doesn't always raise the window when
// calling setVisible()
- //
+ //
if (window instanceof Frame) {
Frame frame = (Frame) window;
int state = frame.getState();
@@ -843,8 +843,8 @@ public class DockingWindowManager implements PropertyChangeListener, Placeholder
}
/**
- * Shows or hides the component associated with the given placeholder object.
- *
+ * Shows or hides the component associated with the given placeholder object.
+ *
* @param placeholder the component placeholder object for the component to be shown or hidden.
* @param visibleState true to show or false to hide.
* @param requestFocus True signals that the system should request focus on the component.
@@ -946,19 +946,19 @@ public class DockingWindowManager implements PropertyChangeListener, Placeholder
//
// Clear our focus history, as we are changing placeholders' providers, so the old focus
// is no longer relevant.
- //
+ //
clearFocusedComponent();
lastFocusedPlaceholders.clear();
- //
+ //
// Save off the active providers. They will be re-assigned to new placeholders.
//
Map