Replaced zero equality checks with isEmpty() method.
This commit is contained in:
		| @@ -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); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 MobiusDev
					MobiusDev