Replaced zero equality checks with isEmpty() method.
This commit is contained in:
parent
96a39e7b73
commit
10be587e80
@ -168,7 +168,7 @@ public class AdminFightCalculator implements IAdminCommandHandler
|
||||
|
||||
L2Character npc1 = null;
|
||||
L2Character npc2 = null;
|
||||
if (params.length() == 0)
|
||||
if (params.isEmpty())
|
||||
{
|
||||
npc1 = activeChar;
|
||||
npc2 = (L2Character) activeChar.getTarget();
|
||||
@ -304,7 +304,7 @@ public class AdminFightCalculator implements IAdminCommandHandler
|
||||
final StringBuilder replyMSG = new StringBuilder(1000);
|
||||
replyMSG.append("<html><title>Selected mobs to fight</title><body><table>");
|
||||
|
||||
if (params.length() == 0)
|
||||
if (params.isEmpty())
|
||||
{
|
||||
replyMSG.append("<tr><td width=140>Parameter</td><td width=70>me</td><td width=70>target</td></tr>");
|
||||
}
|
||||
@ -335,7 +335,7 @@ public class AdminFightCalculator implements IAdminCommandHandler
|
||||
|
||||
replyMSG.append("</tr></table><center><br>");
|
||||
|
||||
if (params.length() == 0)
|
||||
if (params.isEmpty())
|
||||
{
|
||||
replyMSG.append("<button value=\"Retry\" action=\"bypass -h admin_fight_calculator_show\" width=100 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\">");
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ public class QuestLink implements IBypassHandler
|
||||
catch (IndexOutOfBoundsException ioobe)
|
||||
{
|
||||
}
|
||||
if (quest.length() == 0)
|
||||
if (quest.isEmpty())
|
||||
{
|
||||
showQuestWindow(activeChar, (L2Npc) target);
|
||||
}
|
||||
|
@ -185,7 +185,7 @@ public class ExtractableItems implements IItemHandler
|
||||
}
|
||||
}
|
||||
|
||||
if (extractedItems.size() == 0)
|
||||
if (extractedItems.isEmpty())
|
||||
{
|
||||
activeChar.sendPacket(SystemMessageId.THERE_WAS_NOTHING_FOUND_INSIDE);
|
||||
}
|
||||
|
@ -368,7 +368,7 @@ public final class PetitionManager
|
||||
|
||||
final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
||||
|
||||
if (_pendingPetitions.size() == 0)
|
||||
if (_pendingPetitions.isEmpty())
|
||||
{
|
||||
htmlContent.append("<tr><td>There are no currently pending petitions.</td></tr>");
|
||||
}
|
||||
|
@ -278,7 +278,7 @@ public class CronParser
|
||||
public static void parseLine(TaskTable table, String line) throws Exception
|
||||
{
|
||||
line = line.trim();
|
||||
if ((line.length() == 0) || (line.charAt(0) == '#'))
|
||||
if ((line.isEmpty()) || (line.charAt(0) == '#'))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -436,7 +436,7 @@ public class CronParser
|
||||
{
|
||||
// Java inner-process.
|
||||
String className = command.substring(5);
|
||||
if (className.length() == 0)
|
||||
if (className.isEmpty())
|
||||
{
|
||||
throw new Exception("Invalid Java class name on line: " + line);
|
||||
}
|
||||
@ -450,7 +450,7 @@ public class CronParser
|
||||
{
|
||||
methodName = className.substring(sep + 1);
|
||||
className = className.substring(0, sep);
|
||||
if (methodName.length() == 0)
|
||||
if (methodName.isEmpty())
|
||||
{
|
||||
throw new Exception("Invalid Java method name on line: " + line);
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ public class ExpressionBuilder
|
||||
*/
|
||||
public ExpressionBuilder(String expression)
|
||||
{
|
||||
if ((expression == null) || (expression.trim().length() == 0))
|
||||
if ((expression == null) || (expression.trim().isEmpty()))
|
||||
{
|
||||
throw new IllegalArgumentException("Expression can not be empty");
|
||||
}
|
||||
@ -190,7 +190,7 @@ public class ExpressionBuilder
|
||||
*/
|
||||
public Expression build()
|
||||
{
|
||||
if (expression.length() == 0)
|
||||
if (expression.isEmpty())
|
||||
{
|
||||
throw new IllegalArgumentException("The expression can not be empty");
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ public class SQLAccountManager
|
||||
|
||||
if (_mode.equals("1") || _mode.equals("2") || _mode.equals("3"))
|
||||
{
|
||||
while (_uname.trim().length() == 0)
|
||||
while (_uname.trim().isEmpty())
|
||||
{
|
||||
System.out.print("Username: ");
|
||||
_uname = _scn.next().toLowerCase();
|
||||
@ -72,7 +72,7 @@ public class SQLAccountManager
|
||||
|
||||
if (_mode.equals("1"))
|
||||
{
|
||||
while (_pass.trim().length() == 0)
|
||||
while (_pass.trim().isEmpty())
|
||||
{
|
||||
System.out.print("Password: ");
|
||||
_pass = _scn.next();
|
||||
@ -81,7 +81,7 @@ public class SQLAccountManager
|
||||
|
||||
if (_mode.equals("1") || _mode.equals("2"))
|
||||
{
|
||||
while (_level.trim().length() == 0)
|
||||
while (_level.trim().isEmpty())
|
||||
{
|
||||
System.out.print("Access level: ");
|
||||
_level = _scn.next();
|
||||
|
@ -39,7 +39,7 @@ public class GameServerRegister extends BaseGameServerRegister
|
||||
{
|
||||
load();
|
||||
|
||||
if (GameServerTable.getInstance().getServerNames().size() == 0)
|
||||
if (GameServerTable.getInstance().getServerNames().isEmpty())
|
||||
{
|
||||
System.out.println("No available names for GameServer, verify servername.xml file exists in the LoginServer folder.");
|
||||
System.exit(1);
|
||||
|
@ -168,7 +168,7 @@ public class AdminFightCalculator implements IAdminCommandHandler
|
||||
|
||||
L2Character npc1 = null;
|
||||
L2Character npc2 = null;
|
||||
if (params.length() == 0)
|
||||
if (params.isEmpty())
|
||||
{
|
||||
npc1 = activeChar;
|
||||
npc2 = (L2Character) activeChar.getTarget();
|
||||
@ -304,7 +304,7 @@ public class AdminFightCalculator implements IAdminCommandHandler
|
||||
final StringBuilder replyMSG = new StringBuilder(1000);
|
||||
replyMSG.append("<html><title>Selected mobs to fight</title><body><table>");
|
||||
|
||||
if (params.length() == 0)
|
||||
if (params.isEmpty())
|
||||
{
|
||||
replyMSG.append("<tr><td width=140>Parameter</td><td width=70>me</td><td width=70>target</td></tr>");
|
||||
}
|
||||
@ -335,7 +335,7 @@ public class AdminFightCalculator implements IAdminCommandHandler
|
||||
|
||||
replyMSG.append("</tr></table><center><br>");
|
||||
|
||||
if (params.length() == 0)
|
||||
if (params.isEmpty())
|
||||
{
|
||||
replyMSG.append("<button value=\"Retry\" action=\"bypass -h admin_fight_calculator_show\" width=100 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\">");
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ public class QuestLink implements IBypassHandler
|
||||
catch (IndexOutOfBoundsException ioobe)
|
||||
{
|
||||
}
|
||||
if (quest.length() == 0)
|
||||
if (quest.isEmpty())
|
||||
{
|
||||
showQuestWindow(activeChar, (L2Npc) target);
|
||||
}
|
||||
|
@ -185,7 +185,7 @@ public class ExtractableItems implements IItemHandler
|
||||
}
|
||||
}
|
||||
|
||||
if (extractedItems.size() == 0)
|
||||
if (extractedItems.isEmpty())
|
||||
{
|
||||
activeChar.sendPacket(SystemMessageId.THERE_WAS_NOTHING_FOUND_INSIDE);
|
||||
}
|
||||
|
@ -368,7 +368,7 @@ public final class PetitionManager
|
||||
|
||||
final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
||||
|
||||
if (_pendingPetitions.size() == 0)
|
||||
if (_pendingPetitions.isEmpty())
|
||||
{
|
||||
htmlContent.append("<tr><td>There are no currently pending petitions.</td></tr>");
|
||||
}
|
||||
|
@ -278,7 +278,7 @@ public class CronParser
|
||||
public static void parseLine(TaskTable table, String line) throws Exception
|
||||
{
|
||||
line = line.trim();
|
||||
if ((line.length() == 0) || (line.charAt(0) == '#'))
|
||||
if ((line.isEmpty()) || (line.charAt(0) == '#'))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -436,7 +436,7 @@ public class CronParser
|
||||
{
|
||||
// Java inner-process.
|
||||
String className = command.substring(5);
|
||||
if (className.length() == 0)
|
||||
if (className.isEmpty())
|
||||
{
|
||||
throw new Exception("Invalid Java class name on line: " + line);
|
||||
}
|
||||
@ -450,7 +450,7 @@ public class CronParser
|
||||
{
|
||||
methodName = className.substring(sep + 1);
|
||||
className = className.substring(0, sep);
|
||||
if (methodName.length() == 0)
|
||||
if (methodName.isEmpty())
|
||||
{
|
||||
throw new Exception("Invalid Java method name on line: " + line);
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ public class ExpressionBuilder
|
||||
*/
|
||||
public ExpressionBuilder(String expression)
|
||||
{
|
||||
if ((expression == null) || (expression.trim().length() == 0))
|
||||
if ((expression == null) || (expression.trim().isEmpty()))
|
||||
{
|
||||
throw new IllegalArgumentException("Expression can not be empty");
|
||||
}
|
||||
@ -190,7 +190,7 @@ public class ExpressionBuilder
|
||||
*/
|
||||
public Expression build()
|
||||
{
|
||||
if (expression.length() == 0)
|
||||
if (expression.isEmpty())
|
||||
{
|
||||
throw new IllegalArgumentException("The expression can not be empty");
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ public class SQLAccountManager
|
||||
|
||||
if (_mode.equals("1") || _mode.equals("2") || _mode.equals("3"))
|
||||
{
|
||||
while (_uname.trim().length() == 0)
|
||||
while (_uname.trim().isEmpty())
|
||||
{
|
||||
System.out.print("Username: ");
|
||||
_uname = _scn.next().toLowerCase();
|
||||
@ -72,7 +72,7 @@ public class SQLAccountManager
|
||||
|
||||
if (_mode.equals("1"))
|
||||
{
|
||||
while (_pass.trim().length() == 0)
|
||||
while (_pass.trim().isEmpty())
|
||||
{
|
||||
System.out.print("Password: ");
|
||||
_pass = _scn.next();
|
||||
@ -81,7 +81,7 @@ public class SQLAccountManager
|
||||
|
||||
if (_mode.equals("1") || _mode.equals("2"))
|
||||
{
|
||||
while (_level.trim().length() == 0)
|
||||
while (_level.trim().isEmpty())
|
||||
{
|
||||
System.out.print("Access level: ");
|
||||
_level = _scn.next();
|
||||
|
@ -39,7 +39,7 @@ public class GameServerRegister extends BaseGameServerRegister
|
||||
{
|
||||
load();
|
||||
|
||||
if (GameServerTable.getInstance().getServerNames().size() == 0)
|
||||
if (GameServerTable.getInstance().getServerNames().isEmpty())
|
||||
{
|
||||
System.out.println("No available names for GameServer, verify servername.xml file exists in the LoginServer folder.");
|
||||
System.exit(1);
|
||||
|
@ -168,7 +168,7 @@ public class AdminFightCalculator implements IAdminCommandHandler
|
||||
|
||||
L2Character npc1 = null;
|
||||
L2Character npc2 = null;
|
||||
if (params.length() == 0)
|
||||
if (params.isEmpty())
|
||||
{
|
||||
npc1 = activeChar;
|
||||
npc2 = (L2Character) activeChar.getTarget();
|
||||
@ -304,7 +304,7 @@ public class AdminFightCalculator implements IAdminCommandHandler
|
||||
final StringBuilder replyMSG = new StringBuilder(1000);
|
||||
replyMSG.append("<html><title>Selected mobs to fight</title><body><table>");
|
||||
|
||||
if (params.length() == 0)
|
||||
if (params.isEmpty())
|
||||
{
|
||||
replyMSG.append("<tr><td width=140>Parameter</td><td width=70>me</td><td width=70>target</td></tr>");
|
||||
}
|
||||
@ -335,7 +335,7 @@ public class AdminFightCalculator implements IAdminCommandHandler
|
||||
|
||||
replyMSG.append("</tr></table><center><br>");
|
||||
|
||||
if (params.length() == 0)
|
||||
if (params.isEmpty())
|
||||
{
|
||||
replyMSG.append("<button value=\"Retry\" action=\"bypass -h admin_fight_calculator_show\" width=100 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\">");
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ public class QuestLink implements IBypassHandler
|
||||
catch (IndexOutOfBoundsException ioobe)
|
||||
{
|
||||
}
|
||||
if (quest.length() == 0)
|
||||
if (quest.isEmpty())
|
||||
{
|
||||
showQuestWindow(activeChar, (L2Npc) target);
|
||||
}
|
||||
|
@ -185,7 +185,7 @@ public class ExtractableItems implements IItemHandler
|
||||
}
|
||||
}
|
||||
|
||||
if (extractedItems.size() == 0)
|
||||
if (extractedItems.isEmpty())
|
||||
{
|
||||
activeChar.sendPacket(SystemMessageId.THERE_WAS_NOTHING_FOUND_INSIDE);
|
||||
}
|
||||
|
@ -368,7 +368,7 @@ public final class PetitionManager
|
||||
|
||||
final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
||||
|
||||
if (_pendingPetitions.size() == 0)
|
||||
if (_pendingPetitions.isEmpty())
|
||||
{
|
||||
htmlContent.append("<tr><td>There are no currently pending petitions.</td></tr>");
|
||||
}
|
||||
|
@ -278,7 +278,7 @@ public class CronParser
|
||||
public static void parseLine(TaskTable table, String line) throws Exception
|
||||
{
|
||||
line = line.trim();
|
||||
if ((line.length() == 0) || (line.charAt(0) == '#'))
|
||||
if ((line.isEmpty()) || (line.charAt(0) == '#'))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -436,7 +436,7 @@ public class CronParser
|
||||
{
|
||||
// Java inner-process.
|
||||
String className = command.substring(5);
|
||||
if (className.length() == 0)
|
||||
if (className.isEmpty())
|
||||
{
|
||||
throw new Exception("Invalid Java class name on line: " + line);
|
||||
}
|
||||
@ -450,7 +450,7 @@ public class CronParser
|
||||
{
|
||||
methodName = className.substring(sep + 1);
|
||||
className = className.substring(0, sep);
|
||||
if (methodName.length() == 0)
|
||||
if (methodName.isEmpty())
|
||||
{
|
||||
throw new Exception("Invalid Java method name on line: " + line);
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ public class ExpressionBuilder
|
||||
*/
|
||||
public ExpressionBuilder(String expression)
|
||||
{
|
||||
if ((expression == null) || (expression.trim().length() == 0))
|
||||
if ((expression == null) || (expression.trim().isEmpty()))
|
||||
{
|
||||
throw new IllegalArgumentException("Expression can not be empty");
|
||||
}
|
||||
@ -190,7 +190,7 @@ public class ExpressionBuilder
|
||||
*/
|
||||
public Expression build()
|
||||
{
|
||||
if (expression.length() == 0)
|
||||
if (expression.isEmpty())
|
||||
{
|
||||
throw new IllegalArgumentException("The expression can not be empty");
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ public class SQLAccountManager
|
||||
|
||||
if (_mode.equals("1") || _mode.equals("2") || _mode.equals("3"))
|
||||
{
|
||||
while (_uname.trim().length() == 0)
|
||||
while (_uname.trim().isEmpty())
|
||||
{
|
||||
System.out.print("Username: ");
|
||||
_uname = _scn.next().toLowerCase();
|
||||
@ -72,7 +72,7 @@ public class SQLAccountManager
|
||||
|
||||
if (_mode.equals("1"))
|
||||
{
|
||||
while (_pass.trim().length() == 0)
|
||||
while (_pass.trim().isEmpty())
|
||||
{
|
||||
System.out.print("Password: ");
|
||||
_pass = _scn.next();
|
||||
@ -81,7 +81,7 @@ public class SQLAccountManager
|
||||
|
||||
if (_mode.equals("1") || _mode.equals("2"))
|
||||
{
|
||||
while (_level.trim().length() == 0)
|
||||
while (_level.trim().isEmpty())
|
||||
{
|
||||
System.out.print("Access level: ");
|
||||
_level = _scn.next();
|
||||
|
@ -39,7 +39,7 @@ public class GameServerRegister extends BaseGameServerRegister
|
||||
{
|
||||
load();
|
||||
|
||||
if (GameServerTable.getInstance().getServerNames().size() == 0)
|
||||
if (GameServerTable.getInstance().getServerNames().isEmpty())
|
||||
{
|
||||
System.out.println("No available names for GameServer, verify servername.xml file exists in the LoginServer folder.");
|
||||
System.exit(1);
|
||||
|
@ -168,7 +168,7 @@ public class AdminFightCalculator implements IAdminCommandHandler
|
||||
|
||||
L2Character npc1 = null;
|
||||
L2Character npc2 = null;
|
||||
if (params.length() == 0)
|
||||
if (params.isEmpty())
|
||||
{
|
||||
npc1 = activeChar;
|
||||
npc2 = (L2Character) activeChar.getTarget();
|
||||
@ -304,7 +304,7 @@ public class AdminFightCalculator implements IAdminCommandHandler
|
||||
final StringBuilder replyMSG = new StringBuilder(1000);
|
||||
replyMSG.append("<html><title>Selected mobs to fight</title><body><table>");
|
||||
|
||||
if (params.length() == 0)
|
||||
if (params.isEmpty())
|
||||
{
|
||||
replyMSG.append("<tr><td width=140>Parameter</td><td width=70>me</td><td width=70>target</td></tr>");
|
||||
}
|
||||
@ -335,7 +335,7 @@ public class AdminFightCalculator implements IAdminCommandHandler
|
||||
|
||||
replyMSG.append("</tr></table><center><br>");
|
||||
|
||||
if (params.length() == 0)
|
||||
if (params.isEmpty())
|
||||
{
|
||||
replyMSG.append("<button value=\"Retry\" action=\"bypass -h admin_fight_calculator_show\" width=100 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\">");
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ public class QuestLink implements IBypassHandler
|
||||
catch (IndexOutOfBoundsException ioobe)
|
||||
{
|
||||
}
|
||||
if (quest.length() == 0)
|
||||
if (quest.isEmpty())
|
||||
{
|
||||
showQuestWindow(activeChar, (L2Npc) target);
|
||||
}
|
||||
|
@ -185,7 +185,7 @@ public class ExtractableItems implements IItemHandler
|
||||
}
|
||||
}
|
||||
|
||||
if (extractedItems.size() == 0)
|
||||
if (extractedItems.isEmpty())
|
||||
{
|
||||
activeChar.sendPacket(SystemMessageId.THERE_WAS_NOTHING_FOUND_INSIDE);
|
||||
}
|
||||
|
@ -368,7 +368,7 @@ public final class PetitionManager
|
||||
|
||||
final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
||||
|
||||
if (_pendingPetitions.size() == 0)
|
||||
if (_pendingPetitions.isEmpty())
|
||||
{
|
||||
htmlContent.append("<tr><td>There are no currently pending petitions.</td></tr>");
|
||||
}
|
||||
|
@ -278,7 +278,7 @@ public class CronParser
|
||||
public static void parseLine(TaskTable table, String line) throws Exception
|
||||
{
|
||||
line = line.trim();
|
||||
if ((line.length() == 0) || (line.charAt(0) == '#'))
|
||||
if ((line.isEmpty()) || (line.charAt(0) == '#'))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -436,7 +436,7 @@ public class CronParser
|
||||
{
|
||||
// Java inner-process.
|
||||
String className = command.substring(5);
|
||||
if (className.length() == 0)
|
||||
if (className.isEmpty())
|
||||
{
|
||||
throw new Exception("Invalid Java class name on line: " + line);
|
||||
}
|
||||
@ -450,7 +450,7 @@ public class CronParser
|
||||
{
|
||||
methodName = className.substring(sep + 1);
|
||||
className = className.substring(0, sep);
|
||||
if (methodName.length() == 0)
|
||||
if (methodName.isEmpty())
|
||||
{
|
||||
throw new Exception("Invalid Java method name on line: " + line);
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ public class ExpressionBuilder
|
||||
*/
|
||||
public ExpressionBuilder(String expression)
|
||||
{
|
||||
if ((expression == null) || (expression.trim().length() == 0))
|
||||
if ((expression == null) || (expression.trim().isEmpty()))
|
||||
{
|
||||
throw new IllegalArgumentException("Expression can not be empty");
|
||||
}
|
||||
@ -190,7 +190,7 @@ public class ExpressionBuilder
|
||||
*/
|
||||
public Expression build()
|
||||
{
|
||||
if (expression.length() == 0)
|
||||
if (expression.isEmpty())
|
||||
{
|
||||
throw new IllegalArgumentException("The expression can not be empty");
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ public class SQLAccountManager
|
||||
|
||||
if (_mode.equals("1") || _mode.equals("2") || _mode.equals("3"))
|
||||
{
|
||||
while (_uname.trim().length() == 0)
|
||||
while (_uname.trim().isEmpty())
|
||||
{
|
||||
System.out.print("Username: ");
|
||||
_uname = _scn.next().toLowerCase();
|
||||
@ -72,7 +72,7 @@ public class SQLAccountManager
|
||||
|
||||
if (_mode.equals("1"))
|
||||
{
|
||||
while (_pass.trim().length() == 0)
|
||||
while (_pass.trim().isEmpty())
|
||||
{
|
||||
System.out.print("Password: ");
|
||||
_pass = _scn.next();
|
||||
@ -81,7 +81,7 @@ public class SQLAccountManager
|
||||
|
||||
if (_mode.equals("1") || _mode.equals("2"))
|
||||
{
|
||||
while (_level.trim().length() == 0)
|
||||
while (_level.trim().isEmpty())
|
||||
{
|
||||
System.out.print("Access level: ");
|
||||
_level = _scn.next();
|
||||
|
@ -39,7 +39,7 @@ public class GameServerRegister extends BaseGameServerRegister
|
||||
{
|
||||
load();
|
||||
|
||||
if (GameServerTable.getInstance().getServerNames().size() == 0)
|
||||
if (GameServerTable.getInstance().getServerNames().isEmpty())
|
||||
{
|
||||
System.out.println("No available names for GameServer, verify servername.xml file exists in the LoginServer folder.");
|
||||
System.exit(1);
|
||||
|
@ -40,7 +40,7 @@ public class GameServerRegister extends BaseGameServerRegister
|
||||
super();
|
||||
load();
|
||||
|
||||
if (GameServerTable.getInstance().getServerNames().size() == 0)
|
||||
if (GameServerTable.getInstance().getServerNames().isEmpty())
|
||||
{
|
||||
System.out.println("No available names for GameServer, verify servername.xml file exists in the LoginServer folder.");
|
||||
System.exit(1);
|
||||
|
@ -169,7 +169,7 @@ public class AvantGarde extends AbstractNpcAI
|
||||
}
|
||||
case "CancelCertification":
|
||||
{
|
||||
if (player.getSubClasses().size() == 0)
|
||||
if (player.getSubClasses().isEmpty())
|
||||
{
|
||||
htmltext = "32323-07.html";
|
||||
}
|
||||
|
@ -167,7 +167,7 @@ public class AdminFightCalculator implements IAdminCommandHandler
|
||||
|
||||
L2Character npc1 = null;
|
||||
L2Character npc2 = null;
|
||||
if (params.length() == 0)
|
||||
if (params.isEmpty())
|
||||
{
|
||||
npc1 = activeChar;
|
||||
npc2 = (L2Character) activeChar.getTarget();
|
||||
@ -303,7 +303,7 @@ public class AdminFightCalculator implements IAdminCommandHandler
|
||||
final StringBuilder replyMSG = new StringBuilder(1000);
|
||||
replyMSG.append("<html><title>Selected mobs to fight</title><body><table>");
|
||||
|
||||
if (params.length() == 0)
|
||||
if (params.isEmpty())
|
||||
{
|
||||
replyMSG.append("<tr><td width=140>Parameter</td><td width=70>me</td><td width=70>target</td></tr>");
|
||||
}
|
||||
@ -334,7 +334,7 @@ public class AdminFightCalculator implements IAdminCommandHandler
|
||||
|
||||
replyMSG.append("</tr></table><center><br>");
|
||||
|
||||
if (params.length() == 0)
|
||||
if (params.isEmpty())
|
||||
{
|
||||
replyMSG.append("<button value=\"Retry\" action=\"bypass -h admin_fight_calculator_show\" width=100 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\">");
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ public class QuestLink implements IBypassHandler
|
||||
catch (IndexOutOfBoundsException ioobe)
|
||||
{
|
||||
}
|
||||
if (quest.length() == 0)
|
||||
if (quest.isEmpty())
|
||||
{
|
||||
showQuestWindow(activeChar, (L2Npc) target);
|
||||
}
|
||||
|
@ -356,7 +356,7 @@ public final class PetitionManager
|
||||
|
||||
final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
||||
|
||||
if (_pendingPetitions.size() == 0)
|
||||
if (_pendingPetitions.isEmpty())
|
||||
{
|
||||
htmlContent.append("<tr><td>There are no currently pending petitions.</td></tr>");
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ public class SQLAccountManager
|
||||
|
||||
if (_mode.equals("1") || _mode.equals("2") || _mode.equals("3"))
|
||||
{
|
||||
while (_uname.trim().length() == 0)
|
||||
while (_uname.trim().isEmpty())
|
||||
{
|
||||
System.out.print("Username: ");
|
||||
_uname = _scn.next().toLowerCase();
|
||||
@ -72,7 +72,7 @@ public class SQLAccountManager
|
||||
|
||||
if (_mode.equals("1"))
|
||||
{
|
||||
while (_pass.trim().length() == 0)
|
||||
while (_pass.trim().isEmpty())
|
||||
{
|
||||
System.out.print("Password: ");
|
||||
_pass = _scn.next();
|
||||
@ -81,7 +81,7 @@ public class SQLAccountManager
|
||||
|
||||
if (_mode.equals("1") || _mode.equals("2"))
|
||||
{
|
||||
while (_level.trim().length() == 0)
|
||||
while (_level.trim().isEmpty())
|
||||
{
|
||||
System.out.print("Access level: ");
|
||||
_level = _scn.next();
|
||||
|
@ -40,7 +40,7 @@ public class GameServerRegister extends BaseGameServerRegister
|
||||
super();
|
||||
load();
|
||||
|
||||
if (GameServerTable.getInstance().getServerNames().size() == 0)
|
||||
if (GameServerTable.getInstance().getServerNames().isEmpty())
|
||||
{
|
||||
System.out.println("No available names for GameServer, verify servername.xml file exists in the LoginServer folder.");
|
||||
System.exit(1);
|
||||
|
@ -168,7 +168,7 @@ public class AdminFightCalculator implements IAdminCommandHandler
|
||||
|
||||
L2Character npc1 = null;
|
||||
L2Character npc2 = null;
|
||||
if (params.length() == 0)
|
||||
if (params.isEmpty())
|
||||
{
|
||||
npc1 = activeChar;
|
||||
npc2 = (L2Character) activeChar.getTarget();
|
||||
@ -304,7 +304,7 @@ public class AdminFightCalculator implements IAdminCommandHandler
|
||||
final StringBuilder replyMSG = new StringBuilder(1000);
|
||||
replyMSG.append("<html><title>Selected mobs to fight</title><body><table>");
|
||||
|
||||
if (params.length() == 0)
|
||||
if (params.isEmpty())
|
||||
{
|
||||
replyMSG.append("<tr><td width=140>Parameter</td><td width=70>me</td><td width=70>target</td></tr>");
|
||||
}
|
||||
@ -335,7 +335,7 @@ public class AdminFightCalculator implements IAdminCommandHandler
|
||||
|
||||
replyMSG.append("</tr></table><center><br>");
|
||||
|
||||
if (params.length() == 0)
|
||||
if (params.isEmpty())
|
||||
{
|
||||
replyMSG.append("<button value=\"Retry\" action=\"bypass -h admin_fight_calculator_show\" width=100 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\">");
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ public class QuestLink implements IBypassHandler
|
||||
catch (IndexOutOfBoundsException ioobe)
|
||||
{
|
||||
}
|
||||
if (quest.length() == 0)
|
||||
if (quest.isEmpty())
|
||||
{
|
||||
showQuestWindow(activeChar, (L2Npc) target);
|
||||
}
|
||||
|
@ -185,7 +185,7 @@ public class ExtractableItems implements IItemHandler
|
||||
}
|
||||
}
|
||||
|
||||
if (extractedItems.size() == 0)
|
||||
if (extractedItems.isEmpty())
|
||||
{
|
||||
activeChar.sendPacket(SystemMessageId.THERE_WAS_NOTHING_FOUND_INSIDE);
|
||||
}
|
||||
|
@ -368,7 +368,7 @@ public final class PetitionManager
|
||||
|
||||
final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
||||
|
||||
if (_pendingPetitions.size() == 0)
|
||||
if (_pendingPetitions.isEmpty())
|
||||
{
|
||||
htmlContent.append("<tr><td>There are no currently pending petitions.</td></tr>");
|
||||
}
|
||||
|
@ -278,7 +278,7 @@ public class CronParser
|
||||
public static void parseLine(TaskTable table, String line) throws Exception
|
||||
{
|
||||
line = line.trim();
|
||||
if ((line.length() == 0) || (line.charAt(0) == '#'))
|
||||
if ((line.isEmpty()) || (line.charAt(0) == '#'))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -436,7 +436,7 @@ public class CronParser
|
||||
{
|
||||
// Java inner-process.
|
||||
String className = command.substring(5);
|
||||
if (className.length() == 0)
|
||||
if (className.isEmpty())
|
||||
{
|
||||
throw new Exception("Invalid Java class name on line: " + line);
|
||||
}
|
||||
@ -450,7 +450,7 @@ public class CronParser
|
||||
{
|
||||
methodName = className.substring(sep + 1);
|
||||
className = className.substring(0, sep);
|
||||
if (methodName.length() == 0)
|
||||
if (methodName.isEmpty())
|
||||
{
|
||||
throw new Exception("Invalid Java method name on line: " + line);
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ public class ExpressionBuilder
|
||||
*/
|
||||
public ExpressionBuilder(String expression)
|
||||
{
|
||||
if ((expression == null) || (expression.trim().length() == 0))
|
||||
if ((expression == null) || (expression.trim().isEmpty()))
|
||||
{
|
||||
throw new IllegalArgumentException("Expression can not be empty");
|
||||
}
|
||||
@ -190,7 +190,7 @@ public class ExpressionBuilder
|
||||
*/
|
||||
public Expression build()
|
||||
{
|
||||
if (expression.length() == 0)
|
||||
if (expression.isEmpty())
|
||||
{
|
||||
throw new IllegalArgumentException("The expression can not be empty");
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ public class SQLAccountManager
|
||||
|
||||
if (_mode.equals("1") || _mode.equals("2") || _mode.equals("3"))
|
||||
{
|
||||
while (_uname.trim().length() == 0)
|
||||
while (_uname.trim().isEmpty())
|
||||
{
|
||||
System.out.print("Username: ");
|
||||
_uname = _scn.next().toLowerCase();
|
||||
@ -72,7 +72,7 @@ public class SQLAccountManager
|
||||
|
||||
if (_mode.equals("1"))
|
||||
{
|
||||
while (_pass.trim().length() == 0)
|
||||
while (_pass.trim().isEmpty())
|
||||
{
|
||||
System.out.print("Password: ");
|
||||
_pass = _scn.next();
|
||||
@ -81,7 +81,7 @@ public class SQLAccountManager
|
||||
|
||||
if (_mode.equals("1") || _mode.equals("2"))
|
||||
{
|
||||
while (_level.trim().length() == 0)
|
||||
while (_level.trim().isEmpty())
|
||||
{
|
||||
System.out.print("Access level: ");
|
||||
_level = _scn.next();
|
||||
|
@ -39,7 +39,7 @@ public class GameServerRegister extends BaseGameServerRegister
|
||||
{
|
||||
load();
|
||||
|
||||
if (GameServerTable.getInstance().getServerNames().size() == 0)
|
||||
if (GameServerTable.getInstance().getServerNames().isEmpty())
|
||||
{
|
||||
System.out.println("No available names for GameServer, verify servername.xml file exists in the LoginServer folder.");
|
||||
System.exit(1);
|
||||
|
@ -168,7 +168,7 @@ public class AdminFightCalculator implements IAdminCommandHandler
|
||||
|
||||
L2Character npc1 = null;
|
||||
L2Character npc2 = null;
|
||||
if (params.length() == 0)
|
||||
if (params.isEmpty())
|
||||
{
|
||||
npc1 = activeChar;
|
||||
npc2 = (L2Character) activeChar.getTarget();
|
||||
@ -304,7 +304,7 @@ public class AdminFightCalculator implements IAdminCommandHandler
|
||||
final StringBuilder replyMSG = new StringBuilder(1000);
|
||||
replyMSG.append("<html><title>Selected mobs to fight</title><body><table>");
|
||||
|
||||
if (params.length() == 0)
|
||||
if (params.isEmpty())
|
||||
{
|
||||
replyMSG.append("<tr><td width=140>Parameter</td><td width=70>me</td><td width=70>target</td></tr>");
|
||||
}
|
||||
@ -335,7 +335,7 @@ public class AdminFightCalculator implements IAdminCommandHandler
|
||||
|
||||
replyMSG.append("</tr></table><center><br>");
|
||||
|
||||
if (params.length() == 0)
|
||||
if (params.isEmpty())
|
||||
{
|
||||
replyMSG.append("<button value=\"Retry\" action=\"bypass -h admin_fight_calculator_show\" width=100 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\">");
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ public class QuestLink implements IBypassHandler
|
||||
catch (IndexOutOfBoundsException ioobe)
|
||||
{
|
||||
}
|
||||
if (quest.length() == 0)
|
||||
if (quest.isEmpty())
|
||||
{
|
||||
showQuestWindow(activeChar, (L2Npc) target);
|
||||
}
|
||||
|
@ -185,7 +185,7 @@ public class ExtractableItems implements IItemHandler
|
||||
}
|
||||
}
|
||||
|
||||
if (extractedItems.size() == 0)
|
||||
if (extractedItems.isEmpty())
|
||||
{
|
||||
activeChar.sendPacket(SystemMessageId.THERE_WAS_NOTHING_FOUND_INSIDE);
|
||||
}
|
||||
|
@ -368,7 +368,7 @@ public final class PetitionManager
|
||||
|
||||
final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
||||
|
||||
if (_pendingPetitions.size() == 0)
|
||||
if (_pendingPetitions.isEmpty())
|
||||
{
|
||||
htmlContent.append("<tr><td>There are no currently pending petitions.</td></tr>");
|
||||
}
|
||||
|
@ -278,7 +278,7 @@ public class CronParser
|
||||
public static void parseLine(TaskTable table, String line) throws Exception
|
||||
{
|
||||
line = line.trim();
|
||||
if ((line.length() == 0) || (line.charAt(0) == '#'))
|
||||
if ((line.isEmpty()) || (line.charAt(0) == '#'))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -436,7 +436,7 @@ public class CronParser
|
||||
{
|
||||
// Java inner-process.
|
||||
String className = command.substring(5);
|
||||
if (className.length() == 0)
|
||||
if (className.isEmpty())
|
||||
{
|
||||
throw new Exception("Invalid Java class name on line: " + line);
|
||||
}
|
||||
@ -450,7 +450,7 @@ public class CronParser
|
||||
{
|
||||
methodName = className.substring(sep + 1);
|
||||
className = className.substring(0, sep);
|
||||
if (methodName.length() == 0)
|
||||
if (methodName.isEmpty())
|
||||
{
|
||||
throw new Exception("Invalid Java method name on line: " + line);
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ public class ExpressionBuilder
|
||||
*/
|
||||
public ExpressionBuilder(String expression)
|
||||
{
|
||||
if ((expression == null) || (expression.trim().length() == 0))
|
||||
if ((expression == null) || (expression.trim().isEmpty()))
|
||||
{
|
||||
throw new IllegalArgumentException("Expression can not be empty");
|
||||
}
|
||||
@ -190,7 +190,7 @@ public class ExpressionBuilder
|
||||
*/
|
||||
public Expression build()
|
||||
{
|
||||
if (expression.length() == 0)
|
||||
if (expression.isEmpty())
|
||||
{
|
||||
throw new IllegalArgumentException("The expression can not be empty");
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ public class SQLAccountManager
|
||||
|
||||
if (_mode.equals("1") || _mode.equals("2") || _mode.equals("3"))
|
||||
{
|
||||
while (_uname.trim().length() == 0)
|
||||
while (_uname.trim().isEmpty())
|
||||
{
|
||||
System.out.print("Username: ");
|
||||
_uname = _scn.next().toLowerCase();
|
||||
@ -72,7 +72,7 @@ public class SQLAccountManager
|
||||
|
||||
if (_mode.equals("1"))
|
||||
{
|
||||
while (_pass.trim().length() == 0)
|
||||
while (_pass.trim().isEmpty())
|
||||
{
|
||||
System.out.print("Password: ");
|
||||
_pass = _scn.next();
|
||||
@ -81,7 +81,7 @@ public class SQLAccountManager
|
||||
|
||||
if (_mode.equals("1") || _mode.equals("2"))
|
||||
{
|
||||
while (_level.trim().length() == 0)
|
||||
while (_level.trim().isEmpty())
|
||||
{
|
||||
System.out.print("Access level: ");
|
||||
_level = _scn.next();
|
||||
|
@ -39,7 +39,7 @@ public class GameServerRegister extends BaseGameServerRegister
|
||||
{
|
||||
load();
|
||||
|
||||
if (GameServerTable.getInstance().getServerNames().size() == 0)
|
||||
if (GameServerTable.getInstance().getServerNames().isEmpty())
|
||||
{
|
||||
System.out.println("No available names for GameServer, verify servername.xml file exists in the LoginServer folder.");
|
||||
System.exit(1);
|
||||
|
@ -168,7 +168,7 @@ public class AdminFightCalculator implements IAdminCommandHandler
|
||||
|
||||
L2Character npc1 = null;
|
||||
L2Character npc2 = null;
|
||||
if (params.length() == 0)
|
||||
if (params.isEmpty())
|
||||
{
|
||||
npc1 = activeChar;
|
||||
npc2 = (L2Character) activeChar.getTarget();
|
||||
@ -304,7 +304,7 @@ public class AdminFightCalculator implements IAdminCommandHandler
|
||||
final StringBuilder replyMSG = new StringBuilder(1000);
|
||||
replyMSG.append("<html><title>Selected mobs to fight</title><body><table>");
|
||||
|
||||
if (params.length() == 0)
|
||||
if (params.isEmpty())
|
||||
{
|
||||
replyMSG.append("<tr><td width=140>Parameter</td><td width=70>me</td><td width=70>target</td></tr>");
|
||||
}
|
||||
@ -335,7 +335,7 @@ public class AdminFightCalculator implements IAdminCommandHandler
|
||||
|
||||
replyMSG.append("</tr></table><center><br>");
|
||||
|
||||
if (params.length() == 0)
|
||||
if (params.isEmpty())
|
||||
{
|
||||
replyMSG.append("<button value=\"Retry\" action=\"bypass -h admin_fight_calculator_show\" width=100 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\">");
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ public class QuestLink implements IBypassHandler
|
||||
catch (IndexOutOfBoundsException ioobe)
|
||||
{
|
||||
}
|
||||
if (quest.length() == 0)
|
||||
if (quest.isEmpty())
|
||||
{
|
||||
showQuestWindow(activeChar, (L2Npc) target);
|
||||
}
|
||||
|
@ -185,7 +185,7 @@ public class ExtractableItems implements IItemHandler
|
||||
}
|
||||
}
|
||||
|
||||
if (extractedItems.size() == 0)
|
||||
if (extractedItems.isEmpty())
|
||||
{
|
||||
activeChar.sendPacket(SystemMessageId.THERE_WAS_NOTHING_FOUND_INSIDE);
|
||||
}
|
||||
|
@ -368,7 +368,7 @@ public final class PetitionManager
|
||||
|
||||
final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
||||
|
||||
if (_pendingPetitions.size() == 0)
|
||||
if (_pendingPetitions.isEmpty())
|
||||
{
|
||||
htmlContent.append("<tr><td>There are no currently pending petitions.</td></tr>");
|
||||
}
|
||||
|
@ -278,7 +278,7 @@ public class CronParser
|
||||
public static void parseLine(TaskTable table, String line) throws Exception
|
||||
{
|
||||
line = line.trim();
|
||||
if ((line.length() == 0) || (line.charAt(0) == '#'))
|
||||
if ((line.isEmpty()) || (line.charAt(0) == '#'))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -436,7 +436,7 @@ public class CronParser
|
||||
{
|
||||
// Java inner-process.
|
||||
String className = command.substring(5);
|
||||
if (className.length() == 0)
|
||||
if (className.isEmpty())
|
||||
{
|
||||
throw new Exception("Invalid Java class name on line: " + line);
|
||||
}
|
||||
@ -450,7 +450,7 @@ public class CronParser
|
||||
{
|
||||
methodName = className.substring(sep + 1);
|
||||
className = className.substring(0, sep);
|
||||
if (methodName.length() == 0)
|
||||
if (methodName.isEmpty())
|
||||
{
|
||||
throw new Exception("Invalid Java method name on line: " + line);
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ public class ExpressionBuilder
|
||||
*/
|
||||
public ExpressionBuilder(String expression)
|
||||
{
|
||||
if ((expression == null) || (expression.trim().length() == 0))
|
||||
if ((expression == null) || (expression.trim().isEmpty()))
|
||||
{
|
||||
throw new IllegalArgumentException("Expression can not be empty");
|
||||
}
|
||||
@ -190,7 +190,7 @@ public class ExpressionBuilder
|
||||
*/
|
||||
public Expression build()
|
||||
{
|
||||
if (expression.length() == 0)
|
||||
if (expression.isEmpty())
|
||||
{
|
||||
throw new IllegalArgumentException("The expression can not be empty");
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ public class SQLAccountManager
|
||||
|
||||
if (_mode.equals("1") || _mode.equals("2") || _mode.equals("3"))
|
||||
{
|
||||
while (_uname.trim().length() == 0)
|
||||
while (_uname.trim().isEmpty())
|
||||
{
|
||||
System.out.print("Username: ");
|
||||
_uname = _scn.next().toLowerCase();
|
||||
@ -72,7 +72,7 @@ public class SQLAccountManager
|
||||
|
||||
if (_mode.equals("1"))
|
||||
{
|
||||
while (_pass.trim().length() == 0)
|
||||
while (_pass.trim().isEmpty())
|
||||
{
|
||||
System.out.print("Password: ");
|
||||
_pass = _scn.next();
|
||||
@ -81,7 +81,7 @@ public class SQLAccountManager
|
||||
|
||||
if (_mode.equals("1") || _mode.equals("2"))
|
||||
{
|
||||
while (_level.trim().length() == 0)
|
||||
while (_level.trim().isEmpty())
|
||||
{
|
||||
System.out.print("Access level: ");
|
||||
_level = _scn.next();
|
||||
|
@ -39,7 +39,7 @@ public class GameServerRegister extends BaseGameServerRegister
|
||||
{
|
||||
load();
|
||||
|
||||
if (GameServerTable.getInstance().getServerNames().size() == 0)
|
||||
if (GameServerTable.getInstance().getServerNames().isEmpty())
|
||||
{
|
||||
System.out.println("No available names for GameServer, verify servername.xml file exists in the LoginServer folder.");
|
||||
System.exit(1);
|
||||
|
Loading…
Reference in New Issue
Block a user