Drop deprecated stuff in reactor.
This commit is contained in:
parent
b1f7ba4ecf
commit
e270655a7f
|
|
@ -70,11 +70,6 @@ internal class EvaluationSessionImpl private constructor (
|
|||
return this
|
||||
}
|
||||
|
||||
override fun withParam(key: String, param: Any): EvaluationSession.Config {
|
||||
this.parameters.put(ParameterKey.of(key, Any::class.java), param)
|
||||
return this
|
||||
}
|
||||
|
||||
override fun <T> withParameter(key: ParameterKey<T>, value: T): EvaluationSession.Config {
|
||||
this.parameters.put(key, value as Any)
|
||||
return this
|
||||
|
|
|
|||
|
|
@ -90,9 +90,6 @@ public abstract class EvaluationSession {
|
|||
|
||||
public abstract Config withFeedbackHandler(EvaluationFeedbackHandler handler);
|
||||
|
||||
@Deprecated
|
||||
public abstract Config withParam(String key, Object param);
|
||||
|
||||
public abstract EvaluationResult start();
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,10 +58,7 @@ public interface EvaluationTrace {
|
|||
|
||||
public void ask(boolean result, PredicateInvocation invocation) {
|
||||
}
|
||||
|
||||
public void failure(EvaluationFailureException fail) {
|
||||
}
|
||||
|
||||
|
||||
public void failure(EvaluationFailure failure) {
|
||||
}
|
||||
|
||||
|
|
@ -88,9 +85,6 @@ public interface EvaluationTrace {
|
|||
void tell(PredicateInvocation invocation);
|
||||
|
||||
void ask(boolean result, PredicateInvocation invocation);
|
||||
|
||||
@Deprecated
|
||||
void failure(EvaluationFailureException fail);
|
||||
|
||||
|
||||
void failure(EvaluationFailure failure);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,27 +32,6 @@ public abstract class Program {
|
|||
|
||||
public abstract String name();
|
||||
|
||||
/**
|
||||
* @deprecated no usages
|
||||
* @return
|
||||
*/
|
||||
@Deprecated
|
||||
public Iterable<ConstraintSymbol> constraintSymbols() { throw new UnsupportedOperationException (); }
|
||||
|
||||
/**
|
||||
* @deprecated no usages
|
||||
* @return
|
||||
*/
|
||||
@Deprecated
|
||||
public List<Class<?>> constraintArgumentTypes(ConstraintSymbol constraintSymbol) { throw new UnsupportedOperationException (); }
|
||||
|
||||
/**
|
||||
* @deprecated no usages
|
||||
* @return
|
||||
*/
|
||||
@Deprecated
|
||||
public Iterable<PredicateSymbol> predicateSymbols() { throw new UnsupportedOperationException (); }
|
||||
|
||||
public abstract Iterable<Handler> handlers();
|
||||
|
||||
public abstract List<?> instantiateArguments(List<?> arguments, LogicalContext logicalContext, InvocationContext invocationContext);
|
||||
|
|
|
|||
|
|
@ -42,11 +42,6 @@ public abstract class Rule {
|
|||
|
||||
public abstract Iterable<Predicate> guard();
|
||||
|
||||
@Deprecated
|
||||
public Iterable<AndItem> body() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public abstract Iterable<? extends Iterable<AndItem>> bodyAlternation();
|
||||
|
||||
public abstract Iterable<AndItem> all();
|
||||
|
|
|
|||
|
|
@ -96,17 +96,7 @@ class MockRule(
|
|||
class MockProgram(val name: String, val handlers: List<Handler>, val registry: MockConstraintRegistry) : Program() {
|
||||
|
||||
override fun name(): String = name
|
||||
|
||||
|
||||
override fun constraintSymbols(): Iterable<ConstraintSymbol> =
|
||||
registry.constraintSymbols()
|
||||
|
||||
override fun constraintArgumentTypes(constraintSymbol: ConstraintSymbol): List<Class<*>> =
|
||||
registry.constraintArgTypes(constraintSymbol)
|
||||
|
||||
override fun predicateSymbols(): Iterable<PredicateSymbol> =
|
||||
registry.predicateSymbols()
|
||||
|
||||
|
||||
override fun instantiateArguments(arguments: List<*>, logicalContext: LogicalContext, invocationContext: InvocationContext): List<*> =
|
||||
arguments.map { a ->
|
||||
if (a is MetaLogical<*>) logicalContext.variable(a)
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import jetbrains.mps.logic.reactor.core.ReactorLifecycle
|
|||
import jetbrains.mps.logic.reactor.evaluation.EvaluationSession
|
||||
import jetbrains.mps.logic.reactor.evaluation.StoreView
|
||||
import jetbrains.mps.logic.reactor.logical.Logical
|
||||
import jetbrains.mps.logic.reactor.program.Constraint
|
||||
import jetbrains.mps.logic.reactor.program.ConstraintSymbol
|
||||
import org.junit.AfterClass
|
||||
import org.junit.Assert.assertEquals
|
||||
|
|
@ -35,7 +36,9 @@ class TestProgram {
|
|||
for (h in handlers) {
|
||||
programBuilder.addHandler(h)
|
||||
}
|
||||
val session = EvaluationSession.newSession(programBuilder.program(name)).withParam("main", MockConstraint(ConstraintSymbol("main", 0))).start()
|
||||
val session = EvaluationSession.newSession(programBuilder.program(name))
|
||||
.withParameter(EvaluationSession.ParameterKey.of("main", Constraint::class.java), MockConstraint(ConstraintSymbol("main", 0)))
|
||||
.start()
|
||||
return session.storeView()
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue