for (Enumeration j = entity.getAmmo(); j.hasMoreElements(); ) { Mounted m = (Mounted)j.nextElement();
for (Mounted m : entity.getAmmo()) {
    private void resolveAmmoDumps() {        Report r;        for (Enumeration i = game.getEntities(); i.hasMoreElements();) {            Entity entity = (Entity)i.nextElement();            for (Enumeration j = entity.getAmmo(); j.hasMoreElements(); ) {                Mounted m = (Mounted)j.nextElement();                if (m.isPendingDump()) {                    //report dumping next round                    r = new Report(5110);                    r.subject = entity.getId();                    r.addDesc(entity);                    r.add(m.getName());                    addReport(r);                    //update status                    m.setPendingDump(false);                    m.setDumping(true);                }                else if (m.isDumping()) {                    //report finished dumping                    r = new Report(5115);                    r.subject = entity.getId();                    r.addDesc(entity);                    r.add(m.getName());                    addReport(r);                    //update status                    m.setDumping(false);                    m.setShotsLeft(0);                }            }            entity.reloadEmptyWeapons();        }    }