Skip to content

Commit 033f405

Browse files
Made checkstyle default
1 parent 25a044d commit 033f405

File tree

504 files changed

+30037
-24741
lines changed

Some content is hidden

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

504 files changed

+30037
-24741
lines changed

.editorconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# EditorConfig is awesome: http://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
[*]
7+
indent_style = tab
8+
indent_size = 4
9+
end_of_line = lf
10+
insert_final_newline = true
11+
12+
[*.yml]
13+
indent_style = space
14+
indent_size = 2

.mvn/wrapper/maven-wrapper.properties

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright 2013-2014 the original author or authors.
2+
# Copyright 2013-2019 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.
@@ -13,5 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
17-
distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.0/apache-maven-3.5.0-bin.zip
16+
distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.0/apache-maven-3.5.0-bin.zip

.travis.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,21 @@ before_install:
1212
- echo "https://$GH_TOKEN:@github.com" > .git/credentials
1313
- gem install asciidoctor
1414
install:
15-
- ./mvnw install -P docs -q -U -DskipTests=true -Dmaven.test.redirectTestOutputToFile=true
16-
- '[ "${MVN_GOAL}" == "deploy" ] && ./docs/src/main/asciidoc/ghpages.sh || echo "Not updating docs"'
15+
- ./mvnw install -P docs -q -U -DskipTests=true -Dmaven.test.redirectTestOutputToFile=true
16+
- '[ "${MVN_GOAL}" == "deploy" ] && ./docs/src/main/asciidoc/ghpages.sh || echo "Not updating docs"'
1717
script:
18-
- './mvnw -s .settings.xml $MVN_GOAL $MVN_PROFILE -nsu -Dmaven.test.redirectTestOutputToFile=true'
18+
- './mvnw -s .settings.xml $MVN_GOAL $MVN_PROFILE -nsu -Dmaven.test.redirectTestOutputToFile=true'
1919
env:
2020
global:
21-
- GIT_NAME="Dave Syer"
22-
- GIT_EMAIL=dsyer@pivotal.io
23-
- CI_DEPLOY_USERNAME=buildmaster
24-
- FEATURE_BRANCH=$(echo ${TRAVIS_BRANCH} | grep -q "^.*/.*$" && echo true || echo false)
25-
- SPRING_CLOUD_BUILD=$(echo ${TRAVIS_REPO_SLUG} | grep -q "^spring-cloud/.*$" && echo true || echo false)
26-
- MVN_GOAL=$([ "${TRAVIS_PULL_REQUEST}" == "false" -a "${TRAVIS_TAG}" == "" -a "${FEATURE_BRANCH}" == "false" -a "${SPRING_CLOUD_BUILD}" == "true" ] && echo verify || echo install)
27-
- VERSION=$(mvn validate | grep Building | head -1 | sed -e 's/.* //')
28-
- MILESTONE=$(echo ${VERSION} | egrep 'M|RC' && echo true || echo false)
29-
- MVN_PROFILE=$([ "${MILESTONE}" == "true" ] && echo -P milestone)
30-
- MAVEN_SKIP_RC=true
31-
- MAVEN_OPTS="-Xmx2g -XX:MaxPermSize=256M"
32-
- secure: "RlAkhuBBoUbd0QEp69la+sd0QfOZhg7cxs/BYiw5Z0Bvl0DCtDJCtXoezQXpeQkIkLzIWa8WjJSkM9aL9aP37bg/GzY3O4B2nuF5rw7otw0zua223ioent3MNbrqk+v2whBlOwCV4/LY3Qod3XvFnLRAQmNWnzSenwcJ4qUxP1Q="
21+
- GIT_NAME="Dave Syer"
22+
- GIT_EMAIL=dsyer@pivotal.io
23+
- CI_DEPLOY_USERNAME=buildmaster
24+
- FEATURE_BRANCH=$(echo ${TRAVIS_BRANCH} | grep -q "^.*/.*$" && echo true || echo false)
25+
- SPRING_CLOUD_BUILD=$(echo ${TRAVIS_REPO_SLUG} | grep -q "^spring-cloud/.*$" && echo true || echo false)
26+
- MVN_GOAL=$([ "${TRAVIS_PULL_REQUEST}" == "false" -a "${TRAVIS_TAG}" == "" -a "${FEATURE_BRANCH}" == "false" -a "${SPRING_CLOUD_BUILD}" == "true" ] && echo verify || echo install)
27+
- VERSION=$(mvn validate | grep Building | head -1 | sed -e 's/.* //')
28+
- MILESTONE=$(echo ${VERSION} | egrep 'M|RC' && echo true || echo false)
29+
- MVN_PROFILE=$([ "${MILESTONE}" == "true" ] && echo -P milestone)
30+
- MAVEN_SKIP_RC=true
31+
- MAVEN_OPTS="-Xmx2g -XX:MaxPermSize=256M"
32+
- secure: "RlAkhuBBoUbd0QEp69la+sd0QfOZhg7cxs/BYiw5Z0Bvl0DCtDJCtXoezQXpeQkIkLzIWa8WjJSkM9aL9aP37bg/GzY3O4B2nuF5rw7otw0zua223ioent3MNbrqk+v2whBlOwCV4/LY3Qod3XvFnLRAQmNWnzSenwcJ4qUxP1Q="

