Skip to content

Commit d171dcc

Browse files
committed
Delete deprecated methods
1 parent eb774c9 commit d171dcc

File tree

3 files changed

+9
-47
lines changed

3 files changed

+9
-47
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@
44

55
(In development)
66

7+
### Breaking Changes
8+
9+
The following methods have been removed:
10+
11+
* `kala.collection.CollectionLike::toImmutableSeq()`
12+
* `kala.collection.CollectionLike::toImmutableSet()`
13+
* `kala.collection.CollectionLike::toImmutableMap()`
14+
715
## 0.82.0
816

917
Release Date: 2025-02-13
@@ -35,6 +43,7 @@ Other changes:
3543
* The return type of `kala.collection.CollectionLike::associateBy(Function<E, K>, Function<K, V>)` changes to `ImmutableMap<K, V>`.
3644
* `kala.collection.CollectionLike::toImmutableSeq()` is deprecated for removal and is replaced by `toSeq()`.
3745
* `kala.collection.CollectionLike::toImmutableSet()` is deprecated for removal and is replaced by `toSet()`.
46+
* `kala.collection.CollectionLike::toImmutableMap()` is deprecated for removal.
3847

3948
## 0.81.0
4049

kala-collection-primitive/src/main/template/kala/collection/primitive/PrimitiveCollectionLike.java.ftl

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,6 @@ public interface ${Type}CollectionLike extends PrimitiveCollectionLike<${Wrapper
5151
return Immutable${Type}Seq.from(this);
5252
}
5353

54-
@Deprecated(forRemoval = true)
55-
default @NotNull Immutable${Type}Seq toImmutableSeq() {
56-
return toSeq();
57-
}
58-
5954
default @NotNull Immutable${Type}Array toImmutableArray() {
6055
return Immutable${Type}Array.from(this);
6156
}

kala-collection/src/main/java/kala/collection/CollectionLike.java

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@
1616
package kala.collection;
1717

1818
import kala.annotations.DelegateBy;
19-
import kala.annotations.ReplaceWith;
2019
import kala.collection.base.Traversable;
21-
import kala.collection.factory.MapFactory;
2220
import kala.collection.immutable.*;
2321
import kala.collection.mutable.MutableSeq;
2422
import kala.function.CheckedConsumer;
@@ -170,46 +168,6 @@ default int copyTo(@NotNull MutableSeq<? super E> dest, int destPos, int limit)
170168
return associate(value -> Tuple.of(keySelector.apply(value), valueTransform.apply(value)));
171169
}
172170

173-
//region Deprecated
174-
175-
@Deprecated(forRemoval = true)
176-
@ReplaceWith("toSeq()")
177-
default @NotNull ImmutableSeq<E> toImmutableSeq() {
178-
return toSeq();
179-
}
180-
181-
@Deprecated(forRemoval = true)
182-
@ReplaceWith("toSet()")
183-
default @NotNull ImmutableSet<E> toImmutableSet() {
184-
return toSet();
185-
}
186-
187-
@Deprecated(forRemoval = true)
188-
default <K, V> @NotNull ImmutableMap<K, V> toImmutableMap(CollectionLike<E /* ? extends java.util.Map.Entry<? extends K, ? extends V> */>this) {
189-
final int ks = knownSize();
190-
if (ks == 0) {
191-
return ImmutableMap.empty();
192-
}
193-
final Iterator<E> it = this.iterator();
194-
if (!it.hasNext()) {
195-
return ImmutableMap.empty();
196-
}
197-
198-
@SuppressWarnings({"unchecked", "rawtypes"}) final MapFactory<K, V, Object, ImmutableMap<K, V>> factory =
199-
(MapFactory) ImmutableMap.factory();
200-
final Object builder = factory.newBuilder();
201-
if (ks > 0) {
202-
factory.sizeHint(builder, ks);
203-
}
204-
while (it.hasNext()) {
205-
@SuppressWarnings("unchecked") final java.util.Map.Entry<K, V> v = (java.util.Map.Entry<K, V>) it.next();
206-
factory.addToBuilder(builder, v.getKey(), v.getValue());
207-
}
208-
return factory.build(builder);
209-
}
210-
211-
//endregion
212-
213171
@Override
214172
@ApiStatus.NonExtendable
215173
@DelegateBy("forEach(Consumer<E, Ex>)")

0 commit comments

Comments
 (0)