Skip to content

Commit

Permalink
Remove unnecessary parentheses and add static final field
Browse files Browse the repository at this point in the history
  • Loading branch information
nomoreFt authored and sjohnr committed Nov 13, 2024
1 parent 346d479 commit 8f1c892
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,12 @@
* Always returns the constructor-specified HTTP and HTTPS ports.
*
* @author Ben Alex
* @author nomoreFt
*/
public class MockPortResolver implements PortResolver {

private static final String HTTPS_SCHEME = "https";

private int http = 80;

private int https = 443;
Expand All @@ -38,7 +41,7 @@ public MockPortResolver(int http, int https) {

@Override
public int getServerPort(ServletRequest request) {
if ((request.getScheme() != null) && request.getScheme().equals("https")) {
if (request.getScheme() != null && HTTPS_SCHEME.equals(request.getScheme())) {
return this.https;
}
else {
Expand Down

0 comments on commit 8f1c892

Please sign in to comment.