Source:
<code>public void run() { running.set(true); while (running.get()) { j = new Jedis(host, port); <START> if (null != sentinelPassword && !sentinelPassword.isEmpty()) { <END> j.auth(sentinelPassword); } try { if (!running.get()) { break; } List<String> masterAddr = j.sentinelGetMasterAddrByName(masterName); if (masterAddr == null || masterAddr.size() != 2) { log.warn("Can not get master addr, master name: {}. Sentinel: {}:{}.", masterName, host, port); } else { initPool(toHostAndPort(masterAddr)); } j.subscribe(new JedisPubSub() { @Override public void onMessage(String channel, String message) { log.debug("Sentinel {}:{} published: {}.", host, port, message); String[] switchMasterMsg = message.split(" "); if (switchMasterMsg.length > 3) { if (masterName.equals(switchMasterMsg[0])) { initPool(toHostAndPort(Arrays.asList(switchMasterMsg[3], switchMasterMsg[4]))); } else { log.debug( "Ignoring message on +switch-master for master name {}, our master name is {}", switchMasterMsg[0], masterName); } } else { log.error( "Invalid message received on Sentinel {}:{} on channel +switch-master: {}", host, port, message); } } }, "+switch-master"); } catch (JedisException e) { if (running.get()) { log.error("Lost connection to Sentinel at {}:{}. Sleeping 5000ms and retrying.", host, port, e); try { Thread.sleep(subscribeRetryWaitTimeMillis); } catch (InterruptedException e1) { log.error("Sleep interrupted: ", e1); } } else { log.debug("Unsubscribing from Sentinel at {}:{}", host, port); } } finally { j.close(); } } }</code><technical_language>Check null, isEmpty</technical_language>

Target:
public void run() { running.set(true); while (running.get()) { try { if (!running.get()) { break; } j = new Jedis(host, port, sentinelConnectionTimeout, sentinelSoTimeout); if (sentinelPassword != null) { j.auth(sentinelPassword); } if (sentinelClientName != null) { j.clientSetname(sentinelClientName); } List<String> masterAddr = j.sentinelGetMasterAddrByName(masterName); if (masterAddr == null || masterAddr.size() != 2) { log.warn("Can not get master addr, master name: {}. Sentinel: {}:{}.", masterName, host, port); } else { initPool(toHostAndPort(masterAddr)); } j.subscribe(new JedisPubSub() { @Override public void onMessage(String channel, String message) { log.debug("Sentinel {}:{} published: {}.", host, port, message); String[] switchMasterMsg = message.split(" "); if (switchMasterMsg.length > 3) { if (masterName.equals(switchMasterMsg[0])) { initPool(toHostAndPort(Arrays.asList(switchMasterMsg[3], switchMasterMsg[4]))); } else { log.debug( "Ignoring message on +switch-master for master name {}, our master name is {}", switchMasterMsg[0], masterName); } } else { log.error( "Invalid message received on Sentinel {}:{} on channel +switch-master: {}", host, port, message); } } }, "+switch-master"); } catch (JedisException e) { if (running.get()) { log.error("Lost connection to Sentinel at {}:{}. Sleeping 5000ms and retrying.", host, port, e); try { Thread.sleep(subscribeRetryWaitTimeMillis); } catch (InterruptedException e1) { log.error("Sleep interrupted: ", e1); } } else { log.debug("Unsubscribing from Sentinel at {}:{}", host, port); } } finally { if (j != null) { j.close(); } } } }