FINERACT-822 Enforce ModifyCollectionInEnhancedForLoop check

This commit is contained in:
percyashu
2020-06-26 12:43:45 +02:00
committed by Michael Vorburger ⛑️
parent 4ede116861
commit dff6109c81
3 changed files with 11 additions and 5 deletions
+1 -1
View File
@@ -394,7 +394,6 @@ tasks.withType(JavaCompile) {
"ProtectedMembersInFinalClass",
"StaticAssignmentInConstructor",
"InvalidBlockTag",
"ModifyCollectionInEnhancedForLoop",
"NonCanonicalType",
"InvalidInlineTag",
)
@@ -453,6 +452,7 @@ tasks.withType(JavaCompile) {
"UndefinedEquals",
"PublicConstructorForAbstractClass",
"UnescapedEntity",
"ModifyCollectionInEnhancedForLoop",
"OperatorPrecedence",
"EqualsGetClass",
"EqualsUnsafeCast",
@@ -32,6 +32,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
@@ -444,8 +445,10 @@ public class EmailCampaignWritePlatformCommandHandlerImpl implements EmailCampai
final String response = this.genericDataService.generateJsonFromGenericResultsetData(results);
resultList = new ObjectMapper().readValue(response, new TypeReference<List<HashMap<String, Object>>>() {});
// loop changes array date to string date
for (HashMap<String, Object> entry : resultList) {
for (Map.Entry<String, Object> map : entry.entrySet()) {
for (Iterator<HashMap<String, Object>> it = resultList.iterator(); it.hasNext();) {
HashMap<String, Object> entry = it.next();
for (Iterator<Map.Entry<String, Object>> iter = entry.entrySet().iterator(); iter.hasNext();) {
Map.Entry<String, Object> map = iter.next();
String key = map.getKey();
Object ob = map.getValue();
if (ob instanceof ArrayList && ((ArrayList) ob).size() == 3) {
@@ -29,6 +29,7 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
@@ -543,8 +544,10 @@ public class SmsCampaignWritePlatformServiceJpaImpl implements SmsCampaignWriteP
return resultList;
}
// loop changes array date to string date
for (HashMap<String, Object> entry : resultList) {
for (Map.Entry<String, Object> map : entry.entrySet()) {
for (Iterator<HashMap<String, Object>> iter = resultList.iterator(); iter.hasNext();) {
HashMap<String, Object> entry = iter.next();
for (Iterator<Map.Entry<String, Object>> it = entry.entrySet().iterator(); it.hasNext();) {
Map.Entry<String, Object> map = it.next();
String key = map.getKey();
Object ob = map.getValue();
if (ob instanceof ArrayList && ((ArrayList) ob).size() == 3) {