Skip to content

Commit

Permalink
WINDUP-1548 Show "DOES THIS STILL HAPPEN?" only once (from Parameteri…
Browse files Browse the repository at this point in the history
…zedGraphCondition) (#1141)
  • Loading branch information
OndraZizka authored and jsight committed Jul 12, 2017
1 parent 71fb5a4 commit 6a2a911
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.logging.Level;
import java.util.logging.Logger;

import org.jboss.forge.furnace.util.Iterators;
Expand All @@ -30,6 +31,8 @@ public abstract class ParameterizedGraphCondition extends GraphCondition impleme
static final String RESULT_VALUE_STORE_MAP_KEY = ParameterizedGraphCondition.class.getName()
+ "_resultParameterValueStoreMap";

private static boolean paramValueStoreOverwritten = false;

protected abstract String getVarname();

protected abstract boolean evaluateWithValueStore(GraphRewrite event, EvaluationContext context, FrameContext frame);
Expand Down Expand Up @@ -110,8 +113,15 @@ public void rollback()
ParameterValueStore last = resultSetStores.put(frame, valueStore);
if (last != null)
{
// WHY DOES THIS HAPPEN?
LOG.warning("DOES THIS STILL HAPPEN?");
// FIXME: WHY DOES THIS HAPPEN?
LOG.log(paramValueStoreOverwritten ? Level.FINER : Level.WARNING,
String.format("resultSetStores already had a ParameterValueStore for frame:"
+ "\n %s"
+ "\n Old: %s"
+ "\n New: %s"
+ "%s", frame.toPrettyString(), last, frame,
paramValueStoreOverwritten ? "" : "\nFurther incidents will be logged at FINER level as it may occur millions of times."));
paramValueStoreOverwritten = true;
}
}
}
Expand Down

0 comments on commit 6a2a911

Please sign in to comment.