[MAVEN PLUGIN] fix javadoc + sonarlint (#2399)

This commit is contained in:
Vincent Devos 2019-03-20 09:16:59 +01:00 committed by William Cheng
parent b67318ef21
commit 218c2e75ab
6 changed files with 6 additions and 12 deletions

View File

@ -37,7 +37,6 @@ public class OpenAPIGenerator {
public static void main(String[] args) {
String version = Version.readVersionFromResources();
@SuppressWarnings("unchecked")
Cli.CliBuilder<Runnable> builder =
Cli.<Runnable>builder("openapi-generator-cli")
.withDescription(

View File

@ -49,7 +49,7 @@ import org.slf4j.LoggerFactory;
@Command(name = "generate", description = "Generate code with the specified generator.")
public class Generate implements Runnable {
private static final Logger LOGGER = LoggerFactory.getLogger(Generate.class);
// private static final Logger LOGGER = LoggerFactory.getLogger(Generate.class);
@Option(name = {"-v", "--verbose"}, description = "verbose mode")
private Boolean verbose;

View File

@ -9,7 +9,6 @@ import org.openapitools.codegen.CodegenConfig;
import org.openapitools.codegen.CodegenConfigLoader;
import org.openapitools.codegen.CodegenType;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;
import java.util.Locale;
@ -62,7 +61,7 @@ public class ListGenerators implements Runnable {
.sorted(Comparator.comparing(CodegenConfig::getName))
.collect(Collectors.toList());
if(list.size() > 0) {
if(!list.isEmpty()) {
if (docusaurus) {
sb.append("## ").append(typeName).append(" generators");
} else {

View File

@ -45,8 +45,8 @@ public class Validate implements Runnable {
SwaggerParseResult result = new OpenAPIParser().readLocation(spec, null, null);
List<String> messageList = result.getMessages();
Set<String> errors = new HashSet<String>(messageList);
Set<String> warnings = new HashSet<String>();
Set<String> errors = new HashSet<>(messageList);
Set<String> warnings = new HashSet<>();
StringBuilder sb = new StringBuilder();
OpenAPI specification = result.getOpenAPI();
@ -61,7 +61,7 @@ public class Validate implements Runnable {
}
}
if (errors.size() > 0) {
if (!errors.isEmpty()) {
sb.append("Errors:").append(System.lineSeparator());
errors.forEach(msg ->
sb.append("\t-").append(msg).append(System.lineSeparator())

View File

@ -267,9 +267,6 @@ public class CodeGenMojo extends AbstractMojo {
/**
* A map of additional properties that can be referenced by the mustache templates
* <additionalProperties>
* <additionalProperty>key=value</additionalProperty>
* </additionalProperties>
*/
@Parameter(name = "additionalProperties")
private List<String> additionalProperties;

View File

@ -226,13 +226,12 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.0.1</version>
<version>3.1.0</version>
<configuration>
<source>1.8</source>
<encoding>UTF-8</encoding>
<maxmemory>1g</maxmemory>
<failOnWarnings>true</failOnWarnings>
<excludePackageNames></excludePackageNames>
</configuration>
<executions>
<execution>