X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fweb%2Ftroubleshoot%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Ftroubleshoot%2Fweb%2FTroubleshoot.java;fp=opendaylight%2Fweb%2Ftroubleshoot%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Ftroubleshoot%2Fweb%2FTroubleshoot.java;h=a4083d162454938e63ffd53632fe81eb2fe217c4;hp=c2d96148793efe68a4b2b3a5c3131786668cc4df;hb=b7a34b47e39a9fe25617c9e536817858e58b2558;hpb=5384703a0df855832553100d29a82008dcfd92cb diff --git a/opendaylight/web/troubleshoot/src/main/java/org/opendaylight/controller/troubleshoot/web/Troubleshoot.java b/opendaylight/web/troubleshoot/src/main/java/org/opendaylight/controller/troubleshoot/web/Troubleshoot.java index c2d9614879..a4083d1624 100644 --- a/opendaylight/web/troubleshoot/src/main/java/org/opendaylight/controller/troubleshoot/web/Troubleshoot.java +++ b/opendaylight/web/troubleshoot/src/main/java/org/opendaylight/controller/troubleshoot/web/Troubleshoot.java @@ -32,6 +32,7 @@ import org.opendaylight.controller.sal.utils.EtherTypes; import org.opendaylight.controller.sal.utils.GlobalConstants; import org.opendaylight.controller.sal.utils.HexEncode; import org.opendaylight.controller.sal.utils.IPProtocols; +import org.opendaylight.controller.sal.utils.NetUtils; import org.opendaylight.controller.sal.utils.ServiceHelper; import org.opendaylight.controller.statisticsmanager.IStatisticsManager; import org.opendaylight.controller.switchmanager.ISwitchManager; @@ -288,26 +289,16 @@ public class Troubleshoot implements IOneWeb { if (match.isPresent(MatchType.TP_SRC)) { Short tpSrc = (Short) (flow.getMatch().getField(MatchType.TP_SRC) .getValue()); - if (tpSrc < 0) { - row.put(MatchType.TP_SRC.id(), - ((Integer) (tpSrc.intValue() & 0x7FFF | 0x8000)) - .toString()); - } else { - row.put(MatchType.TP_SRC.id(), tpSrc.toString()); - } + row.put(MatchType.TP_SRC.id(), + String.valueOf(NetUtils.getUnsignedShort(tpSrc))); } else { row.put(MatchType.TP_SRC.id(), "*"); } if (match.isPresent(MatchType.TP_DST)) { Short tpDst = (Short) (flow.getMatch().getField(MatchType.TP_DST) .getValue()); - if (tpDst < 0) { - row.put(MatchType.TP_DST.id(), - ((Integer) (tpDst.intValue() & 0x7FFF | 0x8000)) - .toString()); - } else { - row.put(MatchType.TP_DST.id(), tpDst.toString()); - } + row.put(MatchType.TP_DST.id(), + String.valueOf(NetUtils.getUnsignedShort(tpDst))); } else { row.put(MatchType.TP_DST.id(), "*"); }