mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-09 23:06:11 +00:00
[MAVEN PLUGIN] fix javadoc + sonarlint (#2399)
This commit is contained in:
committed by
William Cheng
parent
b67318ef21
commit
218c2e75ab
@@ -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(
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user