ARTEMIS-1400 Fix some minor issues spotted with FindBugs
Remove a bit of dead code, and invert two string tests that were testing for null after comparing the value to empty string (NPE scenario).
This commit is contained in:
parent
1e28b2953a
commit
a07cb45222
|
@ -378,7 +378,7 @@ public class NetworkHealthCheck extends ActiveMQScheduledComponent {
|
||||||
String inputLine;
|
String inputLine;
|
||||||
while ((inputLine = reader.readLine()) != null) {
|
while ((inputLine = reader.readLine()) != null) {
|
||||||
if (error) {
|
if (error) {
|
||||||
ActiveMQUtilLogger.LOGGER.failedToReadFromStream(inputLine == null ? " " : inputLine);
|
ActiveMQUtilLogger.LOGGER.failedToReadFromStream(inputLine);
|
||||||
} else {
|
} else {
|
||||||
logger.trace(inputLine);
|
logger.trace(inputLine);
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,14 +92,14 @@ public class ActiveMQFilterPredicate<T> implements Predicate<T> {
|
||||||
|
|
||||||
private boolean equals(Object field, Object value) {
|
private boolean equals(Object field, Object value) {
|
||||||
if (field == null) {
|
if (field == null) {
|
||||||
return (value.equals("") || value == null);
|
return (value == null || value.equals(""));
|
||||||
}
|
}
|
||||||
return field.toString().equals(value);
|
return field.toString().equals(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean contains(Object field, Object value) {
|
private boolean contains(Object field, Object value) {
|
||||||
if (field == null) {
|
if (field == null) {
|
||||||
return (value.equals("") || value == null);
|
return (value == null || value.equals(""));
|
||||||
}
|
}
|
||||||
return field.toString().contains(value.toString());
|
return field.toString().contains(value.toString());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue