Polish static finals

Closes gh-12083
This commit is contained in:
igor-suhorukov
2018-02-16 01:38:51 +03:00
committed by Phillip Webb
parent 752a42710c
commit fe023817c7
13 changed files with 33 additions and 33 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -34,12 +34,12 @@ import org.springframework.web.util.UriTemplateHandler;
*/
public class LocalHostUriTemplateHandler extends RootUriTemplateHandler {
private static final String PREFIX = "server.servlet.";
private final Environment environment;
private final String scheme;
private final String prefix = "server.servlet.";
/**
* Create a new {@code LocalHostUriTemplateHandler} that will generate {@code http}
* URIs using the given {@code environment} to determine the context path and port.
@@ -68,8 +68,7 @@ public class LocalHostUriTemplateHandler extends RootUriTemplateHandler {
@Override
public String getRootUri() {
String port = this.environment.getProperty("local.server.port", "8080");
String contextPath = this.environment.getProperty(this.prefix + "context-path",
"");
String contextPath = this.environment.getProperty(PREFIX + "context-path", "");
return this.scheme + "://localhost:" + port + contextPath;
}