circle.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
dependencies:
2-
override:
3-
- ./mvnw dependency:resolve
2+
override:
3+
- ./mvnw dependency:resolve
44
test:
5-
override:
6-
- ./mvnw test
5+
override:
6+
- ./mvnw test

docs/pom.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
3-
~ Copyright 2013-2014 the original author or authors.
3+
~ Copyright 2013-2019 the original author or authors.
44
~
55
~ Licensed under the Apache License, Version 2.0 (the "License");
66
~ you may not use this file except in compliance with the License.
@@ -15,7 +15,9 @@
1515
~ limitations under the License.
1616
-->
1717

18-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
18+
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
19+
xmlns="http://maven.apache.org/POM/4.0.0"
20+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
1921
<modelVersion>4.0.0</modelVersion>
2022
<parent>
2123
<groupId>org.springframework.cloud</groupId>

pom.xml

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
3-
~ Copyright 2013-2014 the original author or authors.
3+
~ Copyright 2013-2019 the original author or authors.
44
~
55
~ Licensed under the Apache License, Version 2.0 (the "License");
66
~ you may not use this file except in compliance with the License.
@@ -15,7 +15,8 @@
1515
~ limitations under the License.
1616
-->
1717

18-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
18+
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
19+
xmlns="http://maven.apache.org/POM/4.0.0"
1920
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2021
<modelVersion>4.0.0</modelVersion>
2122
<parent>
@@ -33,8 +34,11 @@
3334

3435
<scm>
3536
<url>https://github.com/spring-cloud/spring-cloud-aws</url>
36-
<connection>scm:git:git://github.com/spring-cloud/spring-cloud-aws.git</connection>
37-
<developerConnection>scm:git:ssh://git@github.com/spring-cloud/spring-cloud-aws.git</developerConnection>
37+
<connection>scm:git:git://github.com/spring-cloud/spring-cloud-aws.git
38+
</connection>
39+
<developerConnection>
40+
scm:git:ssh://git@github.com/spring-cloud/spring-cloud-aws.git
41+
</developerConnection>
3842
<tag>HEAD</tag>
3943
</scm>
4044

@@ -44,6 +48,9 @@
4448
<javax-mail.version>1.5.5</javax-mail.version>
4549
<maven-deploy-plugin.version>2.8.2</maven-deploy-plugin.version>
4650
<javax.activation.version>1.2.0</javax.activation.version>
51+
<maven-checkstyle-plugin.failsOnError>true</maven-checkstyle-plugin.failsOnError>
52+
<maven-checkstyle-plugin.failsOnViolation>true
53+
</maven-checkstyle-plugin.failsOnViolation>
4754
</properties>
4855

4956
<modules>
@@ -130,6 +137,16 @@
130137
</plugin>
131138
</plugins>
132139
</pluginManagement>
140+
<plugins>
141+
<plugin>
142+
<groupId>org.apache.maven.plugins</groupId>
143+
<artifactId>maven-checkstyle-plugin</artifactId>
144+
</plugin>
145+
<plugin>
146+
<groupId>io.spring.javaformat</groupId>
147+
<artifactId>spring-javaformat-maven-plugin</artifactId>
148+
</plugin>
149+
</plugins>
133150
</build>
134151

135152
<reporting>
@@ -141,13 +158,18 @@
141158
<links>
142159
<link>http://docs.oracle.com/javase/7/docs/api/</link>
143160
<link>http://docs.oracle.com/javaee/7/api/</link>
144-
<link>http://fasterxml.github.com/jackson-core/javadoc/2.0.0/</link>
161+
<link>http://fasterxml.github.com/jackson-core/javadoc/2.0.0/
162+
</link>
145163
<link>http://docs.spring.io/spring/docs/4.1.x/javadoc-api/</link>
146164
</links>
147165
<author>true</author>
148166
<header>${project.name}</header>
149167
</configuration>
150168
</plugin>
169+
<plugin>
170+
<groupId>org.apache.maven.plugins</groupId>
171+
<artifactId>maven-checkstyle-plugin</artifactId>
172+
</plugin>
151173
</plugins>
152174
</reporting>
153175

