Generalize findFirstEffectiveSubstatement() 52/86852/1
authorRobert Varga <robert.varga@pantheon.tech>
Fri, 10 Jan 2020 22:43:20 +0000 (23:43 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Sat, 11 Jan 2020 22:52:31 +0000 (23:52 +0100)
There is no point in restricting what instances we can seach for,
make sure we can work with any class.

Change-Id: Ia8834fd5a7550295b861d3494b5a343d760d3e86
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 974385ed778393e2b28c3ef771ced6c3337c543c)

yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/meta/EffectiveStatement.java

index e002c41f99259ad2222d3a987e64707351fced2a..ffe9065197d46f2238b855f07808507eae1578b0 100644 (file)
@@ -88,8 +88,7 @@ public interface EffectiveStatement<A, D extends DeclaredStatement<A>> extends M
      * @return First effective substatement, or empty if no match is found.
      */
     @Beta
-    default <T extends EffectiveStatement<?, ?>> Optional<T> findFirstEffectiveSubstatement(
-            final @NonNull Class<T> type) {
+    default <T> Optional<T> findFirstEffectiveSubstatement(final @NonNull Class<T> type) {
         return effectiveSubstatements().stream().filter(type::isInstance).findFirst().map(type::cast);
     }