Skip to content

Commit

Permalink
Polishing #876
Browse files Browse the repository at this point in the history
Fix other formatted messages with arguments. Add author tag.
  • Loading branch information
mp911de committed Oct 8, 2018
1 parent acc1e7b commit 4454f22
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/java/com/lambdaworks/redis/internal/HostAndPort.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
* An immutable representation of a host and port.
*
* @author Mark Paluch
* @author Larry Battle
* @since 4.2
*/
public class HostAndPort {
Expand Down Expand Up @@ -91,11 +92,11 @@ public static HostAndPort parse(String hostPortString) {
if (!LettuceStrings.isEmpty(portString)) {
// Try to parse the whole port string as a number.
// JDK7 accepts leading plus signs. We don't want to.
LettuceAssert.isTrue(!portString.startsWith("+"), String.format("Unparseable port number: %s", hostPortString));
LettuceAssert.isTrue(!portString.startsWith("+"), String.format("Cannot port number: %s", hostPortString));
try {
port = Integer.parseInt(portString);
} catch (NumberFormatException e) {
throw new IllegalArgumentException(String.format("Unparseable port number: %s" + hostPortString));
throw new IllegalArgumentException(String.format("Cannot parse port number: %s", hostPortString));
}
LettuceAssert.isTrue(isValidPort(port), String.format("Port number out of range: %s", hostPortString));
}
Expand Down

0 comments on commit 4454f22

Please sign in to comment.