spring-cloud-aws-actuator/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
3-
~ Copyright 2013-2018 the original author or authors.
3+
~ Copyright 2013-2019 the original author or authors.
44
~
55
~ Licensed under the Apache License, Version 2.0 (the "License");
66
~ you may not use this file except in compliance with the License.
@@ -15,8 +15,8 @@
1515
~ limitations under the License.
1616
-->
1717

18-
<project xmlns="http://maven.apache.org/POM/4.0.0"
19-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
18+
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
19+
xmlns="http://maven.apache.org/POM/4.0.0"
2020
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2121
<parent>
2222
<groupId>org.springframework.cloud</groupId>

spring-cloud-aws-autoconfigure/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
3-
~ Copyright 2013-2014 the original author or authors.
3+
~ Copyright 2013-2019 the original author or authors.
44
~
55
~ Licensed under the Apache License, Version 2.0 (the "License");
66
~ you may not use this file except in compliance with the License.
@@ -15,8 +15,8 @@
1515
~ limitations under the License.
1616
-->
1717

18-
<project xmlns="http://maven.apache.org/POM/4.0.0"
19-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
18+
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
19+
xmlns="http://maven.apache.org/POM/4.0.0"
2020
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2121
<parent>
2222
<groupId>org.springframework.cloud</groupId>

spring-cloud-aws-autoconfigure/src/main/java/org/springframework/cloud/aws/autoconfigure/cache/ElastiCacheAutoConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2013-2014 the original author or authors.
2+
* Copyright 2013-2019 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.
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2013-2014 the original author or authors.
2+
* Copyright 2013-2019 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.
@@ -16,10 +16,6 @@
1616

1717
package org.springframework.cloud.aws.autoconfigure.context;
1818

19-
import static com.amazonaws.auth.profile.internal.AwsProfileNameLoader.DEFAULT_PROFILE_NAME;
20-
import static org.springframework.cloud.aws.context.config.support.ContextConfigurationUtils.registerCredentialsProvider;
21-
import static org.springframework.cloud.aws.context.config.support.ContextConfigurationUtils.registerDefaultAWSCredentialsProvider;
22-
2319
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
2420
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
2521
import org.springframework.boot.context.properties.ConfigurationProperties;
@@ -35,11 +31,16 @@
3531
import org.springframework.core.type.AnnotationMetadata;
3632
import org.springframework.util.StringUtils;
3733

