Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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());
          }
        }
like image 539
Reptic Avatar asked Jan 11 '23 07:01

Reptic


1 Answers

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>
like image 198
Jens Avatar answered Jan 26 '23 01:01

Jens