Fixing squid:S1488 - Local Variables should not be declared and then immediately returned or thrown

This commit is contained in:
Kirill Vlasov
2015-12-31 17:08:59 +05:00
parent cafea6f726
commit 6fc871db38
5 changed files with 5 additions and 10 deletions

View File

@@ -390,8 +390,7 @@ public class CodegenConfigurator {
if (isNotEmpty(configFile)) {
try {
CodegenConfigurator result = Json.mapper().readValue(new File(configFile), CodegenConfigurator.class);
return result;
return Json.mapper().readValue(new File(configFile), CodegenConfigurator.class);
} catch (IOException e) {
LOG.error("Unable to deserialize config file: " + configFile, e);
}

View File

@@ -88,10 +88,9 @@ public class ExampleGenerator {
} else if (property instanceof ArrayProperty) {
Property innerType = ((ArrayProperty) property).getItems();
if (innerType != null) {
Object[] output = new Object[]{
return new Object[]{
resolvePropertyToExample(mediaType, innerType, processedModels)
};
return output;
}
} else if (property instanceof DateProperty) {
return new java.util.Date(System.currentTimeMillis());