Eclipse中的Floodlight

时间:2014-05-21 10:48:18

标签: java generics

我跟随a guide试图通过eclipse管理泛光灯控制器。

在尝试使用以下代码定义Packets_in消息之前,一切似乎都正常工作:

@Override
public net.floodlightcontroller.core.IListener.Command receive(IOFSwitch sw, OFMessage msg, FloodlightContext cntx) {
    Ethernet eth =
            IFloodlightProviderService.bcStore.get(cntx,
                                        IFloodlightProviderService.CONTEXT_PI_PAYLOAD);

    Long sourceMACHash = Ethernet.toLong(eth.getSourceMACAddress());
    if (!macAddresses.contains(sourceMACHash)) {
        macAddresses.add(sourceMACHash);
        logger.info("MAC Address: {} seen on switch: {}",
                HexString.toHexString(sourceMACHash),
                sw.getId());
    }
    return Command.CONTINUE;

我在" .add"得到错误告诉我:

  

The method add(capture#3-of?) in the type Set<capture3#-of?> is not applicable for the arguments(long)

为什么会这样,我该如何解决?

0 个答案:

没有答案