checkstyle: ParameterName 07/49507/1
authorIsaku Yamahata <isaku.yamahata@intel.com>
Fri, 16 Dec 2016 23:43:06 +0000 (15:43 -0800)
committerIsaku Yamahata <isaku.yamahata@intel.com>
Sat, 17 Dec 2016 02:19:24 +0000 (18:19 -0800)
Fix PrameterName checkstyle violation and enable it.

Change-Id: I7f06123fcd1fb5a6db1f47672c788aeb521814ec
Signed-off-by: Isaku Yamahata <isaku.yamahata@intel.com>
integration/test/src/test/java/org/opendaylight/neutron/e2etest/ITNeutronE2E.java
neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronSubnetIPAllocationPool.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/AbstractNeutronNorthbound.java
parent/checkstyle-suppressions.xml

index 2e8fa5815242419bfd301c7bfa02997c8aaf731b..b4b54205aa01724c3656feba7e00b8ed214cb80d 100644 (file)
@@ -162,9 +162,9 @@ public class ITNeutronE2E {
         return httpConn;
     }
 
-    static void test_create(String url_s, String content, String context) {
+    static void test_create(String urlStr, String content, String context) {
         try {
-            URL url = new URL(url_s);
+            URL url = new URL(urlStr);
             HttpURLConnection httpConn = httpURLConnectionFactoryPost(url, content);
             Assert.assertEquals(context, 201, httpConn.getResponseCode());
         } catch (IOException e) {
@@ -172,9 +172,9 @@ public class ITNeutronE2E {
         }
     }
 
-    static void test_create(String url_s, int responseCode, String content, String context) {
+    static void test_create(String urlStr, int responseCode, String content, String context) {
         try {
-            URL url = new URL(url_s);
+            URL url = new URL(urlStr);
             HttpURLConnection httpConn = httpURLConnectionFactoryPost(url, content);
             Assert.assertEquals(context, responseCode, httpConn.getResponseCode());
         } catch (IOException e) {
@@ -182,9 +182,9 @@ public class ITNeutronE2E {
         }
     }
 
-    static void test_modify(String url_s, String content, String context) {
+    static void test_modify(String urlStr, String content, String context) {
         try {
-            URL url = new URL(url_s);
+            URL url = new URL(urlStr);
             HttpURLConnection httpConn = httpURLConnectionFactoryPut(url, content);
             Assert.assertEquals(context, 200, httpConn.getResponseCode());
         } catch (IOException e) {
@@ -192,9 +192,9 @@ public class ITNeutronE2E {
         }
     }
 
-    static void test_fetch(String url_s, int responseCode, String context) {
+    static void test_fetch(String urlStr, int responseCode, String context) {
         try {
-            URL url = new URL(url_s);
+            URL url = new URL(urlStr);
             HttpURLConnection httpConn = httpURLConnectionFactoryGet(url);
             Assert.assertEquals(context, responseCode, httpConn.getResponseCode());
         } catch (IOException e) {
@@ -202,18 +202,18 @@ public class ITNeutronE2E {
         }
     }
 
-    static void test_fetch(String url_s, String context) {
-        test_fetch(url_s, 200, context);
+    static void test_fetch(String urlStr, String context) {
+        test_fetch(urlStr, 200, context);
     }
 
-    static void test_fetch(String url_s, boolean positiveTest, String context) {
+    static void test_fetch(String urlStr, boolean positiveTest, String context) {
         int responseCode = positiveTest ? 200 : 404;
-        test_fetch(url_s, responseCode, context);
+        test_fetch(urlStr, responseCode, context);
     }
 
-    static void test_delete(String url_s, int responseCode, String context) {
+    static void test_delete(String urlStr, int responseCode, String context) {
         try {
-            URL url = new URL(url_s);
+            URL url = new URL(urlStr);
             HttpURLConnection httpConn = httpURLConnectionFactoryDelete(url);
             Assert.assertEquals(context, responseCode, httpConn.getResponseCode());
         } catch (IOException e) {
@@ -221,19 +221,19 @@ public class ITNeutronE2E {
         }
     }
 
-    static void test_delete(String url_s, String context) {
-        test_delete(url_s, 204, context);
+    static void test_delete(String urlStr, String context) {
+        test_delete(urlStr, 204, context);
     }
 
-    static void test_delete_404(String url_s, String context) {
-        test_delete(url_s, 404, context);
+    static void test_delete_404(String urlStr, String context) {
+        test_delete(urlStr, 404, context);
     }
 
-    private static String fetchResponse(String url_s, String context) {
+    private static String fetchResponse(String urlStr, String context) {
         StringBuffer response = new StringBuffer();
 
         try {
-            URL url = new URL(url_s);
+            URL url = new URL(urlStr);
             HttpURLConnection httpConn = httpURLConnectionFactoryGet(url);
             Assert.assertEquals(context, 200, httpConn.getResponseCode());
             BufferedReader in = new BufferedReader(new InputStreamReader(httpConn.getInputStream()));
@@ -248,14 +248,14 @@ public class ITNeutronE2E {
         return response.toString();
     }
 
-    static JsonObject test_fetch_gson(String url_s, String context) {
-        String response = fetchResponse(url_s, context);
+    static JsonObject test_fetch_gson(String urlStr, String context) {
+        String response = fetchResponse(urlStr, context);
         Gson gson = new Gson();
         return gson.fromJson(response, JsonObject.class);
     }
 
-    static void test_fetch_collection_response(String url_s, String collectionName, String context) {
-        String response = fetchResponse(url_s, context);
+    static void test_fetch_collection_response(String urlStr, String collectionName, String context) {
+        String response = fetchResponse(urlStr, context);
 
         //Collection is returned in an array. Format - {"collectionName": [{...}, {....}]}
         Gson gson = new Gson();
@@ -271,7 +271,7 @@ public class ITNeutronE2E {
     }
 
     // Helper function - content is json used during create. Format - {"Name": {...}}
-    static void test_fetch_with_one_query_item(String url_s, String content, String collectionName) {
+    static void test_fetch_with_one_query_item(String urlStr, String content, String collectionName) {
         Gson gson = new Gson();
         JsonObject jsonObjectInput = gson.fromJson(content, JsonObject.class);
         Set<Map.Entry<String, JsonElement>> entrySet = jsonObjectInput.entrySet();
@@ -283,7 +283,7 @@ public class ITNeutronE2E {
             if (jsonElementValue.isJsonPrimitive() && (!jsonElementValue.isJsonNull())) {
                 String valueStr = jsonElementValue.getAsString();
                 valueStr = valueStr.replaceAll("\\s+", "+");
-                String queryUrl = url_s + "?" + key + "=" + valueStr;
+                String queryUrl = urlStr + "?" + key + "=" + valueStr;
                 String context = collectionName + " " + key + "=" + jsonElementValue.toString() + " Get Failed";
                 test_fetch_collection_response(queryUrl, collectionName, context);
             }
index 375a62383187f4c73131efff6f199719f98e35d3..4bb5deffd0b469083ea81d1754ed3053bcb4bcde 100644 (file)
@@ -170,9 +170,9 @@ public final class NeutronSubnetIPAllocationPool implements Serializable {
      *            high-endian representation of the IPv4 address as a long
      * @return IPv4 address in dotted decimal format
      */
-    static String bigIntegerToIP(BigInteger b) {
+    static String bigIntegerToIP(BigInteger ipv4BigInteger) {
         try {
-            return Inet6Address.getByAddress(b.toByteArray()).getHostAddress();
+            return Inet6Address.getByAddress(ipv4BigInteger.toByteArray()).getHostAddress();
         } catch (UnknownHostException e) {
             LOGGER.error("bigIntegerToIP", e);
             return "ERROR";
@@ -182,17 +182,17 @@ public final class NeutronSubnetIPAllocationPool implements Serializable {
     /*
      * helper routine used by longToIP
      */
-    public static String join(String[] r, String separator) {
-        if (r.length == 0) {
+    public static String join(String[] strings, String separator) {
+        if (strings.length == 0) {
             return "";
         }
         StringBuilder sb = new StringBuilder();
         int i;
-        for (i = 0; i < r.length - 1; i++) {
-            sb.append(r[i]);
+        for (i = 0; i < strings.length - 1; i++) {
+            sb.append(strings[i]);
             sb.append(separator);
         }
-        return sb.toString() + r[i];
+        return sb.toString() + strings[i];
     }
 
     /*
index 9ff8078dd7a3b0da43c9ed758f654c93293439d9..638f77e6f4b64ab0a5d09d2d2b0d83bc3df864e1 100644 (file)
@@ -20,7 +20,7 @@ import org.opendaylight.neutron.spi.NeutronCRUDInterfaces;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public abstract class AbstractNeutronNorthbound<T extends INeutronObject<T>, NeutronRequest extends INeutronRequest<T>,
+public abstract class AbstractNeutronNorthbound<T extends INeutronObject<T>, R extends INeutronRequest<T>,
         I extends INeutronCRUD<T>> {
     private static final Logger LOGGER = LoggerFactory.getLogger(AbstractNeutronNorthbound.class);
 
@@ -40,18 +40,18 @@ public abstract class AbstractNeutronNorthbound<T extends INeutronObject<T>, Neu
 
     protected abstract String getResourceName();
 
-    private NeutronRequest newNeutronRequest(T o) {
-        // return new NeutronRequest(o);
+    private R newNeutronRequest(T neutronObject) {
+        // return new R(neutronObject);
 
         ParameterizedType parameterizedType = (ParameterizedType) getClass().getGenericSuperclass();
         // argumentClass = T.class
         Class<T> argumentClass = (Class<T>) parameterizedType.getActualTypeArguments()[0];
         // cls = NeturonRequest.class
-        Class<NeutronRequest> cls = (Class<NeutronRequest>) parameterizedType.getActualTypeArguments()[1];
+        Class<R> cls = (Class<R>) parameterizedType.getActualTypeArguments()[1];
         try {
-            // ctor = NeutronRequest constructor
-            Constructor<NeutronRequest> ctor = cls.getDeclaredConstructor(argumentClass);
-            return ctor.newInstance(o);
+            // ctor = R constructor
+            Constructor<R> ctor = cls.getDeclaredConstructor(argumentClass);
+            return ctor.newInstance(neutronObject);
         } catch (NoSuchMethodException | InstantiationException
                  | IllegalAccessException | InvocationTargetException e) {
             // This case shouldn't happen
@@ -87,7 +87,7 @@ public abstract class AbstractNeutronNorthbound<T extends INeutronObject<T>, Neu
         }
     }
 
-    protected Response create(final NeutronRequest input) {
+    protected Response create(final R input) {
         I neutronCRUD = getNeutronCRUD();
         if (input.isSingleton()) {
             T singleton = input.getSingleton();
@@ -109,7 +109,7 @@ public abstract class AbstractNeutronNorthbound<T extends INeutronObject<T>, Neu
     protected void updateDelta(String uuid, T delta, T original) {
     }
 
-    protected Response update(String uuid, final NeutronRequest input) {
+    protected Response update(String uuid, final R input) {
         I neutronCRUD = getNeutronCRUD();
         if (!input.isSingleton()) {
             throw new BadRequestException("Only singleton edit supported");
index f6b04c7a1beb98219a39322f6e164102e2970472..232a26fa474597e9cc3b54bb8f98588e9cfbf012 100644 (file)
@@ -21,9 +21,6 @@
   <suppress checks="AbbreviationAsWordInName"
             files="."
              />
-  <suppress checks="ParameterName"
-            files="."
-             />
   <suppress checks="LocalVariableName"
             files="."
              />