FINERACT-822 enable DoubleBraceInitialization error

This commit is contained in:
percyashu
2020-06-09 20:42:08 +02:00
committed by Michael Vorburger ⛑️
parent 117398b765
commit 4c004f0a87
4 changed files with 20 additions and 29 deletions
+1 -1
View File
@@ -328,7 +328,6 @@ tasks.withType(JavaCompile) {
"ModifiedButNotUsed", "ModifiedButNotUsed",
"JodaPlusMinusLong", "JodaPlusMinusLong",
"TypeParameterUnusedInFormals", "TypeParameterUnusedInFormals",
"DoubleBraceInitialization",
"UnusedNestedClass", "UnusedNestedClass",
"UndefinedEquals", "UndefinedEquals",
) )
@@ -374,6 +373,7 @@ tasks.withType(JavaCompile) {
"OperatorPrecedence", "OperatorPrecedence",
"EqualsGetClass", "EqualsGetClass",
"JdkObsolete", "JdkObsolete",
"DoubleBraceInitialization",
// "ReturnMissingNullable", // "ReturnMissingNullable",
// "InconsistentOverloads", // "InconsistentOverloads",
// "MethodCanBeStatic", // "MethodCanBeStatic",
@@ -18,6 +18,7 @@
*/ */
package org.apache.fineract.infrastructure.dataqueries.service; package org.apache.fineract.infrastructure.dataqueries.service;
import com.google.common.collect.ImmutableMap;
import com.google.gson.JsonArray; import com.google.gson.JsonArray;
import com.google.gson.JsonElement; import com.google.gson.JsonElement;
import com.google.gson.JsonObject; import com.google.gson.JsonObject;
@@ -89,19 +90,16 @@ public class ReadWriteNonCoreDataServiceImpl implements ReadWriteNonCoreDataServ
private final static String CODE_VALUES_TABLE = "m_code_value"; private final static String CODE_VALUES_TABLE = "m_code_value";
private final static Logger LOG = LoggerFactory.getLogger(ReadWriteNonCoreDataServiceImpl.class); private final static Logger LOG = LoggerFactory.getLogger(ReadWriteNonCoreDataServiceImpl.class);
private final static HashMap<String, String> apiTypeToMySQL = new HashMap<String, String>() { private final static ImmutableMap<String, String> apiTypeToMySQL = ImmutableMap.<String, String>builder()
.put("string", "VARCHAR")
{ .put("number", "INT")
put("string", "VARCHAR"); .put("boolean", "BIT")
put("number", "INT"); .put("decimal", "DECIMAL")
put("boolean", "BIT"); .put("date", "DATE")
put("decimal", "DECIMAL"); .put("datetime", "DATETIME")
put("date", "DATE"); .put("text", "TEXT")
put("datetime", "DATETIME"); .put("dropdown", "INT")
put("text", "TEXT"); .build();
put("dropdown", "INT");
}
};
private final static List<String> stringDataTypes = Arrays.asList("char", "varchar", "blob", "text", "tinyblob", "tinytext", private final static List<String> stringDataTypes = Arrays.asList("char", "varchar", "blob", "text", "tinyblob", "tinytext",
"mediumblob", "mediumtext", "longblob", "longtext"); "mediumblob", "mediumtext", "longblob", "longtext");
@@ -19,6 +19,7 @@
package org.apache.fineract.infrastructure.security.exception; package org.apache.fineract.infrastructure.security.exception;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List;
import org.apache.fineract.infrastructure.core.data.ApiParameterError; import org.apache.fineract.infrastructure.core.data.ApiParameterError;
import org.apache.fineract.infrastructure.core.exception.PlatformApiDataValidationException; import org.apache.fineract.infrastructure.core.exception.PlatformApiDataValidationException;
@@ -31,17 +32,12 @@ public class ResetPasswordException extends PlatformApiDataValidationException {
public ResetPasswordException(final Long userId) { public ResetPasswordException(final Long userId) {
super("error.msg.password.outdated", "The password of the user with id " + userId + " has expired, please reset it", super("error.msg.password.outdated", "The password of the user with id " + userId + " has expired, please reset it",
new ArrayList<ApiParameterError>() { new ArrayList<ApiParameterError> (List.of(
ApiParameterError.parameterError("error.msg.password.outdated", "The password of the user with id " + userId
{ + " has expired, please reset it", "userId", userId)))
add(ApiParameterError.parameterError("error.msg.password.outdated", "The password of the user with id " + userId
+ " has expired, please reset it", "userId", userId));
}
}
); );
} }
} }
@@ -49,12 +49,9 @@ public class SpringSecurityPlatformSecurityContext implements PlatformSecurityCo
private final ConfigurationDomainService configurationDomainService; private final ConfigurationDomainService configurationDomainService;
protected static final List<CommandWrapper> EXEMPT_FROM_PASSWORD_RESET_CHECK = new ArrayList<CommandWrapper>() { protected static final List<CommandWrapper> EXEMPT_FROM_PASSWORD_RESET_CHECK = new ArrayList<CommandWrapper>(List.of(
new CommandWrapperBuilder().updateUser(null).build())
{ );
add(new CommandWrapperBuilder().updateUser(null).build());
}
};
@Autowired @Autowired
SpringSecurityPlatformSecurityContext(final ConfigurationDomainService configurationDomainService) { SpringSecurityPlatformSecurityContext(final ConfigurationDomainService configurationDomainService) {