private static void declareOriginalConditionEvaluation( Factory factory, LoopMonitor monitor, While loop, CtIf newIf) { CtLocalVariable<Boolean> localVariable = newLocalVariableDeclaration( factory, boolean.class, originalConditionName(monitor), loop.loopingCondition()); insertBeforeUnderSameParent(localVariable, newIf); }
private static void traceReachableValues( LoopMonitor monitor, While loop, CtIf newIf, CollectableValueFinder finder, RuntimeValues<?> runtimeValues) { Multimap<String, String> getters = finder.accessibleGetters(); Collection<String> reachableVariables = finder.reachableVariables(); Map<String, String> inputMap = MetaMap.autoMap(reachableVariables); inputMap.put(loop.loopingCondition(), originalConditionName(monitor)); RuntimeValuesInstrumenter.runtimeCollectionBefore( newIf, inputMap, getters, conditionName(monitor), runtimeValues); }