More use of instanceof patterns
[yangtools.git] / binding / mdsal-binding-generator / src / main / java / org / opendaylight / mdsal / binding / generator / impl / reactor / Generator.java
index 66fdadaf8d1cdeae76fb59493616a37d8dbf1c6f..aecc4d92ec5be732fe12c13cf7a906e3e95d4aaa 100644 (file)
@@ -243,12 +243,10 @@ public abstract class Generator implements Iterable<Generator> {
             }
 
             // if we into a choice we need to follow the hierararchy of that choice
-            if (ancestor instanceof AbstractAugmentGenerator augment) {
-                final AbstractCompositeGenerator<?, ?> target = augment.targetGenerator();
-                if (target instanceof ChoiceGenerator) {
-                    ancestor = target;
-                    continue;
-                }
+            if (ancestor instanceof AbstractAugmentGenerator augment
+                && augment.targetGenerator() instanceof ChoiceGenerator targetChoice) {
+                ancestor = targetChoice;
+                continue;
             }
 
             break;