Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed some unused variables that were causing IDE warnings. #2822

Merged
merged 4 commits into from
May 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions megamek/src/megamek/client/bot/princess/BehaviorSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -722,8 +722,6 @@ public boolean isDefault() {
*/
Element toXml(final Document doc,
final boolean includeTargets) {
final String METHOD_NAME = "toXml(Document, boolean)";

try {
final Element behavior = doc.createElement("behavior");

Expand Down
3 changes: 1 addition & 2 deletions megamek/src/megamek/client/ui/swing/CommonMenuBar.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ public class CommonMenuBar extends JMenuBar implements ActionListener,
/**
* When we have a unit list, set this to <code>true</code>.
*/
private boolean hasUnitList;
private JMenuItem fileUnitsReinforce;
private JMenuItem fileUnitsReinforceRAT;
private JMenuItem fileRefreshCache;
Expand Down Expand Up @@ -1085,7 +1084,7 @@ public synchronized void setBoard(boolean available) {
* cleared.
*/
public synchronized void setUnitList(boolean available) {
hasUnitList = available;
// manageMenu sets unit menus based on phase not from this setUnitListFlag.
manageMenu();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
import megamek.common.Entity;
import megamek.common.HexTarget;
import megamek.common.IAimingModes;
import megamek.common.IBoard;
import megamek.common.IGame;
import megamek.common.Mounted;
import megamek.common.TargetRoll;
Expand Down Expand Up @@ -800,7 +799,6 @@ public void target(Targetable t) {
}
facing = (facing + weapon.getFacing()) % 6;
Coords c = ce().getPosition().translated(facing);
IBoard board = clientgui.getClient().getGame().getBoard();
Targetable hexTarget = new HexTarget(c, Targetable.TYPE_HEX_CLEAR);

// Ignore events that will be generated by the select/cursor calls
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
import megamek.client.ui.swing.widget.MegamekButton;
import megamek.client.ui.swing.widget.SkinSpecification;
import megamek.client.ui.swing.widget.SkinXMLHandler;
import megamek.common.logging.MMLogger;
import megamek.common.preference.IPreferenceChangeListener;
import megamek.common.preference.PreferenceChangeEvent;

Expand All @@ -58,9 +57,6 @@
public abstract class StatusBarPhaseDisplay extends AbstractPhaseDisplay
implements ActionListener, MouseListener, KeyListener, IPreferenceChangeListener {

//L4J Support
private MMLogger logger = null;

private static final long serialVersionUID = 639696875125581395L;

protected static final int TRANSPARENT = 0xFFFF00FF;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ public class SkinEditorMainGUI extends JPanel implements WindowListener, BoardVi
public UnitDisplay unitDisplay;

protected JComponent curPanel;
private ChatLounge chatlounge;

/**
* Test entity to display in UnitDisplay.
Expand Down Expand Up @@ -566,7 +565,6 @@ private JComponent initializePanel(IGame.Phase phase) {
switch (phase) {
case PHASE_LOUNGE:
component = new ChatLounge(null);
chatlounge = (ChatLounge) component;
main = "ChatLounge"; //$NON-NLS-1$
component.setName(main);
panMain.add(component, main);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
import megamek.client.ui.swing.tileset.MechTileset.MechEntry;
import megamek.client.ui.swing.util.EntityWreckHelper;
import megamek.client.ui.swing.util.ImageCache;
import megamek.client.ui.swing.util.PlayerColour;
import megamek.client.ui.swing.util.RotateFilter;
import megamek.common.*;
import megamek.common.annotations.Nullable;
Expand Down Expand Up @@ -615,7 +614,6 @@ public synchronized void loadImage(Entity entity, int secondaryPos) {
Image wreck = wreckTileset.imageFor(entity, secondaryPos);

IPlayer player = entity.getOwner();
PlayerColour tint = player.getColour();

Camouflage camouflage = entity.getCamouflageOrElse(player.getCamouflage());
EntityImage entityImage = null;
Expand Down
1 change: 0 additions & 1 deletion megamek/src/megamek/common/MULParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -1759,7 +1759,6 @@ else if (!mounted.getType().getInternalName()
}
}
if (entity.isSupportVehicle() && (mounted.getType() instanceof InfantryWeapon)) {
int clipSize = ((InfantryWeapon) mounted.getType()).getShots();
for (Mounted ammo = mounted.getLinked(); ammo != null; ammo = ammo.getLinked()) {
if (((AmmoType) ammo.getType()).getMunitionType() == AmmoType.M_INFERNO) {
if (!inferno.isEmpty()) {
Expand Down
1 change: 0 additions & 1 deletion megamek/src/megamek/common/SmallCraft.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ public class SmallCraft extends Aero {
// Maps transported crew,passengers,marines to a host ship so we can match them up again post-game
private Map<String,Integer> nOtherCrew = new HashMap<>();
private Map<String,Integer> passengers = new HashMap<>();
private Map<Integer,Integer> nOtherMarines = new HashMap<>();

// escape pods and lifeboats
private int escapePods = 0;
Expand Down
1 change: 0 additions & 1 deletion megamek/src/megamek/common/Warship.java
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,6 @@ public double getCost(boolean ignoreAmmo) {
double[] driveCost = new double[6];
int driveIdx = 0;
double driveCosts = 0;
int dockingCollars = 0;
// Drive Coil
driveCost[driveIdx++] += 60000000.0 + (75000000.0 * getDocks(true));
// Initiator
Expand Down
2 changes: 1 addition & 1 deletion megamek/src/megamek/common/loaders/MtfFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,7 @@ private void parseNoCritEquipment(Mech mech, String name) throws EntityLoadingEx
EquipmentType eq = EquipmentType.get(name);
if (eq != null) {
try {
Mounted mount = mech.addEquipment(eq, loc);
mech.addEquipment(eq, loc);
} catch (LocationFullException ex) {
throw new EntityLoadingException(ex.getMessage());
}
Expand Down
4 changes: 0 additions & 4 deletions megamek/src/megamek/common/verifier/TestProtomech.java
Original file line number Diff line number Diff line change
Expand Up @@ -341,8 +341,6 @@ public String printWeightControls() {
public StringBuffer printMiscEquip(StringBuffer buff, int posLoc,
int posWeight) {
for (Mounted m : getEntity().getMisc()) {
MiscType mt = (MiscType) m.getType();

buff.append(StringUtil.makeLength(m.getName(), 20));
buff.append(
StringUtil.makeLength(getLocationAbbr(m.getLocation()),
Expand All @@ -356,8 +354,6 @@ public StringBuffer printMiscEquip(StringBuffer buff, int posLoc,
@Override
public StringBuffer printWeapon(StringBuffer buff, int posLoc, int posWeight) {
for (Mounted m : getEntity().getWeaponList()) {
WeaponType mt = (WeaponType) m.getType();

buff.append(StringUtil.makeLength(m.getName(), 20));
buff.append(
StringUtil.makeLength(getLocationAbbr(m.getLocation()),
Expand Down
2 changes: 0 additions & 2 deletions megamek/src/megamek/server/Server.java
Original file line number Diff line number Diff line change
Expand Up @@ -18435,7 +18435,6 @@ private void resolveChargeDamage(Entity ae, Entity te, ToHitData toHit, int dire
}

// track any additional damage to the attacker due to the target having spikes
int spikeDamage = 0;
while (damage > 0) {
int cluster = Math.min(5, damage);
// Airmech ramming attacks do all damage to a single location
Expand Down Expand Up @@ -27949,7 +27948,6 @@ public Vector<Report> explodeEquipment(Entity en, int loc, Mounted mounted) {
* Possible to override 'is explosive' check
*/
public Vector<Report> explodeEquipment(Entity en, int loc, Mounted mounted, boolean overrideExplosiveCheck) {
final String METHOD_NAME = "explodeEquipment(Entity,int,Mounted)";
Vector<Report> vDesc = new Vector<>();
// is this already destroyed?
if (mounted.isDestroyed()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@
*/
package megamek.client.bot.princess;

import megamek.common.IGame;
import megamek.common.options.GameOptions;

import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

import megamek.common.IGame;
import megamek.common.options.GameOptions;

/**
* @author Deric "Netzilla" Page (deric dot page at usa dot net)
* @version $Id$
Expand All @@ -29,11 +30,15 @@
@RunWith(JUnit4.class)
public class NewtonAerospacePathRankerTest {

@SuppressWarnings("unused")
private Princess mockPrincess;
@SuppressWarnings("unused")
private NewtonianAerospacePathRanker mockPathRanker;
@SuppressWarnings("unused")
private IGame mockGame;
@SuppressWarnings("unused")
private GameOptions mockGameOptions;

@Before
public void setUp() {
/*mockPathRanker = Mockito.mock(NewtonianAerospacePathRanker.class);
Expand All @@ -56,6 +61,7 @@ public void setUp() {
Mockito.when(mockGameOptions.booleanOption(OptionsConstants.ADVAERORULES_STRATOPS_SENSOR_SHADOW)).thenReturn(true);*/
}

@Ignore
@Test
public void testCalculateSensorShadowMod() {
/*final MovePath mockPath = Mockito.mock(MovePath.class);
Expand Down