diff options
author | liamfallon <liam.fallon@ericsson.com> | 2018-09-04 17:24:15 +0100 |
---|---|---|
committer | liamfallon <liam.fallon@ericsson.com> | 2018-09-04 17:25:22 +0100 |
commit | 87be30582d1db37bee7c6b456c0c5c3ca9584963 (patch) | |
tree | 28806c5866fc5d07c89a06014d7c7d2705772b4f /model/policy-model/src/main/java/org | |
parent | f32508381ce0b555fc14978cbaa458aa4e2d91c5 (diff) |
Fix checkstyle issues in apex model basic
CHeckstyle issues in apex model basic and knock on changes
in other apex modules.
Issue-ID: POLICY-1034
Change-Id: I65823f5e2e344526abc74b0812877113acb056ec
Signed-off-by: liamfallon <liam.fallon@ericsson.com>
Diffstat (limited to 'model/policy-model/src/main/java/org')
8 files changed, 31 insertions, 31 deletions
diff --git a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxLogic.java b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxLogic.java index a537d90b9..2fc4467dc 100644 --- a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxLogic.java +++ b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxLogic.java @@ -42,7 +42,7 @@ import org.onap.policy.apex.model.basicmodel.concepts.AxReferenceKey; import org.onap.policy.apex.model.basicmodel.concepts.AxValidationMessage; import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult; import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult.ValidationResult; -import org.onap.policy.apex.model.basicmodel.dao.converters.CDATAConditioner; +import org.onap.policy.apex.model.basicmodel.dao.converters.CDataConditioner; import org.onap.policy.apex.model.basicmodel.xml.AxReferenceKeyAdapter; import org.onap.policy.apex.model.utilities.Assertions; @@ -99,8 +99,8 @@ public class AxLogic extends AxConcept { private String logicFlavour; @Column(name = "logic", length = MAX_LOGIC_SIZE) - @Convert(converter = CDATAConditioner.class) - @XmlJavaTypeAdapter(value = CDATAConditioner.class) + @Convert(converter = CDataConditioner.class) + @XmlJavaTypeAdapter(value = CDataConditioner.class) @XmlElement(required = true) private String logic; @@ -385,8 +385,8 @@ public class AxLogic extends AxConcept { if (!logicFlavour.equals(other.logicFlavour)) { return false; } - final String thislogic = CDATAConditioner.clean(logic).replaceAll("\n", ""); - final String otherlogic = CDATAConditioner.clean(other.logic).replaceAll("\n", ""); + final String thislogic = CDataConditioner.clean(logic).replaceAll("\n", ""); + final String otherlogic = CDataConditioner.clean(other.logic).replaceAll("\n", ""); return thislogic.equals(otherlogic); } diff --git a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxPolicy.java b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxPolicy.java index ff7e4a23f..8b87c41ce 100644 --- a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxPolicy.java +++ b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxPolicy.java @@ -303,7 +303,7 @@ public class AxPolicy extends AxConcept { // Validation continues from this point only if all validation checks this far have been // passed - if (!result.isOK()) { + if (!result.isOk()) { return result; } @@ -361,7 +361,7 @@ public class AxPolicy extends AxConcept { && !stateMap.containsKey(stateOutput.getNextState().getLocalName())) { result.addValidationMessage(new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID, " nextState of state " + stateEntry.getKey() + " not found in StateMap: " - + stateOutput.getNextState().getID())); + + stateOutput.getNextState().getId())); } } diff --git a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxPolicyModel.java b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxPolicyModel.java index f6000b1f3..ad465a48e 100644 --- a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxPolicyModel.java +++ b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxPolicyModel.java @@ -382,7 +382,7 @@ public class AxPolicyModel extends AxModel { if (getSchemas().get(field.getSchema()) == null) { result.addValidationMessage( new AxValidationMessage(event.getKey(), this.getClass(), ValidationResult.INVALID, - "event field data type " + field.getSchema().getID() + DOES_NOT_EXIST)); + "event field data type " + field.getSchema().getId() + DOES_NOT_EXIST)); } } } @@ -400,7 +400,7 @@ public class AxPolicyModel extends AxModel { if (getSchemas().get(contextAlbum.getItemSchema()) == null) { result.addValidationMessage( new AxValidationMessage(contextAlbum.getKey(), this.getClass(), ValidationResult.INVALID, - "context album schema " + contextAlbum.getItemSchema().getID() + DOES_NOT_EXIST)); + "context album schema " + contextAlbum.getItemSchema().getId() + DOES_NOT_EXIST)); } } return result; @@ -431,20 +431,20 @@ public class AxPolicyModel extends AxModel { if (getSchemas().get(field.getSchema()) == null) { result.addValidationMessage( new AxValidationMessage(task.getKey(), this.getClass(), ValidationResult.INVALID, - "task input field schema " + field.getSchema().getID() + DOES_NOT_EXIST)); + "task input field schema " + field.getSchema().getId() + DOES_NOT_EXIST)); } } for (final AxField field : task.getOutputFieldSet()) { if (getSchemas().get(field.getSchema()) == null) { result.addValidationMessage( new AxValidationMessage(task.getKey(), this.getClass(), ValidationResult.INVALID, - "task output field schema " + field.getSchema().getID() + DOES_NOT_EXIST)); + "task output field schema " + field.getSchema().getId() + DOES_NOT_EXIST)); } } for (final AxArtifactKey contextAlbumKey : task.getContextAlbumReferences()) { if (albums.get(contextAlbumKey) == null) { result.addValidationMessage(new AxValidationMessage(task.getKey(), this.getClass(), - ValidationResult.INVALID, "task context album " + contextAlbumKey.getID() + DOES_NOT_EXIST)); + ValidationResult.INVALID, "task context album " + contextAlbumKey.getId() + DOES_NOT_EXIST)); } } return result; @@ -476,20 +476,20 @@ public class AxPolicyModel extends AxModel { for (final AxArtifactKey contextAlbumKey : state.getContextAlbumReferences()) { if (albums.get(contextAlbumKey) == null) { result.addValidationMessage(new AxValidationMessage(state.getKey(), this.getClass(), - ValidationResult.INVALID, "state context album " + contextAlbumKey.getID() + DOES_NOT_EXIST)); + ValidationResult.INVALID, "state context album " + contextAlbumKey.getId() + DOES_NOT_EXIST)); } } final AxEvent triggerEvent = events.getEventMap().get(state.getTrigger()); if (triggerEvent == null) { result.addValidationMessage(new AxValidationMessage(state.getKey(), this.getClass(), - ValidationResult.INVALID, "state trigger event " + state.getTrigger().getID() + DOES_NOT_EXIST)); + ValidationResult.INVALID, "state trigger event " + state.getTrigger().getId() + DOES_NOT_EXIST)); } final AxTask defaultTask = tasks.getTaskMap().get(state.getDefaultTask()); if (defaultTask == null) { result.addValidationMessage(new AxValidationMessage(state.getKey(), this.getClass(), - ValidationResult.INVALID, "state default task " + state.getDefaultTask().getID() + DOES_NOT_EXIST)); + ValidationResult.INVALID, "state default task " + state.getDefaultTask().getId() + DOES_NOT_EXIST)); } // Check task input fields and event fields are compatible for default tasks with no task @@ -501,15 +501,15 @@ public class AxPolicyModel extends AxModel { for (final AxField unhandledTaskInputField : unhandledTaskInputFields) { result.addValidationMessage(new AxValidationMessage(state.getKey(), this.getClass(), ValidationResult.INVALID, "task input field " + unhandledTaskInputField + " for task " - + defaultTask.getID() + " not in trigger event " + triggerEvent.getID())); + + defaultTask.getId() + " not in trigger event " + triggerEvent.getId())); } } for (final AxStateOutput stateOutput : state.getStateOutputs().values()) { if (events.getEventMap().get(stateOutput.getOutgingEvent()) == null) { result.addValidationMessage(new AxValidationMessage(stateOutput.getKey(), this.getClass(), - ValidationResult.INVALID, "output event " + stateOutput.getOutgingEvent().getID() - + " for state output " + stateOutput.getID() + DOES_NOT_EXIST)); + ValidationResult.INVALID, "output event " + stateOutput.getOutgingEvent().getId() + + " for state output " + stateOutput.getId() + DOES_NOT_EXIST)); } } @@ -534,7 +534,7 @@ public class AxPolicyModel extends AxModel { final AxTask usedTask = tasks.getTaskMap().get(taskRefEntry.getKey()); if (usedTask == null) { result.addValidationMessage(new AxValidationMessage(state.getKey(), this.getClass(), - ValidationResult.INVALID, "state task " + taskRefEntry.getKey().getID() + DOES_NOT_EXIST)); + ValidationResult.INVALID, "state task " + taskRefEntry.getKey().getId() + DOES_NOT_EXIST)); } else { AxStateOutput stateOutput = state.getStateOutputs().get(taskRefEntry.getValue().getOutput().getKey().getLocalName()); @@ -556,14 +556,14 @@ public class AxPolicyModel extends AxModel { final AxStateOutput stateOutput, AxValidationResult result) { if (stateOutput == null) { result.addValidationMessage(new AxValidationMessage(state.getKey(), this.getClass(), - ValidationResult.INVALID, "state output on task reference for task " + task.getID() + " is null")); + ValidationResult.INVALID, "state output on task reference for task " + task.getId() + " is null")); } else { final AxEvent usedEvent = events.getEventMap().get(stateOutput.getOutgingEvent()); if (usedEvent == null) { result.addValidationMessage(new AxValidationMessage(stateOutput.getKey(), this.getClass(), - ValidationResult.INVALID, "output event " + stateOutput.getOutgingEvent().getID() - + " for state output " + stateOutput.getID() + DOES_NOT_EXIST)); + ValidationResult.INVALID, "output event " + stateOutput.getOutgingEvent().getId() + + " for state output " + stateOutput.getId() + DOES_NOT_EXIST)); } if (task != null && usedEvent != null) { @@ -572,7 +572,7 @@ public class AxPolicyModel extends AxModel { for (final AxField unhandledTaskOutputField : unhandledTaskOutputFields) { result.addValidationMessage(new AxValidationMessage(state.getKey(), this.getClass(), ValidationResult.INVALID, "task output field " + unhandledTaskOutputField + " for task " - + task.getID() + " not in output event " + usedEvent.getID())); + + task.getId() + " not in output event " + usedEvent.getId())); } } } diff --git a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxState.java b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxState.java index 895232e1c..6851e4859 100644 --- a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxState.java +++ b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxState.java @@ -685,7 +685,7 @@ public class AxState extends AxConcept { if (!taskSelectionLogic.getKey().equals(AxReferenceKey.getNullKey())) { if (!taskSelectionLogic.getKey().getParentReferenceKey().equals(key)) { result.addValidationMessage(new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID, - "taskSelectionLogic key " + taskSelectionLogic.getKey().getID() + DOES_NOT_EQUAL_STATE_KEY)); + "taskSelectionLogic key " + taskSelectionLogic.getKey().getId() + DOES_NOT_EQUAL_STATE_KEY)); } result = taskSelectionLogic.validate(result); } @@ -707,7 +707,7 @@ public class AxState extends AxConcept { } else { if (!stateFinalizerLogicEntry.getValue().getKey().getParentReferenceKey().equals(key)) { result.addValidationMessage(new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID, - "stateFinalizerLogic parent key " + stateFinalizerLogicEntry.getValue().getKey().getID() + "stateFinalizerLogic parent key " + stateFinalizerLogicEntry.getValue().getKey().getId() + DOES_NOT_EQUAL_STATE_KEY)); } @@ -778,7 +778,7 @@ public class AxState extends AxConcept { Set<String> stateFinalizerLogicNameSet, AxValidationResult result) { if (!taskReference.getKey().getParentReferenceKey().equals(key)) { result.addValidationMessage(new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID, - "stateTaskReference parent key " + taskReference.getKey().getID() + DOES_NOT_EQUAL_STATE_KEY)); + "stateTaskReference parent key " + taskReference.getKey().getId() + DOES_NOT_EQUAL_STATE_KEY)); } if (taskReference.getStateTaskOutputType().equals(AxStateTaskOutputType.DIRECT)) { diff --git a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxStateTaskReference.java b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxStateTaskReference.java index 011af6cbb..8a43e371d 100644 --- a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxStateTaskReference.java +++ b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxStateTaskReference.java @@ -269,7 +269,7 @@ public class AxStateTaskReference extends AxConcept { if (output.equals(AxReferenceKey.getNullKey())) { result.addValidationMessage(new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID, - "output key " + output.getID() + " is a null key")); + "output key " + output.getId() + " is a null key")); } result = output.validate(result); diff --git a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxStateTree.java b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxStateTree.java index 30076ca0b..478608ca4 100644 --- a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxStateTree.java +++ b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxStateTree.java @@ -73,7 +73,7 @@ public class AxStateTree implements Comparable<AxStateTree> { // Check for state tree loops if (referencedStateNameSet.contains(nextState.getKey())) { - throw new PolicyRuntimeException("loop detected in state tree for policy " + policy.getID() + " state " + throw new PolicyRuntimeException("loop detected in state tree for policy " + policy.getId() + " state " + thisState.getKey().getLocalName() + ", next state " + nextState.getKey().getLocalName() + " referenced more than once"); } diff --git a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxTask.java b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxTask.java index b1f26f6c0..f26331671 100644 --- a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxTask.java +++ b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxTask.java @@ -483,7 +483,7 @@ public class AxTask extends AxConcept { if (!taskLogic.getKey().getParentArtifactKey().equals(key)) { result.addValidationMessage(new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID, - "taskLogic parent key " + taskLogic.getKey().getID() + DOES_NOT_EQUAL_TASK_KEY)); + "taskLogic parent key " + taskLogic.getKey().getId() + DOES_NOT_EQUAL_TASK_KEY)); } return taskLogic.validate(result); diff --git a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/handling/PolicyAnalysisResult.java b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/handling/PolicyAnalysisResult.java index d59af7cba..2f5cd43d8 100644 --- a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/handling/PolicyAnalysisResult.java +++ b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/handling/PolicyAnalysisResult.java @@ -212,7 +212,7 @@ public class PolicyAnalysisResult { builder.append('\n'); for (final Entry<? extends AxKey, Set<AxKey>> usageEntry : usageMap.entrySet()) { builder.append(" "); - builder.append(usageEntry.getKey().getID()); + builder.append(usageEntry.getKey().getId()); if (usageEntry.getValue().isEmpty()) { builder.append(" (unused)\n"); continue; @@ -221,7 +221,7 @@ public class PolicyAnalysisResult { builder.append('\n'); for (final AxKey usageKey : usageEntry.getValue()) { builder.append(" "); - builder.append(usageKey.getID()); + builder.append(usageKey.getId()); builder.append("\n"); } } |