Added checkstyle
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2015-2018 the original author or authors.
|
||||
* Copyright 2015-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.
|
||||
@@ -35,23 +35,22 @@ import org.springframework.context.annotation.Bean;
|
||||
/**
|
||||
* Spring Boot Application that has tasks enabled.
|
||||
*/
|
||||
|
||||
@EnableTask
|
||||
@SpringBootApplication
|
||||
@EnableConfigurationProperties({ TimestampTaskProperties.class })
|
||||
@EnableConfigurationProperties({TimestampTaskProperties.class})
|
||||
public class TaskApplication {
|
||||
|
||||
private static final Log logger = LogFactory.getLog(TaskApplication.class);
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(TaskApplication.class, args);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public TimestampTask timeStampTask() {
|
||||
return new TimestampTask();
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(TaskApplication.class, args);
|
||||
}
|
||||
|
||||
/**
|
||||
* A commandline runner that prints a timestamp.
|
||||
*/
|
||||
@@ -62,7 +61,7 @@ public class TaskApplication {
|
||||
|
||||
@Override
|
||||
public void run(String... strings) throws Exception {
|
||||
DateFormat dateFormat = new SimpleDateFormat(config.getFormat());
|
||||
DateFormat dateFormat = new SimpleDateFormat(this.config.getFormat());
|
||||
logger.info(dateFormat.format(new Date()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2015 the original author or authors.
|
||||
* Copyright 2015-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.
|
||||
@@ -31,8 +31,8 @@ public class TimestampTaskProperties {
|
||||
private String format = "yyyy-MM-dd HH:mm:ss.SSS";
|
||||
|
||||
public String getFormat() {
|
||||
Assert.hasText(format, "format must not be empty nor null");
|
||||
return format;
|
||||
Assert.hasText(this.format, "format must not be empty nor null");
|
||||
return this.format;
|
||||
}
|
||||
|
||||
public void setFormat(String format) {
|
||||
|
||||
Reference in New Issue
Block a user