34+
import static com.amazonaws.auth.profile.internal.AwsProfileNameLoader.DEFAULT_PROFILE_NAME;
35+
import static org.springframework.cloud.aws.context.config.support.ContextConfigurationUtils.registerCredentialsProvider;
36+
import static org.springframework.cloud.aws.context.config.support.ContextConfigurationUtils.registerDefaultAWSCredentialsProvider;
37+
3838
/**
3939
* @author Agim Emruli
4040
*/
4141
@Configuration
42-
@Import({ContextDefaultConfigurationRegistrar.class, ContextCredentialsAutoConfiguration.Registrar.class})
42+
@Import({ ContextDefaultConfigurationRegistrar.class,
43+
ContextCredentialsAutoConfiguration.Registrar.class })
4344
@ConditionalOnClass(name = "com.amazonaws.auth.AWSCredentialsProvider")
4445
public class ContextCredentialsAutoConfiguration {
4546

@@ -50,7 +51,6 @@ public class ContextCredentialsAutoConfiguration {
5051

5152
/**
5253
* Bind AWS credentials related properties to a property instance.
53-
*
5454
* @return An {@link AwsCredentialsProperties} instance
5555
*/
5656
@Bean
@@ -59,34 +59,55 @@ public AwsCredentialsProperties awsCredentialsProperties() {
5959
return new AwsCredentialsProperties();
6060
}
6161

62-
public static class Registrar implements ImportBeanDefinitionRegistrar, EnvironmentAware {
62+
/**
63+
* Registrar for the credentials provider.
64+
*/
65+
public static class Registrar
66+
implements ImportBeanDefinitionRegistrar, EnvironmentAware {
67+
68+
private Environment environment;
69+
70+
@Override
71+
public void setEnvironment(Environment environment) {
72+
this.environment = environment;
73+
}
6374

64-
private Environment environment;
75+
@Override
76+
public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata,
77+
BeanDefinitionRegistry registry) {
78+
// Do not register a credentials provider if a bean with the same name is
79+
// already registered.
80+
if (registry.containsBeanDefinition(
81+
CredentialsProviderFactoryBean.CREDENTIALS_PROVIDER_BEAN_NAME)) {
82+
return;
83+
}
6584

66-
@Override
67-
public void setEnvironment(Environment environment) {
68-
this.environment = environment;
69-
}
85+
Boolean useDefaultCredentialsChain = this.environment.getProperty(
86+
AWS_CREDENTIALS_PROPERTY_PREFIX + ".useDefaultAwsCredentialsChain",
87+
Boolean.class, false);
88+
String accessKey = this.environment
89+
.getProperty(AWS_CREDENTIALS_PROPERTY_PREFIX + ".accessKey");
90+
String secretKey = this.environment
91+
.getProperty(AWS_CREDENTIALS_PROPERTY_PREFIX + ".secretKey");
92+
if (useDefaultCredentialsChain && (StringUtils.isEmpty(accessKey)
93+
|| StringUtils.isEmpty(secretKey))) {
94+
registerDefaultAWSCredentialsProvider(registry);
95+
}
96+
else {
97+
registerCredentialsProvider(registry, accessKey, secretKey,
98+
this.environment.getProperty(
99+
AWS_CREDENTIALS_PROPERTY_PREFIX + ".instanceProfile",
100+
Boolean.class, true)
101+
&& !this.environment.containsProperty(
102+
AWS_CREDENTIALS_PROPERTY_PREFIX + ".accessKey"),
103+
this.environment.getProperty(
104+
AWS_CREDENTIALS_PROPERTY_PREFIX + ".profileName",
105+
DEFAULT_PROFILE_NAME),
106+
this.environment.getProperty(
107+
AWS_CREDENTIALS_PROPERTY_PREFIX + ".profilePath"));
108+
}
109+
}
70110

71-
@Override
72-
public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry) {
73-
//Do not register a credentials provider if a bean with the same name is already registered.
74-
if (registry.containsBeanDefinition(CredentialsProviderFactoryBean.CREDENTIALS_PROVIDER_BEAN_NAME)) {
75-
return;
76-
}
111+
}
77112

78-
Boolean useDefaultCredentialsChain = this.environment.getProperty(AWS_CREDENTIALS_PROPERTY_PREFIX + ".useDefaultAwsCredentialsChain", Boolean.class, false);
79-
String accessKey = this.environment.getProperty(AWS_CREDENTIALS_PROPERTY_PREFIX + ".accessKey");
80-
String secretKey = this.environment.getProperty(AWS_CREDENTIALS_PROPERTY_PREFIX + ".secretKey");
81-
if (useDefaultCredentialsChain && (StringUtils.isEmpty(accessKey) || StringUtils.isEmpty(secretKey))) {
82-
registerDefaultAWSCredentialsProvider(registry);
83-
} else {
84-
registerCredentialsProvider(registry, accessKey, secretKey,
85-
this.environment.getProperty(AWS_CREDENTIALS_PROPERTY_PREFIX + ".instanceProfile", Boolean.class, true) &&
86-
!this.environment.containsProperty(AWS_CREDENTIALS_PROPERTY_PREFIX + ".accessKey"),
87-
this.environment.getProperty(AWS_CREDENTIALS_PROPERTY_PREFIX + ".profileName", DEFAULT_PROFILE_NAME),
88-
this.environment.getProperty(AWS_CREDENTIALS_PROPERTY_PREFIX + ".profilePath"));
89-
}
90-
}
91-
}
92113
}

spring-cloud-aws-autoconfigure/src/main/java/org/springframework/cloud/aws/autoconfigure/context/ContextInstanceDataAutoConfiguration.java

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2013-2014 the original author or authors.
2+
* Copyright 2013-2019 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.
@@ -35,19 +35,29 @@
3535
@Import(ContextInstanceDataAutoConfiguration.Registrar.class)
3636
public class ContextInstanceDataAutoConfiguration {
3737

38-
public static class Registrar implements ImportBeanDefinitionRegistrar, EnvironmentAware {
38+
/**
39+
* Registrar for additional environment setup.
40+
*/
41+
public static class Registrar
42+
implements ImportBeanDefinitionRegistrar, EnvironmentAware {
3943

40-
private Environment environment;
44+
private Environment environment;
4145

42-
@Override
43-
public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry) {
44-
registerInstanceDataPropertySource(registry, this.environment.getProperty("cloud.aws.instance.data.valueSeparator"),
45-
this.environment.getProperty("cloud.aws.instance.data.attributeSeparator"));
46-
}
46+
@Override
47+
public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata,
48+
BeanDefinitionRegistry registry) {
49+
registerInstanceDataPropertySource(registry,
50+
this.environment
51+
.getProperty("cloud.aws.instance.data.valueSeparator"),
52+
this.environment
53+
.getProperty("cloud.aws.instance.data.attributeSeparator"));
54+
}
55+
56+
@Override
57+
public void setEnvironment(Environment environment) {
58+
this.environment = environment;
59+
}
60+
61+
}
4762

48-
@Override
49-
public void setEnvironment(Environment environment) {
50-
this.environment = environment;
51-
}
52-
}
5363
}

0 commit comments

Comments
 (0)