From 425eac12fbd0db3b1e6ee590aacf68ed783a4abd Mon Sep 17 00:00:00 2001 From: melvin Date: Wed, 13 Jun 2012 23:18:55 +0800 Subject: [PATCH] throw an exception if unable to find MagicPermanentStatic to remove --- src/magic/model/mstatic/MagicPermanentStaticMap.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/magic/model/mstatic/MagicPermanentStaticMap.java b/src/magic/model/mstatic/MagicPermanentStaticMap.java index a2b2c3f4dc..a4a5895c32 100644 --- a/src/magic/model/mstatic/MagicPermanentStaticMap.java +++ b/src/magic/model/mstatic/MagicPermanentStaticMap.java @@ -80,9 +80,10 @@ public class MagicPermanentStaticMap { final MagicPermanentStatic permanentStatic = iterator.next(); if (permanentStatic.getPermanent() == permanent && permanentStatic.getStatic() == mstatic) { iterator.remove(); - break; + return; } } + throw new RuntimeException("nothing to remove"); } public Collection remove(final MagicPermanent permanent, final Collection statics) {