Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessary parentheses and add static final field MockPortResolver#getServerPort #15875

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Remove unnecessary parentheses and add static final field
  • Loading branch information
nomoreFt committed Oct 4, 2024
commit a95eb4c908cc4f7e5e4ab98672ba7c53f648d7d8
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