简体   繁体   中英

Java error java.util.concurrent.ConcurrentHashMap.keySet

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());
          }
        }

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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM