Skip to content

Commit 6edbe25

Browse files
committed
fix Taclet options activation
1 parent 3aeff06 commit 6edbe25

3 files changed

Lines changed: 19 additions & 13 deletions

File tree

key.core/src/main/java/de/uka/ilkd/key/proof/init/AbstractPO.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,6 @@ private Vertex getVertexFor(Pair<Sort, IObserverFunction> vertexCore, ClassAxiom
292292
*/
293293
private void registerClassAxiomTaclets(KeYJavaType selfKJT, InitConfig proofConfig) {
294294
final ImmutableSet<ClassAxiom> axioms = selectClassAxioms(selfKJT);
295-
var choices = Collections.unmodifiableSet(proofConfig.getActivatedChoices().toSet());
296295
for (ClassAxiom axiom : axioms) {
297296
final Vertex node = getVertexFor(axiom.getKJT().getSort(), axiom.getTarget(), axiom);
298297
if (node.index == -1) {
@@ -305,9 +304,9 @@ private void registerClassAxiomTaclets(KeYJavaType selfKJT, InitConfig proofConf
305304
proofConfig.getServices())) {
306305
assert axiomTaclet != null : "class axiom returned null taclet: " + axiom.getName();
307306
// only include if choices are appropriate
308-
if (axiomTaclet.getChoices().eval(choices)) {
309-
register(axiomTaclet, proofConfig);
310-
}
307+
// weigl: register always! choices are evaluated as late as possible.
308+
// This would technically allow to change Taclet options after loading.
309+
register(axiomTaclet, proofConfig);
311310
}
312311
}
313312

key.core/src/main/java/de/uka/ilkd/key/proof/init/InitConfig.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public class InitConfig {
7777
private Map<Taclet, TacletBuilder<? extends Taclet>> taclet2Builder = new LinkedHashMap<>();
7878

7979
/** HashMap for quick lookups taclet name->taclet */
80-
private Map<Name, Taclet> activatedTacletCache = null;
80+
private @Nullable Map<Name, Taclet> activatedTacletCache = null;
8181

8282
/** the fileRepo which is responsible for consistency between source code and proof */
8383
private FileRepo fileRepo;
@@ -125,7 +125,7 @@ public Profile getProfile() {
125125
public void addCategory2DefaultChoices(@NonNull Map<String, String> init) {
126126
boolean changed = false;
127127
for (final Map.Entry<String, String> entry : init.entrySet()) {
128-
final Choice c = choiceNS().lookup(new Name(entry.getKey()));
128+
final Choice c = choiceNS().lookup(new Name(entry.getValue()));
129129
if (c != null && !category2DefaultChoice.containsKey(c.category())) {
130130
changed = true;
131131
category2DefaultChoice.put(c.category(), c);

key.ui/src/main/java/de/uka/ilkd/key/gui/plugins/javac/JavacExtension.java

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -153,14 +153,21 @@ private void loadProof(Proof selectedProof) throws RuntimeException {
153153
lblStatus.setText("Javac runs");
154154
lblStatus.setIcon(ICON_WAIT.get(16));
155155

156-
CompletableFuture<List<PositionedIssueString>> task =
157-
JavaCompilerCheckFacade.check(mediator.getUI(), bootClassPath, classpath, javaPath);
156+
158157
try {
159-
task.thenAccept(it -> SwingUtilities.invokeLater(() -> {
160-
lblStatus.setText("Javac finished");
161-
data.issues = it;
162-
updateLabel(data);
163-
})).get();
158+
try {
159+
CompletableFuture<List<PositionedIssueString>> task =
160+
JavaCompilerCheckFacade.check(mediator.getUI(), bootClassPath, classpath,
161+
javaPath);
162+
163+
task.thenAccept(it -> SwingUtilities.invokeLater(() -> {
164+
lblStatus.setText("Javac finished");
165+
data.issues = it;
166+
updateLabel(data);
167+
})).get();
168+
} catch (IllegalArgumentException iae) {
169+
LOGGER.error("Javac check failed {}", iae.getMessage());
170+
}
164171
} catch (InterruptedException | ExecutionException ex) {
165172
throw new RuntimeException(ex);
166173
}

0 commit comments

Comments
 (0)