selectedName = responseAttributes.get(key);
}
// kmodule configurations
- else if (key.equals("kSessionName")) {
+ else if ("kSessionName".equals(key)) {
kSessionName = responseAttributes.get(key);
}
// Check User Specific values.
- if (key.equals("$controller:")) {
+ if ("$controller:".equals(key)) {
try {
PEDependency dependency = PolicyUtils.jsonStringToObject(responseAttributes.get(key),
PEDependency.class);
LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error while resolving Controller: " + e);
}
- } else if (key.equals("$dependency$")) {
+ } else if ("$dependency$".equals(key)) {
String value = responseAttributes.get(key);
if (value.startsWith("[") && value.endsWith("]")) {
value = value.substring(1, value.length() - 1).trim();
List<?> pList = query.getResultList();
boolean createFlag = false;
BRMSPolicyInfo brmsPolicyInfo = new BRMSPolicyInfo();
- if (pList.size() > 0) {
+ if (!pList.isEmpty()) {
// Already exists.
brmsPolicyInfo = (BRMSPolicyInfo) pList.get(0);
if (!brmsPolicyInfo.getControllerName().getControllerName().equals(controllerName)) {
query.setParameter("cn", controllerName);
List<?> bList = query.getResultList();
BRMSGroupInfo brmsGroupInfo = new BRMSGroupInfo();
- if (bList.size() > 0) {
+ if (!bList.isEmpty()) {
brmsGroupInfo = (BRMSGroupInfo) bList.get(0);
}
brmsPolicyInfo.setPolicyName(policyName);
private void syncProject(String selectedName) {
boolean projectExists = checkProject(selectedName);
if (projectExists) {
- String version = null;
+ String version;
version = getVersion(selectedName);
if (version == null) {
LOGGER.error("Error getting local version for the given Controller Name:" + selectedName
}
fos.close();
is.close();
- f = null;
LOGGER.info(fileName + " Created..");
}
}
private boolean checkRemoteSync(String selectedName, String version) {
List<NexusArtifact> artifacts = getArtifactFromNexus(selectedName, version);
- return (artifacts.size() == 0) ? false : true;
+ return artifacts.isEmpty() ? false : true;
}
private List<NexusArtifact> getArtifactFromNexus(String selectedName, String version) {
if (artifact != null) {
newVersion = incrementVersion(artifact.getVersion());
}
- if (newVersion.equals("0.1.0")) {
+ if ("0.1.0".equals(newVersion)) {
createFlag = true;
}
setVersion(newVersion, selectedName);
}
if (!modifiedGroups.isEmpty()) {
Boolean flag = false;
- for (String group : modifiedGroups.keySet()) {
+ for (Map.Entry<String, String> entry : modifiedGroups.entrySet()) {
InvocationResult result = null;
+ String group = entry.getKey();
try {
InvocationRequest request = new DefaultInvocationRequest();
setVersion(group);
if (createFlag) {
addNotification(group, "create");
} else {
- addNotification(group, modifiedGroups.get(group));
+ addNotification(group, entry.getValue());
}
flag = true;
} else {
return policyMap.get(name);
} else {
syncGroupInfo();
- return (policyMap.containsKey(name)) ? policyMap.get(name) : null;
+ return policyMap.containsKey(name) ? policyMap.get(name) : null;
}
}
pub.send("MyPartitionKey", message);
final List<?> stuck = pub.close(uebDelay, TimeUnit.SECONDS);
- if (stuck.size() > 0) {
+ if (!stuck.isEmpty()) {
LOGGER.error(stuck.size() + " messages unsent");
} else {
LOGGER.debug("Clean exit; Message Published on UEB : " + uebList + "for Topic: " + pubTopic);
}
private void readGroups(Properties config) throws PolicyException {
- String[] groupNames = null;
+ String[] groupNames;
if (!config.containsKey("groupNames") || config.getProperty("groupNames")==null){
throw new PolicyException(XACMLErrorConstants.ERROR_DATA_ISSUE
+ "groupNames property is missing or empty from the property file ");
query.setParameter("cn", name);
List<?> groupList = query.getResultList();
BRMSGroupInfo brmsGroupInfo = null;
- if (groupList.size() > 0) {
+ if (!groupList.isEmpty()) {
LOGGER.info("Controller name already Existing in DB. Will be updating the DB Values" + name);
brmsGroupInfo = (BRMSGroupInfo) groupList.get(0);
}
Query query = em.createQuery("select b from BRMSPolicyInfo as b where b.policyName = :pn");
query.setParameter("pn", policyName);
List<?> pList = query.getResultList();
- BRMSPolicyInfo brmsPolicyInfo = new BRMSPolicyInfo();
- if (pList.size() > 0) {
+ BRMSPolicyInfo brmsPolicyInfo;
+ if (!pList.isEmpty()) {
// Already exists.
brmsPolicyInfo = (BRMSPolicyInfo) pList.get(0);
if (brmsPolicyInfo.getControllerName().getControllerName().equals(controllerName)) {
--- /dev/null
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP-XACML
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.policy.xacml.test.std.pap;
+
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.Properties;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.onap.policy.common.logging.flexlogger.FlexLogger;
+import org.onap.policy.common.logging.flexlogger.Logger;
+import org.onap.policy.xacml.api.pap.OnapPDP;
+import org.onap.policy.xacml.std.pap.StdEngine;
+
+import com.att.research.xacml.api.pap.PAPException;
+import com.att.research.xacml.std.pap.StdPDP;
+
+public class StdEngineTest {
+
+ private static Logger logger = FlexLogger.getLogger(StdEngineTest.class);
+ private Path repository;
+ Properties properties = new Properties();
+ StdEngine stdEngine = null;
+
+ @Before
+ public void setUp(){
+
+ repository = Paths.get("src/test/resources/pdps");
+ try {
+ stdEngine = new StdEngine(repository);
+ } catch (PAPException e) {
+ logger.info(e);
+ } catch (IOException e) {
+ logger.info(e);
+ }
+ }
+
+ @Test
+ public void testGetDefaultGroup(){
+ try {
+ assertTrue(stdEngine.getDefaultGroup() != null);
+ } catch (PAPException e) {
+ logger.info(e);
+ }
+ }
+ @Test
+ public void testGetGroup(){
+ try {
+ assertTrue(stdEngine.getGroup("1") == null);
+ } catch (PAPException e) {
+ logger.info(e);
+ }
+
+ }
+
+ @Test
+ public void testGetOnapPDPGroups(){
+ try {
+ assertTrue(stdEngine.getOnapPDPGroups() != null);
+ } catch (PAPException e) {
+ logger.info(e);
+ }
+ }
+ @Test
+ public void testGetPDP(){
+ try {
+ assertTrue(stdEngine.getPDP("1") == null);
+ } catch (PAPException e) {
+ logger.info(e);
+ }
+ }
+ @Test
+ public void testGetPDPGroup(){
+ try {
+ assertTrue(stdEngine.getPDPGroup(null) == null);
+ } catch (PAPException e) {
+ logger.info(e);
+ }
+ }
+}
--- /dev/null
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP-XACML
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.policy.xacml.test.std.pap;
+
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+import java.net.URI;
+import java.net.URL;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Properties;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.onap.policy.common.logging.flexlogger.FlexLogger;
+import org.onap.policy.common.logging.flexlogger.Logger;
+import org.onap.policy.xacml.api.pap.OnapPDP;
+import org.onap.policy.xacml.std.pap.StdEngine;
+import org.onap.policy.xacml.std.pap.StdPAPPolicy;
+
+import com.att.research.xacml.api.pap.PAPException;
+import com.att.research.xacml.std.pap.StdPDP;
+
+public class StdPAPPolicyTest {
+
+ private static Logger logger = FlexLogger.getLogger(StdPAPPolicyTest.class);
+ private Path repository;
+ Properties properties = new Properties();
+ StdPAPPolicy stdPAPPolicy;
+
+ @Before
+ public void setUp(){
+
+ repository = Paths.get("src/test/resources/pdps");
+ try {
+ stdPAPPolicy = new StdPAPPolicy();
+ } catch (Exception e) {
+ logger.info(e);
+ }
+ }
+
+ @Test
+ public void testGetActionAttribute(){
+ try {
+ stdPAPPolicy.setActionAttribute("test");
+ assertTrue(stdPAPPolicy.getActionAttribute() != null);
+ } catch (Exception e) {
+ logger.info(e);
+ }
+ }
+ @Test
+ public void testGetActionBody(){
+ try {
+ stdPAPPolicy.setActionBody("actionBody");
+ assertTrue(stdPAPPolicy.getActionBody() != null);
+ } catch (Exception e) {
+ logger.info(e);
+ }
+
+ }
+
+ @Test
+ public void testGetActionDictHeader(){
+ try {
+ stdPAPPolicy.setActionDictHeader("actionDictHeader");
+ assertTrue(stdPAPPolicy.getActionDictHeader() != null);
+ } catch (Exception e) {
+ logger.info(e);
+ }
+ }
+ @Test
+ public void testGetActionDictMethod(){
+ try {
+ stdPAPPolicy.setActionDictMethod("actionDictMethod");
+ assertTrue(stdPAPPolicy.getActionDictMethod() != null);
+ } catch (Exception e) {
+ logger.info(e);
+ }
+ }
+
+ @Test
+ public void testGetActionDictType(){
+ try {
+ stdPAPPolicy.setActionDictType("actionDictType");
+ assertTrue(stdPAPPolicy.getActionDictType() != null);
+ } catch (Exception e) {
+ logger.info(e);
+ }
+ }
+
+ @Test
+ public void testGetActionDictUrl(){
+ try {
+ stdPAPPolicy.setActionDictUrl("actionDictUrl");
+ assertTrue(stdPAPPolicy.getActionDictUrl() != null);
+ } catch (Exception e) {
+ logger.info(e);
+ }
+ }
+ @Test
+ public void testGetActionPerformer(){
+ try {
+ stdPAPPolicy.setActionPerformer("actionPerformer");
+ assertTrue(stdPAPPolicy.getActionPerformer() != null);
+ } catch (Exception e) {
+ logger.info(e);
+ }
+
+ }
+
+ @Test
+ public void testGetBrmsController(){
+ try {
+ stdPAPPolicy.setBrmsController("brmsController");
+ assertTrue(stdPAPPolicy.getBrmsController() != null);
+ } catch (Exception e) {
+ logger.info(e);
+ }
+ }
+ @Test
+ public void testGetBrmsDependency(){
+ try {
+ stdPAPPolicy.setBrmsDependency(new ArrayList());
+ assertTrue(stdPAPPolicy.getBrmsDependency() != null);
+ } catch (Exception e) {
+ logger.info(e);
+ }
+ }
+
+ @Test
+ public void testGetConfigBodyData(){
+ try {
+ stdPAPPolicy.setConfigBodyData("configBodyData");
+ assertTrue(stdPAPPolicy.getConfigBodyData() != null);
+ } catch (Exception e) {
+ logger.info(e);
+ }
+ }
+
+
+ @Test
+ public void testGetConfigName(){
+ try {
+ stdPAPPolicy.setConfigName("configName");
+ assertTrue(stdPAPPolicy.getConfigName() != null);
+ } catch (Exception e) {
+ logger.info(e);
+ }
+ }
+ @Test
+ public void testGetConfigPolicyType(){
+ try {
+ stdPAPPolicy.setConfigPolicyType("configPolicyType");
+ assertTrue(stdPAPPolicy.getConfigPolicyType() != null);
+ } catch (Exception e) {
+ logger.info(e);
+ }
+
+ }
+
+ @Test
+ public void testGetConfigType(){
+ try {
+ stdPAPPolicy.setConfigType("configType");
+ assertTrue(stdPAPPolicy.getConfigType() != null);
+ } catch (Exception e) {
+ logger.info(e);
+ }
+ }
+ @Test
+ public void testGetDataTypeList(){
+ try {
+ stdPAPPolicy.setDataTypeList(new ArrayList<String>());
+ assertTrue(stdPAPPolicy.getDataTypeList() != null);
+ } catch (Exception e) {
+ logger.info(e);
+ }
+ }
+
+ @Test
+ public void testGetDeleteCondition(){
+ try {
+ stdPAPPolicy.setDeleteCondition("deleteCondition");
+ assertTrue(stdPAPPolicy.getDeleteCondition() != null);
+ } catch (Exception e) {
+ logger.info(e);
+ }
+ }
+
+
+ @Test
+ public void testGetDrlRuleAndUIParams(){
+ try {
+ stdPAPPolicy.setDrlRuleAndUIParams(new HashMap());
+ assertTrue(stdPAPPolicy.getDrlRuleAndUIParams() != null);
+ } catch (Exception e) {
+ logger.info(e);
+ }
+ }
+ @Test
+ public void testGetDropDownMap(){
+ try {
+ stdPAPPolicy.setDropDownMap(new HashMap());
+ assertTrue(stdPAPPolicy.getDropDownMap() != null);
+ } catch (Exception e) {
+ logger.info(e);
+ }
+
+ }
+
+ @Test
+ public void testGetDynamicFieldConfigAttributes(){
+ try {
+ assertTrue(stdPAPPolicy.getDynamicFieldConfigAttributes() != null);
+ } catch (Exception e) {
+ logger.info(e);
+ }
+ }
+ @Test
+ public void testGetDynamicRuleAlgorithmCombo(){
+ try {
+ stdPAPPolicy.setDynamicRuleAlgorithmCombo(new ArrayList());
+ assertTrue(stdPAPPolicy.getDynamicRuleAlgorithmCombo() != null);
+ } catch (Exception e) {
+ logger.info(e);
+ }
+ }
+
+ @Test
+ public void testGetDynamicRuleAlgorithmField1(){
+ try {
+ stdPAPPolicy.setDynamicRuleAlgorithmField1(new ArrayList());
+ assertTrue(stdPAPPolicy.getDynamicRuleAlgorithmField1() != null);
+ } catch (Exception e) {
+ logger.info(e);
+ }
+ }
+
+ @Test
+ public void testGetDictionary(){
+ try {
+ stdPAPPolicy.setDictionary("dictionary");
+ assertTrue(stdPAPPolicy.getDictionary() != null);
+ } catch (Exception e) {
+ logger.info(e);
+ }
+ }
+ @Test
+ public void testGetDictionaryFields(){
+ try {
+ stdPAPPolicy.setDictionaryFields("dictionaryFields");
+ assertTrue(stdPAPPolicy.getDictionaryFields() != null);
+ } catch (Exception e) {
+ logger.info(e);
+ }
+
+ }
+
+ @Test
+ public void testGetDictionaryType(){
+ try {
+ stdPAPPolicy.setDictionaryType("dictionaryType");
+ assertTrue(stdPAPPolicy.getDictionaryType() != null);
+ } catch (Exception e) {
+ logger.info(e);
+ }
+ }
+ @Test
+ public void testGetDomainDir(){
+ try {
+ stdPAPPolicy.setDomainDir("domain");
+ assertTrue(stdPAPPolicy.getDomainDir() != null);
+ } catch (Exception e) {
+ logger.info(e);
+ }
+ }
+
+ @Test
+ public void testIsDraft(){
+ try {
+ stdPAPPolicy.setDraft(true);
+ assertTrue(stdPAPPolicy.isDraft() == true);
+ } catch (Exception e) {
+ logger.info(e);
+ }
+ }
+
+ @Test
+ public void testGetDynamicRuleAlgorithmLabels(){
+ try {
+ stdPAPPolicy.setDynamicRuleAlgorithmLabels(new ArrayList());
+ assertTrue(stdPAPPolicy.getDynamicRuleAlgorithmLabels() != null);
+ } catch (Exception e) {
+ logger.info(e);
+ }
+ }
+ @Test
+ public void testGetDynamicSettingsMap(){
+ try {
+ stdPAPPolicy.setDynamicSettingsMap(new HashMap());
+ assertTrue(stdPAPPolicy.getDynamicSettingsMap() != null);
+ } catch (Exception e) {
+ logger.info(e);
+ }
+
+ }
+
+ @Test
+ public void testGetDynamicVariableList(){
+ try {
+ stdPAPPolicy.setDynamicVariableList(new ArrayList());
+ assertTrue(stdPAPPolicy.getDynamicVariableList() != null);
+ } catch (Exception e) {
+ logger.info(e);
+ }
+ }
+ @Test
+ public void testGetGuard(){
+ try {
+ stdPAPPolicy.setGuard("domain");
+ assertTrue(stdPAPPolicy.getGuard() != null);
+ } catch (Exception e) {
+ logger.info(e);
+ }
+ }
+
+ @Test
+ public void testGetHighestVersion(){
+ try {
+ stdPAPPolicy.setHighestVersion(123);
+ assertTrue(stdPAPPolicy.getHighestVersion() != null);
+ } catch (Exception e) {
+ logger.info(e);
+ }
+ }
+
+ @Test
+ public void testgGtJsonBody(){
+ try {
+ stdPAPPolicy.setJsonBody("jsonBoby");
+ assertTrue(stdPAPPolicy.getJsonBody() != null);
+ } catch (Exception e) {
+ logger.info(e);
+ }
+ }
+ @Test
+ public void testGetLocation(){
+ try {
+ stdPAPPolicy.setLocation(new URI("test"));
+ assertTrue(stdPAPPolicy.getLocation() != null);
+ } catch (Exception e) {
+ logger.info(e);
+ }
+
+ }
+
+ @Test
+ public void testGetMsLocation(){
+ try {
+ stdPAPPolicy.setMsLocation("MsLocation");
+ assertTrue(stdPAPPolicy.getMsLocation() != null);
+ } catch (Exception e) {
+ logger.info(e);
+ }
+ }
+ @Test
+ public void testSetOldPolicyFileName(){
+ try {
+ stdPAPPolicy.setOldPolicyFileName("domain");
+ assertTrue(stdPAPPolicy.getOldPolicyFileName() != null);
+ } catch (Exception e) {
+ logger.info(e);
+ }
+ }
+
+ @Test
+ public void testGetOnapName(){
+ try {
+ stdPAPPolicy.setOnapName("onap");
+ assertTrue(stdPAPPolicy.getOnapName() != null);
+ } catch (Exception e) {
+ logger.info(e);
+ }
+ }
+
+ @Test
+ public void testGetPolicyDescription(){
+ try {
+ stdPAPPolicy.setPolicyDescription("description test");
+ assertTrue(stdPAPPolicy.getPolicyDescription() != null);
+ } catch (Exception e) {
+ logger.info(e);
+ }
+ }
+ @Test
+ public void testGetPolicyID(){
+ try {
+ stdPAPPolicy.setPolicyID("test");
+ assertTrue(stdPAPPolicy.getPolicyID() != null);
+ } catch (Exception e) {
+ logger.info(e);
+ }
+
+ }
+
+ @Test
+ public void testSetPolicyName(){
+ try {
+ stdPAPPolicy.setPolicyName("MsLocation");
+ assertTrue(stdPAPPolicy.getPolicyName() != null);
+ } catch (Exception e) {
+ logger.info(e);
+ }
+ }
+ @Test
+ public void testSetPriority(){
+ try {
+ stdPAPPolicy.setPriority("domain");
+ assertTrue(stdPAPPolicy.getPriority() != null);
+ } catch (Exception e) {
+ logger.info(e);
+ }
+ }
+
+ @Test
+ public void testGetProviderComboBox(){
+ try {
+ stdPAPPolicy.setProviderComboBox("onap");
+ assertTrue(stdPAPPolicy.getProviderComboBox() != null);
+ } catch (Exception e) {
+ logger.info(e);
+ }
+ }
+
+ @Test
+ public void testGetRiskLevel(){
+ try {
+ stdPAPPolicy.setRiskLevel("test");
+ assertTrue(stdPAPPolicy.getRiskLevel() != null);
+ } catch (Exception e) {
+ logger.info(e);
+ }
+ }
+ @Test
+ public void testGetRiskType(){
+ try {
+ stdPAPPolicy.setRiskType("test");
+ assertTrue(stdPAPPolicy.getRiskType() != null);
+ } catch (Exception e) {
+ logger.info(e);
+ }
+
+ }
+
+ @Test
+ public void testGetRuleID(){
+ try {
+ stdPAPPolicy.setRuleID("MsLocation");
+ assertTrue(stdPAPPolicy.getRuleID() != null);
+ } catch (Exception e) {
+ logger.info(e);
+ }
+ }
+ @Test
+ public void testGetServiceType(){
+ try {
+ stdPAPPolicy.setServiceType("domain");
+ assertTrue(stdPAPPolicy.getServiceType() != null);
+ } catch (Exception e) {
+ logger.info(e);
+ }
+ }
+
+ @Test
+ public void testGetTTLDate(){
+ try {
+ stdPAPPolicy.setTTLDate("09/20/17");
+ assertTrue(stdPAPPolicy.getTTLDate() != null);
+ } catch (Exception e) {
+ logger.info(e);
+ }
+ }
+
+
+ @Test
+ public void testGetUuid(){
+ try {
+ stdPAPPolicy.setUuid("11212122");
+ assertTrue(stdPAPPolicy.getUuid() != null);
+ } catch (Exception e) {
+ logger.info(e);
+ }
+ }
+ @Test
+ public void testGetVersion(){
+ try {
+ stdPAPPolicy.setVersion("testv01");
+ assertTrue(stdPAPPolicy.getVersion() != null);
+ } catch (Exception e) {
+ logger.info(e);
+ }
+
+ }
+
+ @Test
+ public void testIsEditPolicy(){
+ try {
+ stdPAPPolicy.setEditPolicy(true);
+ assertTrue(stdPAPPolicy.isEditPolicy() == true);
+ } catch (Exception e) {
+ logger.info(e);
+ }
+ }
+ @Test
+ public void testToString(){
+ try {
+ assertTrue(stdPAPPolicy.toString() != null);
+ } catch (Exception e) {
+ logger.info(e);
+ }
+ }
+
+}
\ No newline at end of file
combiningAlgo2human.put("only-one-applicable", "to honour the result of the first successfully evaluated $placeholder$ in order");
}
- private Map<String, AttributeIdentifiers> attributeIdentifiersMap = new HashMap<String, AttributeIdentifiers>();
+ private Map<String, AttributeIdentifiers> attributeIdentifiersMap = new HashMap<>();
private final StringWriter stringWriter = new StringWriter();
private final PrintWriter htmlOut = new PrintWriter(stringWriter);
else
policySet(policySet, "li");
- if (policySet.getPolicySetOrPolicyOrPolicySetIdReference().size() > 0)
+ if (!policySet.getPolicySetOrPolicyOrPolicySetIdReference().isEmpty())
htmlOut.println("<ol>");
return super.onPreVisitPolicySet(parent, policySet);
LOGGER.trace("PolicySet: " + policySet.getPolicySetId() +
" Description: " + policySet.getDescription());
- if (policySet.getPolicySetOrPolicyOrPolicySetIdReference().size() > 0)
+ if (!policySet.getPolicySetOrPolicyOrPolicySetIdReference().isEmpty())
htmlOut.println("</ol>");
htmlOut.println("<p></p>");
}
if (policySet.getPolicySetOrPolicyOrPolicySetIdReference() != null &&
- policySet.getPolicySetOrPolicyOrPolicySetIdReference().size() > 0) {
+ !policySet.getPolicySetOrPolicyOrPolicySetIdReference().isEmpty()) {
String algoDesc = combiningAlgo2human.get(combiningAlgorithm);
if (algoDesc != null) {
algoDesc = algoDesc.replace("$placeholder$", "policy") + " (" + "<i>" + combiningAlgorithm + "</i>)";
policy(policy);
- if (policy.getCombinerParametersOrRuleCombinerParametersOrVariableDefinition().size() > 0)
+ if (!policy.getCombinerParametersOrRuleCombinerParametersOrVariableDefinition().isEmpty())
htmlOut.println("<ol type=\"i\">");
return super.onPreVisitPolicy(parent, policy);
LOGGER.trace("PolicySet: " + policy.getPolicyId() +
"Parent PolicySet: " + parent.getPolicySetId() + " Version: " + parent.getVersion());
- if (policy.getCombinerParametersOrRuleCombinerParametersOrVariableDefinition().size() > 0)
+ if (!policy.getCombinerParametersOrRuleCombinerParametersOrVariableDefinition().isEmpty())
htmlOut.println("</ol>");
htmlOut.println("<p></p>");
}
if (policy.getCombinerParametersOrRuleCombinerParametersOrVariableDefinition() != null &&
- policy.getCombinerParametersOrRuleCombinerParametersOrVariableDefinition().size() > 0) {
+ !policy.getCombinerParametersOrRuleCombinerParametersOrVariableDefinition().isEmpty()) {
String algoDesc = combiningAlgo2human.get(combiningAlgorithm);
if (algoDesc != null) {
algoDesc = algoDesc.replace("$placeholder$", "rule") + " (<i>" + combiningAlgorithm + "</i>)";
//
StdAttribute attribute = null;
AttributeValueType value = match.getAttributeValue();
- String attributeDataType = null;
+ String attributeDataType;
if (match.getAttributeDesignator() != null && value != null) {
AttributeDesignatorType designator = match.getAttributeDesignator();
attribute = new StdAttribute(new IdentifierImpl(designator.getCategory()),
}
private String removePrimitives(String in) {
- in = in.replace("string-", "");
- in = in.replace("integer-", "");
- in = in.replace("double-", "");
- in = in.replace("boolean-", "");
- return in;
+ String newIn = in;
+ newIn = newIn.replace("string-", "");
+ newIn = newIn.replace("integer-", "");
+ newIn = newIn.replace("double-", "");
+ newIn = newIn.replace("boolean-", "");
+ return newIn;
}
private String stringifyCondition(ConditionType condition) {