Commit e91b8386 by Johannes Edmeier

Polish

parent 6fdaf8c1
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
package spring.boot.admin.turbine.config; package spring.boot.admin.turbine.config;
import java.net.URI; import java.net.URI;
import java.util.Arrays;
import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.ConfigurationProperties;
...@@ -43,7 +44,7 @@ public class TurbineProperties { ...@@ -43,7 +44,7 @@ public class TurbineProperties {
} }
public void setClusters(String[] clusters) { public void setClusters(String[] clusters) {
this.clusters = clusters; this.clusters = Arrays.copyOf(clusters, clusters.length);
} }
public boolean isEnabled() { public boolean isEnabled() {
......
package de.codecentric.boot.admin.config; package de.codecentric.boot.admin.config;
import java.util.Arrays;
import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.ConfigurationProperties;
@ConfigurationProperties("spring.boot.admin") @ConfigurationProperties("spring.boot.admin")
...@@ -76,7 +78,7 @@ public class AdminServerProperties { ...@@ -76,7 +78,7 @@ public class AdminServerProperties {
} }
public void setEndpoints(String[] endpoints) { public void setEndpoints(String[] endpoints) {
this.endpoints = endpoints; this.endpoints = Arrays.copyOf(endpoints, endpoints.length);
} }
} }
} }
...@@ -56,9 +56,10 @@ public class RegistryController { ...@@ -56,9 +56,10 @@ public class RegistryController {
*/ */
@RequestMapping(method = RequestMethod.POST) @RequestMapping(method = RequestMethod.POST)
public ResponseEntity<Application> register(@RequestBody Application application) { public ResponseEntity<Application> register(@RequestBody Application application) {
application = Application.copyOf(application).withSource("http-api").build(); Application applicationWithSource = Application.copyOf(application).withSource("http-api")
LOGGER.debug("Register application {}", application.toString()); .build();
Application registeredApp = registry.register(application); LOGGER.debug("Register application {}", applicationWithSource.toString());
Application registeredApp = registry.register(applicationWithSource);
return ResponseEntity.status(HttpStatus.CREATED).body(registeredApp); return ResponseEntity.status(HttpStatus.CREATED).body(registeredApp);
} }
......
...@@ -83,7 +83,7 @@ public class CompositeRouteLocatorTest { ...@@ -83,7 +83,7 @@ public class CompositeRouteLocatorTest {
private Collection<String> ignoredPaths; private Collection<String> ignoredPaths;
private List<Route> routes; private List<Route> routes;
public TestRouteLocator(Collection<String> ignoredPaths, List<Route> routes) { private TestRouteLocator(Collection<String> ignoredPaths, List<Route> routes) {
this.ignoredPaths = ignoredPaths; this.ignoredPaths = ignoredPaths;
this.routes = routes; this.routes = routes;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment