From 103831046faade05ce1ca8156b3e924977d13065 Mon Sep 17 00:00:00 2001 From: Jakub Toth Date: Wed, 8 Jun 2016 09:54:27 +0200 Subject: [PATCH 1/1] BUG-865: Remove reference to ExtendedType ExtendedTypes are no longer generated by the parser and the class has been deprecated. Remove references to it so it can be removed. Change-Id: Id74fd89b5a8dcd3489f4b0856716e39324a75cc9 Signed-off-by: Jakub Toth --- .../sal/rest/doc/impl/ModelGenerator.java | 24 +------------------ 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/restconf/sal-rest-docgen/src/main/java/org/opendaylight/netconf/sal/rest/doc/impl/ModelGenerator.java b/restconf/sal-rest-docgen/src/main/java/org/opendaylight/netconf/sal/rest/doc/impl/ModelGenerator.java index 04b80b94ce..63982faee6 100644 --- a/restconf/sal-rest-docgen/src/main/java/org/opendaylight/netconf/sal/rest/doc/impl/ModelGenerator.java +++ b/restconf/sal-rest-docgen/src/main/java/org/opendaylight/netconf/sal/rest/doc/impl/ModelGenerator.java @@ -49,7 +49,6 @@ import org.opendaylight.yangtools.yang.model.api.type.LengthConstraint; import org.opendaylight.yangtools.yang.model.api.type.StringTypeDefinition; import org.opendaylight.yangtools.yang.model.api.type.UnionTypeDefinition; import org.opendaylight.yangtools.yang.model.api.type.UnsignedIntegerTypeDefinition; -import org.opendaylight.yangtools.yang.model.util.ExtendedType; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -420,9 +419,7 @@ public class ModelGenerator { } private void processTypeDef(final TypeDefinition leafTypeDef, final JSONObject property) throws JSONException { - if (leafTypeDef instanceof ExtendedType) { - processExtendedType(leafTypeDef, property); - } else if (leafTypeDef instanceof BinaryTypeDefinition) { + if (leafTypeDef instanceof BinaryTypeDefinition) { processBinaryType((BinaryTypeDefinition) leafTypeDef, property); } else if (leafTypeDef instanceof BitsTypeDefinition) { processBitsType((BitsTypeDefinition) leafTypeDef, property); @@ -444,25 +441,6 @@ public class ModelGenerator { } } - private void processExtendedType(final TypeDefinition leafTypeDef, final JSONObject property) throws JSONException { - TypeDefinition leafBaseType = leafTypeDef.getBaseType(); - if (leafBaseType instanceof ExtendedType) { - // recursively process an extended type until we hit a base type - processExtendedType(leafBaseType, property); - } else { - List lengthConstraints = ((ExtendedType) leafTypeDef).getLengthConstraints(); - for (LengthConstraint lengthConstraint : lengthConstraints) { - Number min = lengthConstraint.getMin(); - Number max = lengthConstraint.getMax(); - property.putOpt(MIN_LENGTH_KEY, min); - property.putOpt(MAX_LENGTH_KEY, max); - } - String jsonType = jsonTypeFor(leafBaseType); - property.putOpt(TYPE_KEY, jsonType); - } - - } - private static void processBinaryType(final BinaryTypeDefinition binaryType, final JSONObject property) throws JSONException { property.put(TYPE_KEY, STRING); JSONObject media = new JSONObject(); -- 2.36.6