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");
|
||||
}
|
||||
|
Reference in New Issue
Block a user