Skip to content

Commit

Permalink
Fixed Code QL error - unused parameters.
Browse files Browse the repository at this point in the history
  • Loading branch information
HoneySkull committed Dec 26, 2023
1 parent 90671bc commit 356b0c7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion megamek/src/megamek/client/ui/swing/ClientGUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -936,7 +936,7 @@ public void actionPerformed(ActionEvent event) {
bv.refreshDisplayables();
break;
case VIEW_TOGGLE_CF_WARNING:
ConstructionFactorWarning.handleActionPerformed(client.getGame(), bv);
ConstructionFactorWarning.handleActionPerformed();
break;
case VIEW_MOVE_ENV:
if (curPanel instanceof MovementDisplay) {
Expand Down
2 changes: 1 addition & 1 deletion megamek/src/megamek/common/ConstructionFactorWarning.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class ConstructionFactorWarning {
* Handler for ClientGUI actionPerformed event. Encapsulates
* as much Construction Factory Warning logic possible.
*/
public static void handleActionPerformed(Game g, BoardView bv) {
public static void handleActionPerformed() {
toggleCFWarning();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,9 @@ public void testSetPreferenceForCFWarningIndicator() {
public void testActionPerformedHandlerTogglesCFWarningPref() {
// Test logic used when an action is performed.
// When the action to toggle CF Warning is called, the state of the toggle should flip.
BoardView bv = mock(BoardView.class);
Game g = mock(Game.class);
when(g.getPhase()).thenReturn(GamePhase.DEPLOYMENT);
boolean expected = !GUIP.getShowCFWarnings();

ConstructionFactorWarning.handleActionPerformed(g, bv);
ConstructionFactorWarning.handleActionPerformed();

//Expect to see the toggle state for CF Warning toggled after the handler is called.
assertEquals(expected, GUIP.getShowCFWarnings());
Expand Down

0 comments on commit 356b0c7

Please sign in to comment.