We have forgotten a commented-out block of code. Eliminate it and
simplify isIpValid().
Change-Id: I051d1114f142f92a91eb429ff036f5985476b046
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
*/
package org.opendaylight.netconf.console.commands;
-import com.google.common.base.Strings;
import java.util.regex.Pattern;
final class NetconfCommandUtils {
}
static boolean isPortValid(final String devicePort) {
-// if (Strings.isNullOrEmpty(devicePort)) {
-// return false;
-// }
final int port;
try {
port = Integer.parseInt(devicePort);
}
static boolean isIpValid(final String deviceIp) {
- if (Strings.isNullOrEmpty(deviceIp)) {
- return false;
- }
- return IP_PATTERN.matcher(deviceIp).matches();
+ return deviceIp != null && IP_PATTERN.matcher(deviceIp).matches();
}
}