Преглед изворни кода

BETA: Removed some SuppressWarnings annotations that are hiding possible problems:
* Removed some unused variables and methods.
* Added some serialVersionUID.

Zoey76 пре 13 година
родитељ
комит
1a54f6096f

+ 2 - 5
L2J_Server_BETA/java/com/l2jserver/gameserver/ai/L2AttackableAI.java

@@ -2248,13 +2248,10 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
 		}
 	}
 	
-	@SuppressWarnings("null")
 	private void aggroReconsider()
 	{
-		
 		L2Attackable actor = getActiveChar();
 		L2Character MostHate = actor.getMostHated();
-		
 		if (actor.getHateList() != null)
 		{
 			
@@ -2286,7 +2283,6 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
 				actor.setTarget(obj);
 				setAttackTarget(obj);
 				return;
-				
 			}
 		}
 		
@@ -2300,7 +2296,8 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
 					obj = (L2Character) target;
 				else
 					continue;
-				if (obj == null || !GeoData.getInstance().canSeeTarget(actor, obj) || obj.isDead() || obj != MostHate || obj == actor)
+				
+				if (!GeoData.getInstance().canSeeTarget(actor, obj) || obj.isDead() || obj != MostHate || obj == actor)
 					continue;
 				if (obj instanceof L2PcInstance)
 				{

+ 1 - 3
L2J_Server_BETA/java/com/l2jserver/gameserver/model/CombatFlag.java

@@ -23,7 +23,6 @@ import com.l2jserver.gameserver.network.serverpackets.InventoryUpdate;
 import com.l2jserver.gameserver.network.serverpackets.ItemList;
 import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
 
-@SuppressWarnings("unused")
 public class CombatFlag
 {
 	// private static final Logger _log = Logger.getLogger(CombatFlag.class.getName());
@@ -34,14 +33,13 @@ public class CombatFlag
 	private L2ItemInstance _itemInstance;
 	private final Location _location;
 	private final int _itemId;
-	private final int _heading;
+	@SuppressWarnings("unused")
 	private final int _fortId;
 	
 	public CombatFlag(int fort_id, int x, int y, int z, int heading, int item_id)
 	{
 		_fortId = fort_id;
 		_location = new Location(x, y, z, heading);
-		_heading = heading;
 		_itemId = item_id;
 	}
 	

+ 0 - 3
L2J_Server_BETA/java/com/l2jserver/gameserver/model/TerritoryWard.java

@@ -40,15 +40,12 @@ public class TerritoryWard
 	private int _itemId;
 	private int _ownerCastleId;
 	
-	@SuppressWarnings("unused")
-	private int _heading;
 	private int _territoryId;
 	
 	public TerritoryWard(int territory_id, int x, int y, int z, int heading, int item_id, int castleId, L2Npc npc)
 	{
 		_territoryId = territory_id;
 		_location = new Location(x,y,z,heading);
-		_heading = heading;
 		_itemId = item_id;
 		_ownerCastleId = castleId;
 		_npc = npc;

+ 3 - 4
L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/instance/L2RaceManagerInstance.java

@@ -42,8 +42,7 @@ public class L2RaceManagerInstance extends L2Npc
 	public static final int LANES = 8;
 	public static final int WINDOW_START = 0;
 	
-	@SuppressWarnings("unused")
-	private static List<Race> _history;
+	// private static List<Race> _history;
 	private static List<L2RaceManagerInstance> _managers;
 	protected static int _raceNumber = 4;
 	
@@ -72,8 +71,8 @@ public class L2RaceManagerInstance extends L2Npc
 		if (_notInitialized)
 		{
 			_notInitialized = false;
-			//*
-			_history = new FastList<>();
+			
+			// _history = new FastList<>();
 			_managers = new FastList<>();
 			
 			ThreadPoolManager s = ThreadPoolManager.getInstance();

+ 0 - 3
L2J_Server_BETA/java/com/l2jserver/gameserver/network/communityserver/writepackets/WorldInfo.java

@@ -15,7 +15,6 @@
 package com.l2jserver.gameserver.network.communityserver.writepackets;
 
 import java.util.List;
-import java.util.logging.Logger;
 
 import javolution.util.FastList;
 
@@ -35,8 +34,6 @@ public final class WorldInfo extends BaseWritePacket
 	public static final byte TYPE_UPDATE_PLAYER_STATUS	= 2;
 	public static final byte TYPE_UPDATE_CLAN_DATA		= 3;
 	public static final byte TYPE_SEND_CLAN_NOTICE		= 4;
-	@SuppressWarnings("unused")
-	private static Logger _log = Logger.getLogger(WorldInfo.class.getName());
 	
 	public WorldInfo(L2PcInstance player, L2Clan clan, final byte type)
 	{

+ 0 - 9
L2J_Server_BETA/java/com/l2jserver/gameserver/network/serverpackets/ItemList.java

@@ -88,15 +88,6 @@ public final class ItemList extends L2GameServerPacket
 		}
 	}
 	
-	@SuppressWarnings("unused")
-	private void showDebug()
-	{
-		for (L2ItemInstance temp : _items)
-		{
-			_log.fine("item:" + temp.getItem().getName() + " type1:" + temp.getItem().getType1() + " type2:" + temp.getItem().getType2());
-		}
-	}
-	
 	@Override
 	protected final void writeImpl()
 	{

+ 3 - 16
L2J_Server_BETA/java/com/l2jserver/tools/configurator/ConfigUserInterface.java

@@ -70,10 +70,7 @@ import com.l2jserver.tools.images.ImagesTable;
  */
 public class ConfigUserInterface extends JFrame implements ActionListener
 {
-	/**
-	 * Comment for <code>serialVersionUID</code>
-	 */
-	private static final long serialVersionUID = 1L;
+	private static final long serialVersionUID = 2609592249095305857L;
 	
 	private final JTabbedPane _tabPane = new JTabbedPane();
 	
@@ -168,10 +165,6 @@ public class ConfigUserInterface extends JFrame implements ActionListener
 		return button;
 	}
 	
-	/**
-	 * 
-	 */
-	@SuppressWarnings("serial")
 	private void buildInterface()
 	{
 		ToolTipManager.sharedInstance().setDismissDelay(Integer.MAX_VALUE);
@@ -186,6 +179,8 @@ public class ConfigUserInterface extends JFrame implements ActionListener
 		{
 			JPanel panel = new JPanel()
 			{
+				private static final long serialVersionUID = -323928678804839054L;
+				
 				@Override
 				public void scrollRectToVisible(Rectangle r)
 				{
@@ -228,9 +223,6 @@ public class ConfigUserInterface extends JFrame implements ActionListener
 		}
 	}
 	
-	/**
-	 * 
-	 */
 	private void loadConfigs()
 	{
 		File configsDir = new File("config");
@@ -246,7 +238,6 @@ public class ConfigUserInterface extends JFrame implements ActionListener
 				{
 					JOptionPane.showMessageDialog(ConfigUserInterface.this, getBundle().getString("errorReading") + file.getName(), getBundle().getString("error"), JOptionPane.ERROR_MESSAGE);
 					System.exit(3);
-					// e.printStackTrace();
 				}
 			}
 		}
@@ -633,7 +624,6 @@ public class ConfigUserInterface extends JFrame implements ActionListener
 				sb.append("\r\n");
 				sb.append("\r\n");
 				writer.write(sb.toString());
-				
 			}
 		}
 	}
@@ -674,9 +664,6 @@ public class ConfigUserInterface extends JFrame implements ActionListener
 		}
 	}
 	
