Code cleanup (sal-common-util) 74/46074/3
authorStephen Kitt <skitt@redhat.com>
Thu, 22 Sep 2016 15:45:37 +0000 (17:45 +0200)
committerTom Pantelis <tpanteli@brocade.com>
Fri, 23 Sep 2016 18:42:02 +0000 (18:42 +0000)
* Remove unnecessary type specifiers (use Java 7 <>)
* Inline unnecessary temporary variables

Change-Id: I8600988018fd15a711ba4b63d8b947127fb64d7a
Signed-off-by: Stephen Kitt <skitt@redhat.com>
opendaylight/md-sal/sal-common-util/src/main/java/org/opendaylight/controller/sal/common/util/Rpcs.java

index 69458b6a6d6e3492ed484c958bd3380e049bff0f..9ffe8ab0644036ed210e0151514312374c2d08a1 100644 (file)
@@ -23,18 +23,16 @@ import com.google.common.collect.ImmutableList;
 public class Rpcs {
 
     public static <T> RpcResult<T> getRpcResult(boolean successful) {
-        RpcResult<T> ret = new RpcResultTO<T>(successful, null, ImmutableList.<RpcError>of());
-        return ret;
+        return new RpcResultTO<>(successful, null, ImmutableList.of());
     }
 
     public static <T> RpcResult<T> getRpcResult(boolean successful, T result,
             Collection<RpcError> errors) {
-        RpcResult<T> ret = new RpcResultTO<T>(successful, result, errors);
-        return ret;
+        return new RpcResultTO<>(successful, result, errors);
     }
 
     public static <T> RpcResult<T> getRpcResult(boolean successful, Collection<RpcError> errors) {
-        return new RpcResultTO<T>(successful, null, errors);
+        return new RpcResultTO<>(successful, null, errors);
     }
 
     private static class RpcResultTO<T> implements RpcResult<T>, Serializable, Immutable {