File tree Expand file tree Collapse file tree 3 files changed +9
-9
lines changed
main/java/org/key_project/util/collection
test/java/org/key_project/util/collection Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Original file line number Diff line number Diff 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 ;
Original file line number Diff line number Diff 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 );
Original file line number Diff line number Diff 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 ();
You can’t perform that action at this time.
0 commit comments