Skip to content

Commit 4aebcdf

Browse files
committed
spotless & NPE
1 parent c7f630c commit 4aebcdf

File tree

28 files changed

+216
-259
lines changed

28 files changed

+216
-259
lines changed

key.core/src/main/java/de/uka/ilkd/key/pp/SequentPrintFilter.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ public ImmutableList<SequentPrintFilterEntry> getFilteredSucc() {
8282
* entries.
8383
*/
8484
protected void filterIdentity() {
85+
if(originalSequent==null) {
86+
return;
87+
}
88+
8589
antec = ImmutableSLList.nil();
8690
Iterator<SequentFormula> it = originalSequent.antecedent().iterator();
8791
while (it.hasNext()) {

key.ui/src/main/java/de/uka/ilkd/key/core/KeYMediator.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import de.uka.ilkd.key.control.ProofControl;
1717
import de.uka.ilkd.key.gui.GUIListener;
1818
import de.uka.ilkd.key.gui.UserActionListener;
19+
import de.uka.ilkd.key.gui.actions.MainWindowAction;
1920
import de.uka.ilkd.key.gui.actions.useractions.UserAction;
2021
import de.uka.ilkd.key.gui.notification.events.NotificationEvent;
2122
import de.uka.ilkd.key.gui.notification.events.ProofClosedNotificationEvent;
@@ -719,7 +720,7 @@ public void enableWhenProofLoaded(final Action a) {
719720
addKeYSelectionListener(new KeYSelectionListener() {
720721
@Override
721722
public void selectedProofChanged(KeYSelectionEvent<Proof> e) {
722-
a.setEnabled(e.getSource().getSelectedProof() != null);
723+
a.setEnabled(e.source().getSelectedProof() != null);
723724
}
724725
});
725726
}
@@ -735,7 +736,7 @@ public void enableWhenProofLoaded(final javax.swing.AbstractButton a) {
735736

736737
@Override
737738
public void selectedProofChanged(KeYSelectionEvent<Proof> e) {
738-
a.setEnabled(e.getSource().getSelectedProof() != null);
739+
a.setEnabled(e.source().getSelectedProof() != null);
739740
}
740741
});
741742
}

key.ui/src/main/java/de/uka/ilkd/key/core/KeYSelectionEvent.java

Lines changed: 8 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -6,52 +6,20 @@
66

77
/**
88
* An event that indicates that the users focused node or proof has changed
9+
*
10+
* @param source the source of this event
11+
* @param previousSelection the previously selected item
12+
* @param currentSelection the previously selected item
913
*/
10-
11-
public class KeYSelectionEvent<Sel> {
12-
13-
/** the source of this event */
14-
private final KeYSelectionModel source;
15-
16-
/** the previously selected item */
17-
private final Sel previousSelection;
18-
19-
/**
20-
* creates a new SelectedNodeEvent
21-
*
22-
* @param source the SelectedNodeModel where the event had its origin
23-
* @param previousSelection the previous selected item
24-
*/
25-
public KeYSelectionEvent(KeYSelectionModel source, Sel previousSelection) {
26-
this.source = source;
27-
this.previousSelection = previousSelection;
28-
}
29-
30-
/**
31-
* creates a new SelectedNodeEvent
32-
*
33-
* @param source the SelectedNodeModel where the event had its origin
34-
*/
35-
public KeYSelectionEvent(KeYSelectionModel source) {
36-
this(source, null);
37-
}
38-
39-
14+
public record KeYSelectionEvent<Sel>(
15+
KeYSelectionModel source, Sel previousSelection, Sel currentSelection) {
4016
/**
4117
* returns the KeYSelectionModel that caused this event
4218
*
4319
* @return the KeYSelectionModel that caused this event
4420
*/
45-
public KeYSelectionModel getSource() {
21+
@Override
22+
public KeYSelectionModel source() {
4623
return source;
4724
}
48-
49-
/**
50-
* returns the previous selected item
51-
*
52-
* @return the previous selected item
53-
*/
54-
public Sel getPreviousSelection() {
55-
return previousSelection;
56-
}
5725
}

key.ui/src/main/java/de/uka/ilkd/key/core/KeYSelectionListener.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,7 @@
99

1010
/**
1111
* The KeYSelectionListener is notified if the proof or the node the user works with has changed.
12-
*
13-
* @deprecated weigl: Please use switch to the {@link java.beans.PropertyChangeListener} interface
14-
* of
15-
* {@link KeYSelectionModel}.
1612
*/
17-
@Deprecated
1813
public interface KeYSelectionListener {
1914

2015
/**

0 commit comments

Comments
 (0)