Skip to content

Commit

Permalink
Set the port to the default ones if the port is null. No need to chec…
Browse files Browse the repository at this point in the history
…k if port() is null anymore.
  • Loading branch information
Pascal Robert committed Aug 17, 2015
1 parent bef5e9d commit 7ead0b6
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,15 @@ public void setPort(Integer port) {
* @return the port of this URL (can be null)
*/
public Integer port() {
if (_port == null) {
if (protocol() != null) {
if ("https".equals(protocol())) {
_port = 443;
} else {
_port = 80;
}
}
}
return _port;
}

Expand Down

0 comments on commit 7ead0b6

Please sign in to comment.