X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=yang%2Fyang-data-impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fyangtools%2Fyang%2Fdata%2Fimpl%2Fcodec%2FInt16StringCodec.java;h=5a0e90794a817841acb6f737773b3d8dc8aa307b;hb=f27abd088b1cf645824e2b332c58541519822cb3;hp=f686cc3816bb741b7932567c57e04f6428d303f1;hpb=787c24e36acd4fbe6ec837e3e039ff91be22599a;p=yangtools.git diff --git a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/codec/Int16StringCodec.java b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/codec/Int16StringCodec.java index f686cc3816..5a0e90794a 100644 --- a/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/codec/Int16StringCodec.java +++ b/yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/codec/Int16StringCodec.java @@ -1,9 +1,9 @@ /* - * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved. + * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved. * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0 which accompanies this distribution, - * and is available at http://www.eclipse.org/legal/epl-v10.html + * This program and the accompanying materials are made available under the terms of the Eclipse + * Public License v1.0 which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html */ package org.opendaylight.yangtools.yang.data.impl.codec; @@ -11,13 +11,14 @@ import com.google.common.base.Optional; import org.opendaylight.yangtools.yang.data.api.codec.Int16Codec; import org.opendaylight.yangtools.yang.model.api.type.IntegerTypeDefinition; -class Int16StringCodec extends AbstractIntegerStringCodec implements - Int16Codec { +class Int16StringCodec extends AbstractIntegerStringCodec implements Int16Codec { protected Int16StringCodec(final Optional typeDef) { - super(typeDef, Short.class); + super(typeDef, extractRange(typeDef.orNull()), Short.class); } + + @Override public final Short deserialize(final String stringRepresentation, final int base) { return Short.valueOf(stringRepresentation, base); @@ -27,4 +28,9 @@ class Int16StringCodec extends AbstractIntegerStringCodec