Changes for Checkstyle 8.32 71/109371/1
authorTaka Cho <takamune.cho@att.com>
Fri, 19 Jun 2020 18:55:44 +0000 (14:55 -0400)
committerTaka Cho <takamune.cho@att.com>
Fri, 19 Jun 2020 18:56:09 +0000 (14:56 -0400)
Issue-ID: POLICY-2188
Change-Id: I64a115240a71e5014db9cfb66747887e156afb50
Signed-off-by: Taka Cho <takamune.cho@att.com>
17 files changed:
applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/XacmlPolicyUtils.java
applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/std/StdCombinedPolicyRequest.java
applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/std/StdMatchableTranslator.java
applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/std/StdOnapPip.java
applications/common/src/test/java/org/onap/policy/pdp/xacml/application/common/ToscaDictionaryTest.java
applications/common/src/test/java/org/onap/policy/pdp/xacml/application/common/XacmlPolicyUtilsTest.java
applications/common/src/test/java/org/onap/policy/pdp/xacml/application/common/matchable/MatchablePolicyTypeTest.java
applications/guard/src/main/java/org/onap/policy/xacml/pdp/application/guard/CoordinationDirective.java
applications/guard/src/main/java/org/onap/policy/xacml/pdp/application/guard/CoordinationGuardTranslator.java
applications/guard/src/main/java/org/onap/policy/xacml/pdp/application/guard/GuardPdpApplication.java
applications/guard/src/main/java/org/onap/policy/xacml/pdp/application/guard/GuardPolicyRequest.java
applications/guard/src/test/java/org/onap/policy/xacml/pdp/application/guard/GuardTranslatorTest.java
applications/monitoring/src/test/java/cucumber/Stepdefs.java
applications/optimization/src/test/java/org/onap/policy/xacml/pdp/application/optimization/OptimizationPdpApplicationTest.java
main/src/main/java/org/onap/policy/pdpx/main/rest/XacmlPdpRestController.java
main/src/test/java/org/onap/policy/pdpx/main/comm/XacmlPdpHearbeatPublisherTest.java
main/src/test/java/org/onap/policy/pdpx/main/rest/TestStatisticsReport.java

index c845709..1babe30 100644 (file)
@@ -25,7 +25,6 @@ package org.onap.policy.pdp.xacml.application.common;
 import com.att.research.xacml.api.Identifier;
 import com.att.research.xacml.util.XACMLPolicyWriter;
 import com.att.research.xacml.util.XACMLProperties;
-
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileOutputStream;
@@ -40,13 +39,11 @@ import java.util.Properties;
 import java.util.Set;
 import java.util.StringJoiner;
 import java.util.stream.Collectors;
-
 import oasis.names.tc.xacml._3_0.core.schema.wd_17.IdReferenceType;
 import oasis.names.tc.xacml._3_0.core.schema.wd_17.ObjectFactory;
 import oasis.names.tc.xacml._3_0.core.schema.wd_17.PolicySetType;
 import oasis.names.tc.xacml._3_0.core.schema.wd_17.PolicyType;
 import oasis.names.tc.xacml._3_0.core.schema.wd_17.TargetType;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
index d7cf3f2..4b50e72 100644 (file)
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * ONAP
  * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2019-2020 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.
@@ -30,11 +30,9 @@ import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Map;
 import java.util.Map.Entry;
-
 import lombok.Getter;
 import lombok.Setter;
 import lombok.ToString;
-
 import org.onap.policy.models.decisions.concepts.DecisionRequest;
 
 @Getter
