Convert trivial CopyPolicy users to StatementPolicy
[yangtools.git] / yang / yang-parser-rfc7950 / src / main / java / org / opendaylight / yangtools / yang / parser / rfc7950 / stmt / position / PositionStatementSupport.java
index bd0a57179d7c74119e21fdea4835c4f3b03d6fbf..7e88042b19c85acfbfe83ebda76f502c56c80f44 100644 (file)
@@ -26,7 +26,7 @@ public final class PositionStatementSupport
     private static final PositionStatementSupport INSTANCE = new PositionStatementSupport();
 
     private PositionStatementSupport() {
-        super(YangStmtMapping.POSITION);
+        super(YangStmtMapping.POSITION, StatementPolicy.contextIndependent());
     }
 
     public static PositionStatementSupport getInstance() {
@@ -38,8 +38,7 @@ public final class PositionStatementSupport
         try {
             return Uint32.valueOf(value).intern();
         } catch (IllegalArgumentException e) {
-            throw new SourceException(String.format("Bit position value %s is not valid integer", value),
-                    ctx.getStatementSourceReference(), e);
+            throw new SourceException(ctx, e, "Bit position value %s is not valid integer", value);
         }
     }
 
@@ -60,14 +59,13 @@ public final class PositionStatementSupport
     }
 
     @Override
-    protected PositionEffectiveStatement createEmptyEffective(final PositionStatement declared) {
-        return new EmptyPositionEffectiveStatement(declared);
+    protected PositionEffectiveStatement createEffective(final PositionStatement declared,
+            final ImmutableList<? extends EffectiveStatement<?, ?>> substatements) {
+        return new RegularPositionEffectiveStatement(declared, substatements);
     }
 
     @Override
-    protected PositionEffectiveStatement createEffective(
-            final StmtContext<Uint32, PositionStatement, PositionEffectiveStatement> ctx,
-            final PositionStatement declared, final ImmutableList<? extends EffectiveStatement<?, ?>> substatements) {
-        return new RegularPositionEffectiveStatement(declared, substatements);
+    protected PositionEffectiveStatement createEmptyEffective(final PositionStatement declared) {
+        return new EmptyPositionEffectiveStatement(declared);
     }
 }
\ No newline at end of file