Skip to content

Commit

Permalink
8273910: Redundant condition and assignment in java.net.URI
Browse files Browse the repository at this point in the history
Reviewed-by: dfuchs
  • Loading branch information
turbanoff authored and dfuch committed Oct 7, 2021
1 parent 8ca0846 commit 7de2cf8
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/java.base/share/classes/java/net/URI.java
Original file line number Diff line number Diff line change
Expand Up @@ -2207,7 +2207,6 @@ private static URI resolve(URI base, URI child) {
ru.authority = child.authority;
ru.host = child.host;
ru.userInfo = child.userInfo;
ru.host = child.host;
ru.port = child.port;
ru.path = child.path;
}
Expand Down Expand Up @@ -3490,14 +3489,12 @@ private int parseHostname(int start, int n)
if (q <= p)
break;
l = p;
p = q;
q = scan(p, n, L_ALPHANUM | L_DASH, H_ALPHANUM | H_DASH);
if (q > p) {
if (input.charAt(q - 1) == '-')
fail("Illegal character in hostname", q - 1);
p = q;
q = scan(p, n, L_ALPHANUM | L_DASH, H_ALPHANUM | H_DASH);
if (q > p) {
if (input.charAt(q - 1) == '-')
fail("Illegal character in hostname", q - 1);
p = q;
}
}
q = scan(p, n, '.');
if (q <= p)
Expand Down

1 comment on commit 7de2cf8

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.