From bddba685497040548f87cf0ebaabd761093fc06f Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Sat, 23 Mar 2019 12:14:35 +0100 Subject: [PATCH] Polishing --- .../EnableMBeanExportConfigurationTests.java | 31 ++++++++----------- .../reactive/AbstractServerHttpRequest.java | 6 ++-- 2 files changed, 16 insertions(+), 21 deletions(-) diff --git a/spring-context/src/test/java/org/springframework/jmx/export/annotation/EnableMBeanExportConfigurationTests.java b/spring-context/src/test/java/org/springframework/jmx/export/annotation/EnableMBeanExportConfigurationTests.java index d9d93306fdd..7ad2cfc37ab 100644 --- a/spring-context/src/test/java/org/springframework/jmx/export/annotation/EnableMBeanExportConfigurationTests.java +++ b/spring-context/src/test/java/org/springframework/jmx/export/annotation/EnableMBeanExportConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2019 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. @@ -24,7 +24,6 @@ import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; -import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer; import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; @@ -58,6 +57,7 @@ public class EnableMBeanExportConfigurationTests { private AnnotationConfigApplicationContext ctx; + @After public void closeContext() { if (this.ctx != null) { @@ -65,6 +65,7 @@ public class EnableMBeanExportConfigurationTests { } } + @Test public void testLazyNaming() throws Exception { load(LazyNamingConfiguration.class); @@ -159,7 +160,7 @@ public class EnableMBeanExportConfigurationTests { static class LazyNamingConfiguration { @Bean - public MBeanServerFactoryBean server() throws Exception { + public MBeanServerFactoryBean server() { return new MBeanServerFactoryBean(); } @@ -178,7 +179,7 @@ public class EnableMBeanExportConfigurationTests { static class ProxyConfiguration { @Bean - public MBeanServerFactoryBean server() throws Exception { + public MBeanServerFactoryBean server() { return new MBeanServerFactoryBean(); } @@ -199,7 +200,7 @@ public class EnableMBeanExportConfigurationTests { static class PlaceholderBasedConfiguration { @Bean - public MBeanServerFactoryBean server() throws Exception { + public MBeanServerFactoryBean server() { return new MBeanServerFactoryBean(); } @@ -219,12 +220,7 @@ public class EnableMBeanExportConfigurationTests { static class LazyAssemblingConfiguration { @Bean - public PropertyPlaceholderConfigurer ppc() { - return new PropertyPlaceholderConfigurer(); - } - - @Bean - public MBeanServerFactoryBean server() throws Exception { + public MBeanServerFactoryBean server() { return new MBeanServerFactoryBean(); } @@ -238,7 +234,7 @@ public class EnableMBeanExportConfigurationTests { } @Bean("bean:name=testBean5") - public AnnotationTestBeanFactory testBean5() throws Exception { + public AnnotationTestBeanFactory testBean5() { return new AnnotationTestBeanFactory(); } @@ -265,12 +261,12 @@ public class EnableMBeanExportConfigurationTests { @Configuration - @ComponentScan(excludeFilters = @ComponentScan.Filter(value=Configuration.class)) + @ComponentScan(excludeFilters = @ComponentScan.Filter(Configuration.class)) @EnableMBeanExport(server = "server") static class ComponentScanConfiguration { @Bean - public MBeanServerFactoryBean server() throws Exception { + public MBeanServerFactoryBean server() { return new MBeanServerFactoryBean(); } } @@ -280,7 +276,7 @@ public class EnableMBeanExportConfigurationTests { static class PackagePrivateConfiguration { @Bean - public MBeanServerFactoryBean server() throws Exception { + public MBeanServerFactoryBean server() { return new MBeanServerFactoryBean(); } @@ -312,7 +308,7 @@ public class EnableMBeanExportConfigurationTests { static class PackagePrivateExtensionConfiguration { @Bean - public MBeanServerFactoryBean server() throws Exception { + public MBeanServerFactoryBean server() { return new MBeanServerFactoryBean(); } @@ -333,7 +329,7 @@ public class EnableMBeanExportConfigurationTests { static class PackagePrivateInterfaceImplementationConfiguration { @Bean - public MBeanServerFactoryBean server() throws Exception { + public MBeanServerFactoryBean server() { return new MBeanServerFactoryBean(); } @@ -349,7 +345,6 @@ public class EnableMBeanExportConfigurationTests { @Override public void foo() { - } @Override diff --git a/spring-web/src/main/java/org/springframework/http/server/reactive/AbstractServerHttpRequest.java b/spring-web/src/main/java/org/springframework/http/server/reactive/AbstractServerHttpRequest.java index 1d8a83c1937..c4ef2c279ac 100644 --- a/spring-web/src/main/java/org/springframework/http/server/reactive/AbstractServerHttpRequest.java +++ b/spring-web/src/main/java/org/springframework/http/server/reactive/AbstractServerHttpRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2017 the original author or authors. + * Copyright 2002-2019 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. @@ -43,11 +43,11 @@ import org.springframework.util.StringUtils; */ public abstract class AbstractServerHttpRequest implements ServerHttpRequest { - protected final Log logger = HttpLogging.forLogName(getClass()); - private static final Pattern QUERY_PATTERN = Pattern.compile("([^&=]+)(=?)([^&]+)?"); + protected final Log logger = HttpLogging.forLogName(getClass()); + private final URI uri; private final RequestPath path;