Skip to content

Commit 81451aa

Browse files
philwebbjhoeller
authored andcommitted
Organize imports
Reorganize imports to ensure consistent ordering. This commit also expands any `.*` static imports in favor of using fully-qualified method references. Issue: SPR-16968
1 parent b220d94 commit 81451aa

File tree

86 files changed

+118
-146
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+118
-146
lines changed

spring-context-support/src/main/java/org/springframework/cache/jcache/interceptor/AbstractJCacheOperation.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
import org.springframework.util.Assert;
3333
import org.springframework.util.ExceptionTypeFilter;
3434

35-
import static java.util.Arrays.*;
35+
import static java.util.Arrays.asList;
3636

3737
/**
3838
* A base {@link JCacheOperation} implementation.

spring-context-support/src/main/java/org/springframework/cache/jcache/interceptor/DefaultCacheMethodDetails.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import java.util.Set;
2424
import javax.cache.annotation.CacheMethodDetails;
2525

26-
import static java.util.Arrays.*;
26+
import static java.util.Arrays.asList;
2727

2828
/**
2929
* The default {@link CacheMethodDetails} implementation.

spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassPostProcessor.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
import org.springframework.util.Assert;
6565
import org.springframework.util.ClassUtils;
6666

67-
import static org.springframework.context.annotation.AnnotationConfigUtils.*;
67+
import static org.springframework.context.annotation.AnnotationConfigUtils.CONFIGURATION_BEAN_NAME_GENERATOR;
6868

6969
/**
7070
* {@link BeanFactoryPostProcessor} used for bootstrapping processing of

spring-context/src/main/java/org/springframework/context/support/PostProcessorRegistrationDelegate.java

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
import java.util.ArrayList;
2020
import java.util.Collection;
21-
import java.util.Collections;
2221
import java.util.Comparator;
2322
import java.util.HashSet;
2423
import java.util.LinkedList;

spring-context/src/main/java/org/springframework/ejb/config/AbstractJndiLocatingBeanDefinitionParser.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2007 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -24,7 +24,9 @@
2424
import org.springframework.util.StringUtils;
2525
import org.springframework.util.xml.DomUtils;
2626

27-
import static org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.*;
27+
import static org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.DEFAULT_VALUE;
28+
import static org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.LAZY_INIT_ATTRIBUTE;
29+
import static org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.TRUE_VALUE;
2830

2931
/**
3032
* Abstract base class for BeanDefinitionParsers which build

spring-core/src/main/java/org/springframework/lang/NonNull.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2017 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -21,7 +21,6 @@
2121
import java.lang.annotation.Retention;
2222
import java.lang.annotation.RetentionPolicy;
2323
import java.lang.annotation.Target;
24-
2524
import javax.annotation.Nonnull;
2625
import javax.annotation.meta.TypeQualifierNickname;
2726

spring-jdbc/src/main/java/org/springframework/jdbc/datasource/lookup/MapDataSourceLookup.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2016 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -19,7 +19,6 @@
1919
import java.util.Collections;
2020
import java.util.HashMap;
2121
import java.util.Map;
22-
2322
import javax.sql.DataSource;
2423

2524
import org.springframework.lang.Nullable;

spring-jdbc/src/main/java/org/springframework/jdbc/object/MappingSqlQueryWithParameters.java

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import java.sql.ResultSet;
2020
import java.sql.SQLException;
2121
import java.util.Map;
22-
2322
import javax.sql.DataSource;
2423

2524
import org.springframework.jdbc.core.RowMapper;

spring-jdbc/src/main/java/org/springframework/jdbc/object/SqlQuery.java

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
import java.util.List;
2020
import java.util.Map;
21-
2221
import javax.sql.DataSource;
2322

2423
import org.springframework.dao.DataAccessException;

spring-jdbc/src/main/java/org/springframework/jdbc/support/xml/SqlXmlHandler.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2017 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -20,7 +20,6 @@
2020
import java.io.Reader;
2121
import java.sql.ResultSet;
2222
import java.sql.SQLException;
23-
2423
import javax.xml.transform.Result;
2524
import javax.xml.transform.Source;
2625

spring-oxm/src/main/java/org/springframework/oxm/support/AbstractMarshaller.java

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import java.io.Reader;
2323
import java.io.StringReader;
2424
import java.io.Writer;
25-
2625
import javax.xml.parsers.DocumentBuilder;
2726
import javax.xml.parsers.DocumentBuilderFactory;
2827
import javax.xml.parsers.ParserConfigurationException;

spring-test/src/main/java/org/springframework/test/context/junit4/AbstractJUnit4SpringContextTests.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2017 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -18,7 +18,6 @@
1818

1919
import org.apache.commons.logging.Log;
2020
import org.apache.commons.logging.LogFactory;
21-
2221
import org.junit.runner.RunWith;
2322

2423
import org.springframework.context.ApplicationContext;

spring-test/src/main/java/org/springframework/test/context/junit4/rules/SpringClassRule.java

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525

2626
import org.apache.commons.logging.Log;
2727
import org.apache.commons.logging.LogFactory;
28-
2928
import org.junit.Rule;
3029
import org.junit.rules.TestRule;
3130
import org.junit.runner.Description;

spring-test/src/main/java/org/springframework/test/context/junit4/statements/RunAfterTestExecutionCallbacks.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2016 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -22,6 +22,7 @@
2222

2323
import org.junit.runners.model.MultipleFailureException;
2424
import org.junit.runners.model.Statement;
25+
2526
import org.springframework.test.context.TestContextManager;
2627

2728
/**

spring-test/src/main/java/org/springframework/test/context/junit4/statements/RunBeforeTestExecutionCallbacks.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2016 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -19,6 +19,7 @@
1919
import java.lang.reflect.Method;
2020

2121
import org.junit.runners.model.Statement;
22+
2223
import org.springframework.test.context.TestContextManager;
2324

2425
/**

spring-test/src/main/java/org/springframework/test/context/support/ContextLoaderUtils.java

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2017 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -31,11 +31,15 @@
3131
import org.springframework.test.context.ContextConfigurationAttributes;
3232
import org.springframework.test.context.ContextHierarchy;
3333
import org.springframework.test.context.SmartContextLoader;
34+
import org.springframework.test.util.MetaAnnotationUtils.AnnotationDescriptor;
35+
import org.springframework.test.util.MetaAnnotationUtils.UntypedAnnotationDescriptor;
3436
import org.springframework.util.Assert;
3537
import org.springframework.util.StringUtils;
3638

37-
import static org.springframework.core.annotation.AnnotationUtils.*;
38-
import static org.springframework.test.util.MetaAnnotationUtils.*;
39+
import static org.springframework.core.annotation.AnnotationUtils.getAnnotation;
40+
import static org.springframework.core.annotation.AnnotationUtils.isAnnotationDeclaredLocally;
41+
import static org.springframework.test.util.MetaAnnotationUtils.findAnnotationDescriptor;
42+
import static org.springframework.test.util.MetaAnnotationUtils.findAnnotationDescriptorForTypes;
3943

4044
/**
4145
* Utility methods for resolving {@link ContextConfigurationAttributes} from the

spring-test/src/main/java/org/springframework/test/context/support/DefaultActiveProfilesResolver.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2017 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -24,10 +24,11 @@
2424

2525
import org.springframework.test.context.ActiveProfiles;
2626
import org.springframework.test.context.ActiveProfilesResolver;
27+
import org.springframework.test.util.MetaAnnotationUtils.AnnotationDescriptor;
2728
import org.springframework.util.Assert;
2829
import org.springframework.util.StringUtils;
2930

30-
import static org.springframework.test.util.MetaAnnotationUtils.*;
31+
import static org.springframework.test.util.MetaAnnotationUtils.findAnnotationDescriptor;
3132

3233
/**
3334
* Default implementation of the {@link ActiveProfilesResolver} strategy that

spring-test/src/main/java/org/springframework/test/context/support/DirtiesContextBeforeModesTestExecutionListener.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2015 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -23,8 +23,9 @@
2323
import org.springframework.test.context.TestContext;
2424
import org.springframework.test.context.TestExecutionListeners;
2525

26-
import static org.springframework.test.annotation.DirtiesContext.ClassMode.*;
27-
import static org.springframework.test.annotation.DirtiesContext.MethodMode.*;
26+
import static org.springframework.test.annotation.DirtiesContext.ClassMode.BEFORE_CLASS;
27+
import static org.springframework.test.annotation.DirtiesContext.ClassMode.BEFORE_EACH_TEST_METHOD;
28+
import static org.springframework.test.annotation.DirtiesContext.MethodMode.BEFORE_METHOD;
2829

2930
/**
3031
* {@code TestExecutionListener} which provides support for marking the

spring-test/src/main/java/org/springframework/test/context/support/DirtiesContextTestExecutionListener.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2015 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -23,8 +23,9 @@
2323
import org.springframework.test.context.TestContext;
2424
import org.springframework.test.context.TestExecutionListeners;
2525

26-
import static org.springframework.test.annotation.DirtiesContext.ClassMode.*;
27-
import static org.springframework.test.annotation.DirtiesContext.MethodMode.*;
26+
import static org.springframework.test.annotation.DirtiesContext.ClassMode.AFTER_CLASS;
27+
import static org.springframework.test.annotation.DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD;
28+
import static org.springframework.test.annotation.DirtiesContext.MethodMode.AFTER_METHOD;
2829

2930
/**
3031
* {@code TestExecutionListener} which provides support for marking the

spring-test/src/main/java/org/springframework/test/context/support/TestPropertySourceUtils.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,12 @@
3939
import org.springframework.core.io.support.ResourcePropertySource;
4040
import org.springframework.test.context.TestPropertySource;
4141
import org.springframework.test.context.util.TestContextResourceUtils;
42+
import org.springframework.test.util.MetaAnnotationUtils.AnnotationDescriptor;
4243
import org.springframework.util.Assert;
4344
import org.springframework.util.ObjectUtils;
4445
import org.springframework.util.StringUtils;
4546

46-
import static org.springframework.test.util.MetaAnnotationUtils.*;
47+
import static org.springframework.test.util.MetaAnnotationUtils.findAnnotationDescriptor;
4748

4849
/**
4950
* Utility methods for working with {@link TestPropertySource @TestPropertySource}

spring-test/src/main/java/org/springframework/test/util/JsonPathExpectationsHelper.java

+5-3
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,11 @@
2727
import org.springframework.util.ObjectUtils;
2828
import org.springframework.util.StringUtils;
2929

30-
import static org.hamcrest.MatcherAssert.*;
31-
import static org.hamcrest.core.IsInstanceOf.*;
32-
import static org.springframework.test.util.AssertionErrors.*;
30+
import static org.hamcrest.MatcherAssert.assertThat;
31+
import static org.hamcrest.core.IsInstanceOf.instanceOf;
32+
import static org.springframework.test.util.AssertionErrors.assertEquals;
33+
import static org.springframework.test.util.AssertionErrors.assertTrue;
34+
import static org.springframework.test.util.AssertionErrors.fail;
3335

3436
/**
3537
* A helper class for applying assertions via JSON path expressions.

spring-test/src/main/java/org/springframework/test/util/XmlExpectationsHelper.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
import org.xmlunit.diff.Diff;
3333
import org.xmlunit.diff.ElementSelectors;
3434

35-
import static org.hamcrest.MatcherAssert.*;
35+
import static org.hamcrest.MatcherAssert.assertThat;
3636

3737
/**
3838
* A helper class for assertions on XML content.

spring-test/src/main/java/org/springframework/test/util/XpathExpectationsHelper.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@
3939
import org.springframework.util.StringUtils;
4040
import org.springframework.util.xml.SimpleNamespaceContext;
4141

42-
import static org.hamcrest.MatcherAssert.*;
43-
import static org.springframework.test.util.AssertionErrors.*;
42+
import static org.hamcrest.MatcherAssert.assertThat;
43+
import static org.springframework.test.util.AssertionErrors.assertEquals;
44+
import static org.springframework.test.util.AssertionErrors.assertTrue;
4445

4546
/**
4647
* A helper class for applying assertions via XPath expressions.

spring-test/src/main/java/org/springframework/test/web/ModelAndViewAssert.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
import org.springframework.util.ObjectUtils;
2626
import org.springframework.web.servlet.ModelAndView;
2727

28-
import static org.springframework.test.util.AssertionErrors.*;
28+
import static org.springframework.test.util.AssertionErrors.assertTrue;
29+
import static org.springframework.test.util.AssertionErrors.fail;
2930

3031
/**
3132
* A collection of assertions intended to simplify testing scenarios dealing

spring-test/src/main/java/org/springframework/test/web/client/match/ContentRequestMatchers.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@
3636
import org.springframework.test.web.client.RequestMatcher;
3737
import org.springframework.util.MultiValueMap;
3838

39-
import static org.hamcrest.MatcherAssert.*;
40-
import static org.springframework.test.util.AssertionErrors.*;
39+
import static org.hamcrest.MatcherAssert.assertThat;
40+
import static org.springframework.test.util.AssertionErrors.assertEquals;
41+
import static org.springframework.test.util.AssertionErrors.assertTrue;
4142

4243
/**
4344
* Factory for request content {@code RequestMatcher}'s. An instance of this

spring-test/src/main/java/org/springframework/test/web/client/match/MockRestRequestMatchers.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@
3131
import org.springframework.util.MultiValueMap;
3232
import org.springframework.web.util.UriComponentsBuilder;
3333

34-
import static org.hamcrest.MatcherAssert.*;
35-
import static org.springframework.test.util.AssertionErrors.*;
34+
import static org.hamcrest.MatcherAssert.assertThat;
35+
import static org.springframework.test.util.AssertionErrors.assertEquals;
36+
import static org.springframework.test.util.AssertionErrors.fail;
3637

3738
/**
3839
* Static factory methods for {@link RequestMatcher} classes. Typically used to

spring-test/src/main/java/org/springframework/test/web/reactive/server/HeaderAssertions.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
import org.springframework.http.MediaType;
2626
import org.springframework.lang.Nullable;
2727

28-
import static org.springframework.test.util.AssertionErrors.*;
28+
import static org.springframework.test.util.AssertionErrors.assertEquals;
29+
import static org.springframework.test.util.AssertionErrors.assertTrue;
30+
import static org.springframework.test.util.AssertionErrors.fail;
2931

3032
/**
3133
* Assertions on headers of the response.

spring-test/src/main/java/org/springframework/test/web/reactive/server/StatusAssertions.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2017 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -18,7 +18,7 @@
1818

1919
import org.springframework.http.HttpStatus;
2020

21-
import static org.springframework.test.util.AssertionErrors.*;
21+
import static org.springframework.test.util.AssertionErrors.assertEquals;
2222

2323
/**
2424
* Assertions on the response status.

spring-test/src/main/java/org/springframework/test/web/servlet/result/ContentResultMatchers.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@
2929
import org.springframework.test.util.XmlExpectationsHelper;
3030
import org.springframework.test.web.servlet.ResultMatcher;
3131

32-
import static org.hamcrest.MatcherAssert.*;
33-
import static org.springframework.test.util.AssertionErrors.*;
32+
import static org.hamcrest.MatcherAssert.assertThat;
33+
import static org.springframework.test.util.AssertionErrors.assertEquals;
34+
import static org.springframework.test.util.AssertionErrors.assertTrue;
3435

3536
/**
3637
* Factory for response content assertions.

spring-test/src/main/java/org/springframework/test/web/servlet/result/CookieResultMatchers.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@
2424
import org.springframework.test.web.servlet.MvcResult;
2525
import org.springframework.test.web.servlet.ResultMatcher;
2626

27-
import static org.hamcrest.MatcherAssert.*;
28-
import static org.springframework.test.util.AssertionErrors.*;
27+
import static org.hamcrest.MatcherAssert.assertThat;
28+
import static org.springframework.test.util.AssertionErrors.assertEquals;
29+
import static org.springframework.test.util.AssertionErrors.assertTrue;
2930

3031
/**
3132
* Factory for response cookie assertions.

0 commit comments

Comments
 (0)