Turned on checkstyle

This commit is contained in:
Marcin Grzejszczak
2019-02-01 15:48:32 +01:00
parent 94e9b8f2f8
commit e4b08a083c
268 changed files with 5114 additions and 3993 deletions

View File

@@ -1,11 +1,11 @@
/*
* Copyright 2017 the original author or authors.
* Copyright 2012-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.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -27,6 +27,7 @@ import org.springframework.context.ApplicationContextInitializer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.support.GenericApplicationContext;
// @checkstyle:off
@SpringBootApplication
@EnableConfigurationProperties(Properties.class)
public class Config implements ApplicationContextInitializer<GenericApplicationContext> {
@@ -40,14 +41,14 @@ public class Config implements ApplicationContextInitializer<GenericApplicationC
this.props = props;
}
public static void main(String[] args) throws Exception {
FunctionalSpringApplication.run(Config.class, args);
}
@Bean
public Function<Foo, Bar> function() {
return value -> new Bar(
value.uppercase() + (props.getFoo() != null ? "-" + props.getFoo() : ""));
}
public static void main(String[] args) throws Exception {
FunctionalSpringApplication.run(Config.class, args);
value.uppercase() + (this.props.getFoo() != null ? "-" + this.props.getFoo() : ""));
}
@Override
@@ -61,6 +62,7 @@ public class Config implements ApplicationContextInitializer<GenericApplicationC
}
}
// @checkstyle:on
class Foo {
@@ -69,25 +71,26 @@ class Foo {
Foo() {
}
public String lowercase() {
return value.toLowerCase();
}
public Foo(String value) {
Foo(String value) {
this.value = value;
}
public String lowercase() {
return this.value.toLowerCase();
}
public String uppercase() {
return value.toUpperCase();
return this.value.toUpperCase();
}
public String getValue() {
return value;
return this.value;
}
public void setValue(String value) {
this.value = value;
}
}
class Bar {
@@ -97,12 +100,12 @@ class Bar {
Bar() {
}
public Bar(String value) {
Bar(String value) {
this.value = value;
}
public String getValue() {
return value;
return this.value;
}
public void setValue(String value) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2016-2017 the original author or authors.
* Copyright 2012-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.

View File

@@ -1,11 +1,11 @@
/*
* Copyright 2017 the original author or authors.
* Copyright 2012-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.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -18,16 +18,21 @@ package example;
import org.springframework.boot.context.properties.ConfigurationProperties;
// @checkstyle:off
@ConfigurationProperties("app")
public class Properties {
public String foo;
public String getFoo() {
return foo;
return this.foo;
}
public void setFoo(String foo) {
this.foo = foo;
}
}
// @checkstyle:on

View File

@@ -1,14 +1,11 @@
log4j.rootCategory=DEBUG, LAMBDA
PID=????
LOG_LEVEL_PATTERN=%5p
LOG_PATTERN=[%d{yyyy-MM-dd HH:mm:ss.SSS}] boot%X{context} - ${PID} ${LOG_LEVEL_PATTERN} [%t] --- %c{1}: %m%n
# CONSOLE is set to be a ConsoleAppender using a PatternLayout.
log4j.appender.LAMBDA=com.amazonaws.services.lambda.runtime.log4j.LambdaAppender
log4j.appender.LAMBDA.layout=org.apache.log4j.PatternLayout
log4j.appender.LAMBDA.layout.conversionPattern=${LOG_PATTERN}
log4j.category.org.apache.catalina.startup.DigesterFactory=ERROR
log4j.category.org.apache.catalina.util.LifecycleBase=ERROR
log4j.category.org.apache.coyote.http11.Http11NioProtocol=WARN
@@ -20,4 +17,4 @@ log4j.category.org.eclipse.jetty.util.component.AbstractLifeCycle=ERROR
log4j.category.org.hibernate.validator.internal.util.Version=WARN
log4j.category.org.springframework.boot.actuate.autoconfigure.CrshAutoConfiguration=WARN
log4j.category.org.springframework.boot.actuate.endpoint.jmx=WARN
log4j.category.org.thymeleaf=WARN
log4j.category.org.thymeleaf=WARN

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2016-2017 the original author or authors.
* Copyright 2012-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.
@@ -36,7 +36,8 @@ public class MapTests {
@Test
public void start() throws Exception {
SpringBootRequestHandler<Object, Object> handler = new SpringBootRequestHandler<>(Config.class);
SpringBootRequestHandler<Object, Object> handler = new SpringBootRequestHandler<>(
Config.class);
handler.handleRequest(new Foo("foo"), null);
handler.close();
}