Skip to content

Commit 61dc738

Browse files
committed
fix checkerframework regressions
1 parent 7ae5388 commit 61dc738

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

key.util/src/main/java/org/key_project/util/collection/ImmutableArray.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,10 @@ public String toString() {
159159

160160
@Override
161161
public Iterator<S> iterator() {
162-
return new ArrayIterator<>(this);
162+
return new ArrayIterator<S>(this);
163163
}
164164

165-
private static class ArrayIterator<T> implements Iterator<T> {
165+
private static class ArrayIterator<T extends @Nullable Object> implements Iterator<T> {
166166

167167
private int i = 0;
168168
private final ImmutableArray<T> coll;

key.util/src/main/java/org/key_project/util/collection/Immutables.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ private Immutables() {
163163
*
164164
* @return the view onto the iterable as an immutable list
165165
*/
166-
public static <T> ImmutableList<T> createListFrom(Iterable<? extends T> iterable) {
166+
public static <T extends @Nullable Object> ImmutableList<T> createListFrom(Iterable<? extends T> iterable) {
167167
ImmutableList<T> result = ImmutableSLList.nil();
168168
for (T t : iterable) {
169169
result = result.prepend(t);

key.util/src/test/java/org/key_project/util/collection/TestImmutables.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -148,20 +148,20 @@ public void testEqualityEmpty() {
148148

149149
@Test
150150
public void testIntersectEmpty() {
151-
ImmutableSet<Object> s0 = DefaultImmutableSet.nil();
152-
ImmutableSet<Object> s1 = DefaultImmutableSet.nil().add("1");
153-
ImmutableSet<Object> s2 = DefaultImmutableSet.nil().add("2");
151+
var s0 = DefaultImmutableSet.nil();
152+
var s1 = DefaultImmutableSet.nil().add("1");
153+
var s2 = DefaultImmutableSet.nil().add("2");
154154

155-
ImmutableSet<Object> sIntersect = s1.intersect(s2);
155+
var sIntersect = s1.intersect(s2);
156156
assertEquals(0, sIntersect.size());
157157
assertEquals(s0, sIntersect);
158158
}
159159

160160
@Test
161161
public void testHashCodes() {
162162

163-
ImmutableSet<Object> s1 = DefaultImmutableSet.nil().add("one").add("two");
164-
ImmutableSet<Object> s2 = DefaultImmutableSet.nil().add("two").add("one");
163+
var s1 = DefaultImmutableSet.nil().add("one").add("two");
164+
var s2 = DefaultImmutableSet.nil().add("two").add("one");
165165

166166
assertEquals(s1, s2);
167167
int hash1 = s1.hashCode();

0 commit comments

Comments
 (0)