X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=pcep%2Fbase-parser%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fprotocol%2Fpcep%2Fparser%2Fobject%2FPCEPProcTimeObjectParser.java;fp=pcep%2Fbase-parser%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fprotocol%2Fpcep%2Fparser%2Fobject%2FPCEPProcTimeObjectParser.java;h=b2f0b23faa164b20610b2a34041658c3fa32d07f;hb=59bd8a58570b93fef65340808e37cab3c6fced8c;hp=b1567c2a86bc79d76bfdedd6792bddfabee9607d;hpb=3b658310b793d4882ce59198a6d2563ce6ba114d;p=bgpcep.git diff --git a/pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/PCEPProcTimeObjectParser.java b/pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/PCEPProcTimeObjectParser.java index b1567c2a86..b2f0b23faa 100644 --- a/pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/PCEPProcTimeObjectParser.java +++ b/pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/PCEPProcTimeObjectParser.java @@ -16,7 +16,6 @@ import org.opendaylight.protocol.pcep.spi.ObjectSerializer; import org.opendaylight.protocol.pcep.spi.ObjectUtil; import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException; import org.opendaylight.protocol.util.BitArray; -import org.opendaylight.protocol.util.ByteBufWriteUtil; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Object; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.ObjectHeader; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.proc.time.object.ProcTime; @@ -50,18 +49,17 @@ public class PCEPProcTimeObjectParser extends CommonObjectParser implements Obje final BitArray flagBits = new BitArray(FLAGS); flagBits.set(E_FLAG_POSITION, procTime.isEstimated()); flagBits.toByteBuf(body); - ByteBufWriteUtil.writeUnsignedInt(procTime.getCurrentProcTime(), body); - ByteBufWriteUtil.writeUnsignedInt(procTime.getMinProcTime(), body); - ByteBufWriteUtil.writeUnsignedInt(procTime.getMaxProcTime(), body); - ByteBufWriteUtil.writeUnsignedInt(procTime.getAverageProcTime(), body); - ByteBufWriteUtil.writeUnsignedInt(procTime.getVarianceProcTime(), body); + ByteBufUtils.writeOrZero(body, procTime.getCurrentProcTime()); + ByteBufUtils.writeOrZero(body, procTime.getMinProcTime()); + ByteBufUtils.writeOrZero(body, procTime.getMaxProcTime()); + ByteBufUtils.writeOrZero(body, procTime.getAverageProcTime()); + ByteBufUtils.writeOrZero(body, procTime.getVarianceProcTime()); ObjectUtil.formatSubobject(TYPE, CLASS, object.isProcessingRule(), object.isIgnore(), body, buffer); } @Override public Object parseObject(final ObjectHeader header, final ByteBuf buffer) throws PCEPDeserializerException { - checkArgument(buffer != null && buffer.isReadable(), - "Array of bytes is mandatory. Can't be null or empty."); + checkArgument(buffer != null && buffer.isReadable(), "Array of bytes is mandatory. Can't be null or empty."); buffer.skipBytes(RESERVED); final BitArray flagBits = BitArray.valueOf(buffer, FLAGS);