Fixed SchemaPath resolution for base YANG types.
[controller.git] / opendaylight / sal / yang-prototype / yang / yang-model-util / src / main / java / org / opendaylight / controller / yang / model / util / Int32.java
index da356309a504735f5644eced96fbebedd81addf2..fb777c5992399aed543986684f2e94acd0531cd6 100644 (file)
@@ -30,15 +30,23 @@ public class Int32 extends AbstractSignedInteger {
     private Integer defaultValue = null;
     private static final String description =
             "int32  represents integer values between -2147483648 and 2147483647, inclusively.";
+    private final IntegerTypeDefinition baseType;
+
+    private Int32() {
+        super(name, description, Integer.MIN_VALUE, Integer.MAX_VALUE, "");
+        this.baseType = this;
+    }
 
     public Int32(final List<String> actualPath, final URI namespace,
             final Date revision) {
         super(actualPath, namespace, revision, name, description, Integer.MIN_VALUE, Integer.MAX_VALUE, "");
+        this.baseType = new Int32();
     }
 
     public Int32(final List<String> actualPath, final URI namespace,
             final Date revision, final Integer defaultValue) {
         super(actualPath, namespace, revision, name, description, Integer.MIN_VALUE, Integer.MAX_VALUE, "");
+        this.baseType = new Int32();
         this.defaultValue = defaultValue;
     }
 
@@ -46,6 +54,7 @@ public class Int32 extends AbstractSignedInteger {
             final Date revision, final List<RangeConstraint> rangeStatements,
             final String units, final Integer defaultValue) {
         super(actualPath, namespace, revision, name, description, rangeStatements, units);
+        this.baseType = new Int32();
         this.defaultValue = defaultValue;
     }
 
@@ -57,7 +66,7 @@ public class Int32 extends AbstractSignedInteger {
      */
     @Override
     public IntegerTypeDefinition getBaseType() {
-        return this;
+        return baseType;
     }
 
     /*