Use instanceof pattern checks
[mdsal.git] / binding / mdsal-binding-model-ri / src / main / java / org / opendaylight / mdsal / binding / model / ri / Types.java
index a97d96eb3c23bbbc4150f0f3f4b056e5f72c55ae..1936f9e3fe28f796643eb2ec6bfebc4214b5c707 100644 (file)
@@ -255,10 +255,9 @@ public final class Types {
         if (!type1.equals(type2)) {
             return false;
         }
-        if (type1 instanceof ParameterizedType) {
-            if (type2 instanceof ParameterizedType) {
-                return Arrays.equals(((ParameterizedType) type1).getActualTypeArguments(),
-                    ((ParameterizedType) type2).getActualTypeArguments());
+        if (type1 instanceof ParameterizedType param1) {
+            if (type2 instanceof ParameterizedType param2) {
+                return Arrays.equals(param1.getActualTypeArguments(), param2.getActualTypeArguments());
             }
             return false;
         }