Since the field is unused, reduce confusion by not propagating it.
Change-Id: Id541143dffc536b4487628c301950d5f4d98385e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
* Create a new inference action to be executed during specified phase. The action cannot be cancelled
* and will be executed even if its definition remains incomplete.
*
* Create a new inference action to be executed during specified phase. The action cannot be cancelled
* and will be executed even if its definition remains incomplete.
*
- * @param phase Target phase
+ * @param phase Target phase in which the action will resolved.
* @return A new action builder.
* @throws NullPointerException if the specified phase is null
*/
* @return A new action builder.
* @throws NullPointerException if the specified phase is null
*/
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-class ModifierImpl implements ModelActionBuilder {
+final class ModifierImpl implements ModelActionBuilder {
private static final Logger LOG = LoggerFactory.getLogger(ModifierImpl.class);
private final Set<AbstractPrerequisite<?>> unsatisfied = new HashSet<>(1);
private final Set<AbstractPrerequisite<?>> mutations = new HashSet<>(1);
private static final Logger LOG = LoggerFactory.getLogger(ModifierImpl.class);
private final Set<AbstractPrerequisite<?>> unsatisfied = new HashSet<>(1);
private final Set<AbstractPrerequisite<?>> mutations = new HashSet<>(1);
- private final ModelProcessingPhase phase;
private InferenceAction action;
private boolean actionApplied = false;
private InferenceAction action;
private boolean actionApplied = false;
- ModifierImpl(final ModelProcessingPhase phase) {
- this.phase = Preconditions.checkNotNull(phase);
- }
-
private <D> AbstractPrerequisite<D> addReq(final AbstractPrerequisite<D> prereq) {
LOG.trace("Modifier {} adding prerequisite {}", this, prereq);
unsatisfied.add(prereq);
private <D> AbstractPrerequisite<D> addReq(final AbstractPrerequisite<D> prereq) {
LOG.trace("Modifier {} adding prerequisite {}", this, prereq);
unsatisfied.add(prereq);
return unsatisfied.isEmpty();
}
return unsatisfied.isEmpty();
}
- ModelProcessingPhase getPhase() {
- return phase;
- }
-
boolean isApplied() {
return actionApplied;
}
boolean isApplied() {
return actionApplied;
}
@SuppressWarnings("unchecked")
@Override
public boolean phaseFinished(final StatementContextBase<?, ?, ?> context, final ModelProcessingPhase phase) {
@SuppressWarnings("unchecked")
@Override
public boolean phaseFinished(final StatementContextBase<?, ?, ?> context, final ModelProcessingPhase phase) {
- return resolvePrereq((C) (context));
+ return resolvePrereq((C) context);
}
ModelActionBuilder newInferenceAction(final ModelProcessingPhase phase) {
}
ModelActionBuilder newInferenceAction(final ModelProcessingPhase phase) {
- final ModifierImpl action = new ModifierImpl(phase);
+ final ModifierImpl action = new ModifierImpl();
modifiers.put(phase, action);
return action;
}
modifiers.put(phase, action);
return action;
}