Skip to content

Commit b7c549d

Browse files
Use pattern matching to avoid cast
1 parent 98b3b55 commit b7c549d

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

key.ui/src/main/java/de/uka/ilkd/key/gui/WindowUserInterfaceControl.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,7 @@ private void taskFinishedInternal(TaskFinishedInfo info) {
200200
}
201201
}
202202
mainWindow.displayResults(info.toString());
203-
} else if (info != null && info.getSource() instanceof ProofMacro) {
204-
ProofMacro macro = (ProofMacro) info.getSource();
203+
} else if (info != null && info.getSource() instanceof ProofMacro macro) {
205204
if (!isAtLeastOneMacroRunning()) {
206205
mainWindow.hideStatusProgress();
207206
assert info instanceof ProofMacroFinishedInfo;
@@ -222,7 +221,7 @@ private void taskFinishedInternal(TaskFinishedInfo info) {
222221
}
223222
}
224223
}
225-
} else if (info != null && info.getSource() instanceof ProblemLoader) {
224+
} else if (info != null && info.getSource() instanceof ProblemLoader problemLoader) {
226225
resetStatus(this);
227226
Throwable result = (Throwable) info.getResult();
228227
if (info.getResult() != null) {
@@ -233,7 +232,6 @@ private void taskFinishedInternal(TaskFinishedInfo info) {
233232
} else {
234233
KeYMediator mediator = mainWindow.getMediator();
235234
mediator.getNotationInfo().refresh(mediator.getServices());
236-
ProblemLoader problemLoader = (ProblemLoader) info.getSource();
237235
if (problemLoader.hasProofScript()) {
238236
Pair<String, Location> scriptAndLoc;
239237
try {

0 commit comments

Comments
 (0)