Skip to content

Commit 8f1c892

Browse files
nomoreFtsjohnr
authored andcommitted
Remove unnecessary parentheses and add static final field
1 parent 346d479 commit 8f1c892

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

web/src/test/java/org/springframework/security/MockPortResolver.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,12 @@
2424
* Always returns the constructor-specified HTTP and HTTPS ports.
2525
*
2626
* @author Ben Alex
27+
* @author nomoreFt
2728
*/
2829
public class MockPortResolver implements PortResolver {
2930

31+
private static final String HTTPS_SCHEME = "https";
32+
3033
private int http = 80;
3134

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

3942
@Override
4043
public int getServerPort(ServletRequest request) {
41-
if ((request.getScheme() != null) && request.getScheme().equals("https")) {
44+
if (request.getScheme() != null && HTTPS_SCHEME.equals(request.getScheme())) {
4245
return this.https;
4346
}
4447
else {

0 commit comments

Comments
 (0)