refactor code

Signed-off-by: Michael Hirsch <michael.hirsch@bosch-si.com>
This commit is contained in:
Michael Hirsch
2016-05-31 15:43:49 +02:00
parent c5541b42dc
commit 3e6930419e

View File

@@ -3,6 +3,8 @@
*/
package org.eclipse.hawkbit.ui.filter.target;
import java.net.URI;
import org.eclipse.hawkbit.repository.model.Target;
import org.eclipse.hawkbit.ui.filter.FilterExpression;
@@ -56,9 +58,10 @@ public class TargetSearchTextFilter implements FilterExpression {
}
private boolean ipAddressIgnoreCase() {
if (target.getTargetInfo().getAddress() == null || target.getTargetInfo().getAddress().getHost() == null) {
final URI targetAddress = target.getTargetInfo().getAddress();
if (targetAddress == null || targetAddress.getHost() == null) {
return false;
}
return target.getTargetInfo().getAddress().getHost().toUpperCase().contains(searchTextUpper);
return targetAddress.getHost().toUpperCase().contains(searchTextUpper);
}
}