Remove AbstractStatementSupport.createEmptyDeclared()
[yangtools.git] / yang / yang-parser-rfc7950 / src / main / java / org / opendaylight / yangtools / yang / parser / rfc7950 / stmt / type / EnumSpecificationSupport.java
index 7cb8792ec00556354557b9518f3dea359b019238..55496111a19817358c5a3df497a7bad18b791604 100644 (file)
@@ -42,14 +42,12 @@ final class EnumSpecificationSupport
     @Override
     protected EnumSpecification createDeclared(final StmtContext<String, EnumSpecification, ?> ctx,
             final ImmutableList<? extends DeclaredStatement<?>> substatements) {
+        if (substatements.isEmpty()) {
+            throw noEnum(ctx);
+        }
         return new EnumSpecificationImpl(ctx.getRawArgument(), substatements);
     }
 
-    @Override
-    protected EnumSpecification createEmptyDeclared(final StmtContext<String, EnumSpecification, ?> ctx) {
-        throw noEnum(ctx);
-    }
-
     @Override
     protected EffectiveStatement<String, EnumSpecification> createEffective(
             final Current<String, EnumSpecification> stmt,