throw an exception if unable to find MagicPermanentStatic to remove

master
melvin 2012-06-13 23:18:55 +08:00
parent 587fdd428e
commit 425eac12fb
1 changed files with 2 additions and 1 deletions

View File

@ -80,9 +80,10 @@ public class MagicPermanentStaticMap {
final MagicPermanentStatic permanentStatic = iterator.next(); final MagicPermanentStatic permanentStatic = iterator.next();
if (permanentStatic.getPermanent() == permanent && permanentStatic.getStatic() == mstatic) { if (permanentStatic.getPermanent() == permanent && permanentStatic.getStatic() == mstatic) {
iterator.remove(); iterator.remove();
break; return;
} }
} }
throw new RuntimeException("nothing to remove");
} }
public Collection<MagicPermanentStatic> remove(final MagicPermanent permanent, final Collection<MagicStatic> statics) { public Collection<MagicPermanentStatic> remove(final MagicPermanent permanent, final Collection<MagicStatic> statics) {