Code Review
/
policy
/
engine.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Sonar cleanup in controllers etc
[policy/engine.git]
/
POLICY-SDK-APP
/
src
/
main
/
java
/
org
/
onap
/
policy
/
controller
/
CreatePolicyController.java
diff --git
a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreatePolicyController.java
b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreatePolicyController.java
index
be9910c
..
7112285
100644
(file)
--- a/
POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreatePolicyController.java
+++ b/
POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreatePolicyController.java
@@
-22,7
+22,6
@@
package org.onap.policy.controller;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.ArrayList;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.List;
import java.util.Map;
@@
-85,26
+84,17
@@
public class CreatePolicyController extends RestrictedBaseController {
//
if (target != null) {
// Under target we have AnyOFType
//
if (target != null) {
// Under target we have AnyOFType
- List<AnyOfType> anyOfList = target.getAnyOf();
- Iterator<AnyOfType> iterAnyOf = anyOfList.iterator();
- while (iterAnyOf.hasNext()) {
- AnyOfType anyOf = iterAnyOf.next();
+ for (AnyOfType anyOf : target.getAnyOf()) {
// Under AnyOFType we have AllOFType
//
// NOTE: anyOf.getAllOf() will NEVER return null
//
// Under AnyOFType we have AllOFType
//
// NOTE: anyOf.getAllOf() will NEVER return null
//
- List<AllOfType> allOfList = anyOf.getAllOf();
- Iterator<AllOfType> iterAllOf = allOfList.iterator();
int index = 0;
int index = 0;
- while (iterAllOf.hasNext()) {
- AllOfType allOf = iterAllOf.next();
+ for (AllOfType allOf : anyOf.getAllOf()) {
// Under AllOFType we have Match
// NOTE: allOf.getMatch() will NEVER be NULL
//
// Under AllOFType we have Match
// NOTE: allOf.getMatch() will NEVER be NULL
//
- List<MatchType> matchList = allOf.getMatch();
- Iterator<MatchType> iterMatch = matchList.iterator();
- while (iterMatch.hasNext()) {
- MatchType match = iterMatch.next();
+ for (MatchType match : allOf.getMatch()) {
//
// Under the match we have attribute value and
// attributeDesignator. So,finally down to the actual attribute.
//
// Under the match we have attribute value and
// attributeDesignator. So,finally down to the actual attribute.
@@
-149,10
+139,10
@@
public class CreatePolicyController extends RestrictedBaseController {
policyAdapter.setAttributes(attributeList);
}
List<Object> ruleList = policy.getCombinerParametersOrRuleCombinerParametersOrVariableDefinition();
policyAdapter.setAttributes(attributeList);
}
List<Object> ruleList = policy.getCombinerParametersOrRuleCombinerParametersOrVariableDefinition();
- for (Object o : ruleList) {
- if (o instanceof RuleType) {
+ for (Object o
bject
: ruleList) {
+ if (o
bject
instanceof RuleType) {
// get the condition data under the rule for rule Algorithms.
// get the condition data under the rule for rule Algorithms.
- policyAdapter.setRuleID(((RuleType) o).getRuleId());
+ policyAdapter.setRuleID(((RuleType) o
bject
).getRuleId());
}
}
}
}
}
}