trafficcontrol-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject [incubator-trafficcontrol] 16/36: Fix Java PMD violations
Date Wed, 24 Jan 2018 17:23:25 GMT
This is an automated email from the ASF dual-hosted git repository.

elsloo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-trafficcontrol.git

commit d20eae653176d0855c261fda98657e5f66cce284
Author: Rawlin Peters <rawlin_peters@comcast.com>
AuthorDate: Wed Nov 1 14:36:15 2017 -0600

    Fix Java PMD violations
---
 .../cdn/traffic_control/traffic_router/core/loc/NetworkNode.java    | 6 +++---
 .../traffic_control/traffic_router/core/router/TrafficRouter.java   | 3 ++-
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/NetworkNode.java
b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/NetworkNode.java
index c852184..c098320 100644
--- a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/NetworkNode.java
+++ b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/loc/NetworkNode.java
@@ -138,7 +138,7 @@ public class NetworkNode implements Comparable<NetworkNode> {
 
     private static boolean addNetworkNodesToRoot(final SuperNode root, final String loc,
final JsonNode locData,
                                                  final Geolocation geolocation, final boolean
useDeep) {
-        CacheLocation deepLoc = new CacheLocation( "deep." + loc, geolocation != null ? geolocation
: new Geolocation(0.0, 0.0));  // TODO JvD
+        final CacheLocation deepLoc = new CacheLocation( "deep." + loc, geolocation != null
? geolocation : new Geolocation(0.0, 0.0));  // TODO JvD
         final Set<String> cacheNames = parseDeepCacheNames(locData);
 
         for (final String key : new String[]{"network6", "network"}) {
@@ -173,7 +173,7 @@ public class NetworkNode implements Comparable<NetworkNode> {
         return true;
     }
 
-    private static Set<String> parseDeepCacheNames(JsonNode locationData) {
+    private static Set<String> parseDeepCacheNames(final JsonNode locationData) {
         final Set<String> cacheNames = new HashSet<String>();
         final JsonNode cacheArray;
 
@@ -314,7 +314,7 @@ public class NetworkNode implements Comparable<NetworkNode> {
         clearCacheLocations(false);
     }
 
-    public void clearCacheLocations(boolean clearCachesOnly) {
+    public void clearCacheLocations(final boolean clearCachesOnly) {
         synchronized(this) {
             if (clearCachesOnly && cacheLocation != null) {
                 cacheLocation.clearCaches();
diff --git a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/router/TrafficRouter.java
b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/router/TrafficRouter.java
index 68dfb6b..91d3751 100644
--- a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/router/TrafficRouter.java
+++ b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/router/TrafficRouter.java
@@ -642,6 +642,7 @@ public class TrafficRouter {
 		return getCoverageZoneCacheLocation(ip, deliveryServiceId, false); // default is not deep
 	}
 
+	@SuppressWarnings({"PMD.CyclomaticComplexity", "PMD.NPathComplexity"})
 	public CacheLocation getCoverageZoneCacheLocation(final String ip, final String deliveryServiceId,
final boolean useDeep) {
 		NetworkNode networkNode;
 		if (useDeep) {
@@ -688,7 +689,7 @@ public class TrafficRouter {
 		return getClosestCacheLocation(cacheRegister.filterAvailableLocations(deliveryServiceId),
networkNode.getGeolocation(), cacheRegister.getDeliveryService(deliveryServiceId));
 	}
 
-	private void loadDeepCaches(NetworkNode networkNode, CacheLocation cacheLocation) {
+	private void loadDeepCaches(final NetworkNode networkNode, final CacheLocation cacheLocation)
{
 		if (networkNode.getDeepCacheNames() != null) {
 			for (final String deepCacheName : networkNode.getDeepCacheNames()) {
 				final Cache deepCache = cacheRegister.getCacheMap().get(deepCacheName);

-- 
To stop receiving notification emails like this one, please contact
elsloo@apache.org.

Mime
View raw message