Java error java.util.concurrent.ConcurrentHashMap.keySet

泪湿孤枕 提交于 2019-11-29 22:18:34

问题


Hey guy's am getting this error: Can you guy's possibly try to fix this? or see whats wrong post a fix or something

Thanks alot guy's :)

Exception in thread "ExtensionHandler-1" java.lang.NoSuchMethodE
rror: java.util.concurrent.ConcurrentHashMap.keySet()Ljava/util/concurrent/Concu
rrentHashMap$KeySetView;
        at aerivial.requests.aqw.GetAction.process(GetAction.java:196)
        at it.gotoandplay.smartfoxserver.controllers.ExtensionHandler.processEve
nt(ExtensionHandler.java:535)
        at it.gotoandplay.smartfoxserver.controllers.ExtensionHandler.run(Extens
ionHandler.java:344)
        at java.lang.Thread.run(Thread.java:619)

The error Code:

        ConcurrentHashMap tgtBuffDebuffs = (ConcurrentHashMap)userTgt.properties.get(Users.BUFFS_DEBUFFS);

        for (Iterator i = tgtBuffDebuffs.keySet().iterator(); i.hasNext(); ) { int auraId = ((Integer)i.next());
          Aura aura = (Aura)World.instance.auras.get(Integer.valueOf(auraId));
          if ((aura.getDamage() >= 0.0D) && (!aura.getCategory().equals("d"))) {
            damage = (int)(damage * aura.getDamage());
          }
        }

回答1:


Looks like you have a library which need java8 and you run under a version lower than 8.

In java 8 the api has changed:

In java 8 the keySet method returned an object

ConcurrentHashMap.KeySetView<K,V>

In java 7

Set<K>


来源:https://stackoverflow.com/questions/24448723/java-error-java-util-concurrent-concurrenthashmap-keyset

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!