index 11a45e0..1a5e9dd 100644 (file)
@@ -446,7 +446,7 @@ public class StdMatchableTranslator  extends StdBaseTranslator implements Matcha
             // contain potential matchables
             //
             if (propertyValue instanceof List) {
-                for (Object listValue : ((List<?>)propertyValue)) {
+                for (Object listValue : ((List<?>) propertyValue)) {
                     if (listValue instanceof Map) {
                         fillTargetTypeWithMatchables(target, matchablePolicyType, (Map<String, Object>) listValue);
                     }
index 5c99932..244c4bc 100644 (file)
@@ -34,14 +34,12 @@ import com.att.research.xacml.std.datatypes.DataTypes;
 import com.att.research.xacml.std.pip.StdMutablePIPResponse;
 import com.att.research.xacml.std.pip.StdPIPRequest;
 import com.att.research.xacml.std.pip.engines.StdConfigurableEngine;
-
 import java.math.BigInteger;
 import java.util.Base64;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Iterator;
 import java.util.Properties;
-
 import javax.persistence.EntityManager;
 import javax.persistence.Persistence;
 import org.onap.policy.pdp.xacml.application.common.ToscaDictionary;
index b6a7ae2..251c971 100644 (file)
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * ONAP
  * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2019-2020 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.
@@ -27,7 +27,6 @@ import static org.junit.Assert.assertTrue;
 
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Modifier;
-
 import org.junit.Test;
 
 public class ToscaDictionaryTest {
index 05d796e..fbfde1a 100644 (file)
@@ -48,7 +48,6 @@ import oasis.names.tc.xacml._3_0.core.schema.wd_17.PolicySetType;
 import oasis.names.tc.xacml._3_0.core.schema.wd_17.PolicyType;
 import oasis.names.tc.xacml._3_0.core.schema.wd_17.RuleType;
 import oasis.names.tc.xacml._3_0.core.schema.wd_17.TargetType;
-
 import org.junit.BeforeClass;
 import org.junit.ClassRule;
 import org.junit.Test;
index c23f702..cd28bdd 100644 (file)
@@ -286,7 +286,7 @@ public class MatchablePolicyTypeTest implements MatchableCallback {
                 // contain potential matchables
                 //
                 if (propertyValue instanceof List) {
-                    for (Object listValue : ((List<?>)propertyValue)) {
+                    for (Object listValue : ((List<?>) propertyValue)) {
                         if (listValue instanceof Map) {
                             generateTargetType(target, matchablePolicyType, (Map<String, Object>) listValue);
                         }
index 91f8ed2..0a583d4 100644 (file)
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * guard
  * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2019-2020 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.
@@ -22,7 +22,6 @@ package org.onap.policy.xacml.pdp.application.guard;
 
 import java.io.Serializable;
 import java.util.List;
-
 import lombok.Data;
 
 @Data
index 1929131..d20a25f 100644 (file)
@@ -25,7 +25,6 @@ package org.onap.policy.xacml.pdp.application.guard;
 import com.att.research.xacml.api.Request;
 import com.att.research.xacml.api.Response;
 import com.att.research.xacml.util.XACMLPolicyScanner;
-
 import java.io.ByteArrayInputStream;
 import java.io.File;
 import java.io.FileInputStream;
index b4e431c..9f95476 100644 (file)
@@ -25,7 +25,6 @@ package org.onap.policy.xacml.pdp.application.guard;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
-
 import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyTypeIdentifier;
 import org.onap.policy.pdp.xacml.application.common.ToscaPolicyTranslator;
 import org.onap.policy.pdp.xacml.application.common.std.StdXacmlApplicationServiceProvider;
@@ -96,7 +95,7 @@ public class GuardPdpApplication extends StdXacmlApplicationServiceProvider {
     @Override
     protected ToscaPolicyTranslator getTranslator(String type) {
         LOGGER.debug("Policy type {}", type);
-        if ( type.contains("coordination") ) {
+        if (type.contains("coordination")) {
             LOGGER.debug("returning coordinationTranslator");
             return coordinationTranslator;
         } else {
index 66a34b9..c516877 100644 (file)
@@ -26,13 +26,10 @@ import com.att.research.xacml.std.annotations.XACMLAction;
 import com.att.research.xacml.std.annotations.XACMLRequest;
 import com.att.research.xacml.std.annotations.XACMLResource;
 import com.att.research.xacml.std.annotations.XACMLSubject;
-
 import java.util.Map;
-
 import lombok.Getter;
 import lombok.Setter;
 import lombok.ToString;
-
 import org.onap.policy.models.decisions.concepts.DecisionRequest;
 import org.onap.policy.pdp.xacml.application.common.ToscaPolicyConversionException;
 
index d5dd16b..6f7edac 100644 (file)
@@ -260,8 +260,8 @@ public class GuardTranslatorTest {
             if (! (rule instanceof RuleType)) {
                 continue;
             }
-            assertThat(((RuleType)rule).getCondition()).isNotNull();
-            assertThat(((RuleType)rule).getCondition().getExpression()).isNotNull();
+            assertThat(((RuleType) rule).getCondition()).isNotNull();
+            assertThat(((RuleType) rule).getCondition().getExpression()).isNotNull();
         }
     }
 
@@ -272,7 +272,7 @@ public class GuardTranslatorTest {
             if (! (rule instanceof RuleType)) {
                 continue;
             }
-            for (AnyOfType anyOf : ((RuleType)rule).getTarget().getAnyOf()) {
+            for (AnyOfType anyOf : ((RuleType) rule).getTarget().getAnyOf()) {
                 assertThat(anyOf.getAllOf()).isNotEmpty();
                 for (AllOfType allOf : anyOf.getAllOf()) {
                     assertThat(allOf.getMatch()).isNotEmpty();
@@ -302,7 +302,7 @@ public class GuardTranslatorTest {
             }
             assertThat(((RuleType) rule).getTarget()).isNotNull();
             assertThat(((RuleType) rule).getTarget().getAnyOf()).hasSize(1);
-            for (AnyOfType anyOf : ((RuleType)rule).getTarget().getAnyOf()) {
+            for (AnyOfType anyOf : ((RuleType) rule).getTarget().getAnyOf()) {
                 assertThat(anyOf.getAllOf()).isNotEmpty();
                 for (AllOfType allOf : anyOf.getAllOf()) {
                     assertThat(allOf.getMatch()).isNotEmpty();
index 3c09932..0a1d333 100644 (file)
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * ONAP
  * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2019-2020 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.
@@ -26,11 +26,9 @@ import com.att.research.xacml.std.annotations.XACMLAction;
 import com.att.research.xacml.std.annotations.XACMLRequest;
 import com.att.research.xacml.std.annotations.XACMLResource;
 import com.att.research.xacml.std.annotations.XACMLSubject;
-
 import io.cucumber.java.en.Given;
 import io.cucumber.java.en.Then;
 import io.cucumber.java.en.When;
-
 import org.junit.ClassRule;
 import org.junit.rules.TemporaryFolder;
 
@@ -222,4 +220,4 @@ public class Stepdefs {
         }).doesNotThrowAnyException();
         */
     }
-}
\ No newline at end of file
+}
index 031ef33..8886af2 100644 (file)
@@ -279,7 +279,7 @@ public class OptimizationPdpApplicationTest {
         //
         // Add US to the geography list
         //
-        ((List<String>)baseRequest.getResource().get("geography")).add("US");
+        ((List<String>) baseRequest.getResource().get("geography")).add("US");
         //
         // Ask for a decision for default US Policy
         //
@@ -301,7 +301,7 @@ public class OptimizationPdpApplicationTest {
         //
         // Add vCPE to the service list
         //
-        ((List<String>)baseRequest.getResource().get("services")).add("vCPE");
+        ((List<String>) baseRequest.getResource().get("services")).add("vCPE");
         //
         // Ask for a decision for default US policy for vCPE service
         //
@@ -324,7 +324,7 @@ public class OptimizationPdpApplicationTest {
         //
         // Add vG to the resource list
         //
-        ((List<String>)baseRequest.getResource().get("resources")).add("vG");
+        ((List<String>) baseRequest.getResource().get("resources")).add("vG");
         //
         // Ask for a decision for default US service vCPE resource vG policy
         //
@@ -347,7 +347,7 @@ public class OptimizationPdpApplicationTest {
         //
         // Add gold as a scope
         //
-        ((List<String>)baseRequest.getContext().get("subscriberName")).add("subscriber_a");
+        ((List<String>) baseRequest.getContext().get("subscriberName")).add("subscriber_a");
         //
         // Ask for a decision for specific US vCPE vG gold
         //
@@ -371,8 +371,8 @@ public class OptimizationPdpApplicationTest {
         //
         // Add platinum to the scope list: this is now gold OR platinum
         //
-        ((List<String>)baseRequest.getResource().get("scope")).remove("gold");
-        ((List<String>)baseRequest.getContext().get("subscriberName")).add("subscriber_x");
+        ((List<String>) baseRequest.getResource().get("scope")).remove("gold");
+        ((List<String>) baseRequest.getContext().get("subscriberName")).add("subscriber_x");
         //
         // Ask for a decision for specific US vCPE vG (gold or platinum)
         //
@@ -396,9 +396,9 @@ public class OptimizationPdpApplicationTest {
         //
         // Add gold as a scope
         //
-        ((List<String>)baseRequest.getResource().get("scope")).remove("gold");
-        ((List<String>)baseRequest.getResource().get("scope")).remove("platinum");
-        ((List<String>)baseRequest.getContext().get("subscriberName")).remove("subscriber_a");
+        ((List<String>) baseRequest.getResource().get("scope")).remove("gold");
+        ((List<String>) baseRequest.getResource().get("scope")).remove("platinum");
+        ((List<String>) baseRequest.getContext().get("subscriberName")).remove("subscriber_a");
         //
         // Ask for a decision for specific US vCPE vG gold
         //
@@ -552,11 +552,11 @@ public class OptimizationPdpApplicationTest {
 
     @SuppressWarnings("unchecked")
     private void cleanOutResources() {
-        ((List<String>)baseRequest.getResource().get("scope")).clear();
-        ((List<String>)baseRequest.getResource().get("services")).clear();
-        ((List<String>)baseRequest.getResource().get("resources")).clear();
-        ((List<String>)baseRequest.getResource().get("geography")).clear();
-        if (((List<String>)baseRequest.getResource().get("policy-type")) != null) {
+        ((List<String>) baseRequest.getResource().get("scope")).clear();
+        ((List<String>) baseRequest.getResource().get("services")).clear();
+        ((List<String>) baseRequest.getResource().get("resources")).clear();
+        ((List<String>) baseRequest.getResource().get("geography")).clear();
+        if (((List<String>) baseRequest.getResource().get("policy-type")) != null) {
             baseRequest.getResource().remove("policy-type");
         }
     }
index ad6784b..fad1d3d 100644 (file)
@@ -96,7 +96,7 @@ public class XacmlPdpRestController {
                     @ResponseHeader(name = "X-ONAP-RequestID",
                             description = "Used to track REST transactions for logging purpose",
                             response = UUID.class)},
-            authorizations = @Authorization(value = "basicAuth"), tags = {"HealthCheck",},
+            authorizations = @Authorization(value = "basicAuth"), tags = {"HealthCheck", },
             extensions = {@Extension(name = "interface info",
                     properties = {@ExtensionProperty(name = "pdpx-version", value = "1.0.0"),
                             @ExtensionProperty(name = "last-mod-release", value = "Dublin")})})
@@ -128,7 +128,7 @@ public class XacmlPdpRestController {
                     @ResponseHeader(name = "X-ONAP-RequestID",
                             description = "Used to track REST transactions for logging purpose",
                             response = UUID.class)},
-            authorizations = @Authorization(value = "basicAuth"), tags = {"Statistics",},
+            authorizations = @Authorization(value = "basicAuth"), tags = {"Statistics", },
             extensions = {@Extension(name = "interface info",
                     properties = {@ExtensionProperty(name = "pdpx-version", value = "1.0.0"),
                             @ExtensionProperty(name = "last-mod-release", value = "Dublin")})})
@@ -167,7 +167,7 @@ public class XacmlPdpRestController {
                     @ResponseHeader(name = "X-ONAP-RequestID",
                             description = "Used to track REST transactions for logging purpose",
                             response = UUID.class)},
-            authorizations = @Authorization(value = "basicAuth"), tags = {"Decision",},
+            authorizations = @Authorization(value = "basicAuth"), tags = {"Decision", },
             extensions = {@Extension(name = "interface info",
                     properties = {@ExtensionProperty(name = "pdpx-version", value = "1.0.0"),
                             @ExtensionProperty(name = "last-mod-release", value = "Dublin")})})
@@ -219,7 +219,7 @@ public class XacmlPdpRestController {
                     @ResponseHeader(name = "X-ONAP-RequestID",
                             description = "Used to track REST transactions for logging purpose",
                             response = UUID.class)},
-            authorizations = @Authorization(value = "basicAuth"), tags = {"Decision",},
+            authorizations = @Authorization(value = "basicAuth"), tags = {"Decision", },
             extensions = {@Extension(name = "interface info",
                     properties = {@ExtensionProperty(name = "pdpx-version", value = "1.0.0"),
                             @ExtensionProperty(name = "last-mod-release", value = "Frankfurt")})})
index f391605..550091f 100644 (file)
@@ -170,7 +170,7 @@ public class XacmlPdpHearbeatPublisherTest {
         // create a plain listener to test the "real" makeTimer() method
         publisher = new XacmlPdpHearbeatPublisher(client, state);
 
-        assertThatCode( () -> {
+        assertThatCode(() -> {
             publisher.start();
             publisher.restart(100L);
             publisher.terminate();
index d26d08d..550248b 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2019-2020 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.
@@ -27,7 +27,6 @@ import com.openpojo.validation.rule.impl.GetterMustExistRule;
 import com.openpojo.validation.rule.impl.SetterMustExistRule;
 import com.openpojo.validation.test.impl.GetterTester;
 import com.openpojo.validation.test.impl.SetterTester;
-
 import org.junit.Test;
 import org.onap.policy.common.utils.test.ToStringTester;
 import org.onap.policy.pdpx.main.rest.model.StatisticsReport;