-	/**
-	 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
-	 */
 	@Override
 	public void actionPerformed(ActionEvent e)
 	{

+ 4 - 5
L2J_Server_BETA/java/com/l2jserver/tools/gsregistering/GUserInterface.java

@@ -183,9 +183,6 @@ public class GUserInterface extends BaseGameServerRegister implements ActionList
 		});
 	}
 	
-	/**
-	 * @see com.l2jserver.tools.gsregistering.BaseGameServerRegister#showError(String, Throwable)
-	 */
 	@Override
 	public void showError(String msg, Throwable t)
 	{
@@ -322,7 +319,8 @@ public class GUserInterface extends BaseGameServerRegister implements ActionList
 	}
 	
 	/**
-	 * Forward mouse-events from table to buttons inside. Buttons animate properly.
+	 * Forward mouse-events from table to buttons inside.<br>
+	 * Buttons animate properly.
 	 * @author KenM
 	 */
 	private class JTableButtonMouseListener implements MouseListener
@@ -395,9 +393,10 @@ public class GUserInterface extends BaseGameServerRegister implements ActionList
 		}
 	}
 	
-	@SuppressWarnings("serial")
 	private class JTableModel extends DefaultTableModel
 	{
+		private static final long serialVersionUID = -5907903982876753479L;
+		
 		public JTableModel(Object[] columnNames)
 		{
 			super(columnNames, 0);