From 5fcba490d289b2b80114ed9425da615a6dca3646 Mon Sep 17 00:00:00 2001 From: dreis2211 Date: Tue, 26 Jun 2018 18:36:53 +0200 Subject: [PATCH] Polish conditional expressions Closes gh-13583 --- .../boot/autoconfigure/h2/H2ConsoleAutoConfiguration.java | 4 ++-- .../webservices/WebServicesAutoConfiguration.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/h2/H2ConsoleAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/h2/H2ConsoleAutoConfiguration.java index 96f78c72a36..064a11067ba 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/h2/H2ConsoleAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/h2/H2ConsoleAutoConfiguration.java @@ -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. @@ -52,7 +52,7 @@ public class H2ConsoleAutoConfiguration { @Bean public ServletRegistrationBean h2Console() { String path = this.properties.getPath(); - String urlMapping = (path.endsWith("/") ? path + "*" : path + "/*"); + String urlMapping = path + (path.endsWith("/") ? "*" : "/*"); ServletRegistrationBean registration = new ServletRegistrationBean<>( new WebServlet(), urlMapping); H2ConsoleProperties.Settings settings = this.properties.getSettings(); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/webservices/WebServicesAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/webservices/WebServicesAutoConfiguration.java index eb5d5cc906c..634d366c8f1 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/webservices/WebServicesAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/webservices/WebServicesAutoConfiguration.java @@ -77,7 +77,7 @@ public class WebServicesAutoConfiguration { MessageDispatcherServlet servlet = new MessageDispatcherServlet(); servlet.setApplicationContext(applicationContext); String path = this.properties.getPath(); - String urlMapping = (path.endsWith("/") ? path + "*" : path + "/*"); + String urlMapping = path + (path.endsWith("/") ? "*" : "/*"); ServletRegistrationBean registration = new ServletRegistrationBean<>( servlet, urlMapping); WebServicesProperties.Servlet servletProperties = this.properties.getServlet();