Solve Java warning "Raw use of parameterized class"

This commit is contained in:
Stypox 2022-02-19 16:53:37 +01:00
parent af80d96b9e
commit 62abfa96b8
No known key found for this signature in database
GPG key ID: 4BDF1B40A49FDD23
13 changed files with 74 additions and 67 deletions

View file

@ -17,7 +17,8 @@ import java.util.List;
import io.reactivex.rxjava3.core.SingleObserver;
import io.reactivex.rxjava3.disposables.Disposable;
abstract class AbstractInfoPlayQueue<T extends ListInfo, U extends InfoItem> extends PlayQueue {
abstract class AbstractInfoPlayQueue<T extends ListInfo<StreamInfoItem>, U extends InfoItem>
extends PlayQueue {
boolean isInitial;
private boolean isComplete;
@ -51,7 +52,7 @@ abstract class AbstractInfoPlayQueue<T extends ListInfo, U extends InfoItem> ext
}
SingleObserver<T> getHeadListObserver() {
return new SingleObserver<T>() {
return new SingleObserver<>() {
@Override
public void onSubscribe(@NonNull final Disposable d) {
if (isComplete || !isInitial || (fetchReactor != null
@ -85,8 +86,8 @@ abstract class AbstractInfoPlayQueue<T extends ListInfo, U extends InfoItem> ext
};
}
SingleObserver<ListExtractor.InfoItemsPage> getNextPageObserver() {
return new SingleObserver<ListExtractor.InfoItemsPage>() {
SingleObserver<ListExtractor.InfoItemsPage<StreamInfoItem>> getNextPageObserver() {
return new SingleObserver<>() {
@Override
public void onSubscribe(@NonNull final Disposable d) {
if (isComplete || isInitial || (fetchReactor != null
@ -98,7 +99,8 @@ abstract class AbstractInfoPlayQueue<T extends ListInfo, U extends InfoItem> ext
}
@Override
public void onSuccess(@NonNull final ListExtractor.InfoItemsPage result) {
public void onSuccess(
@NonNull final ListExtractor.InfoItemsPage<StreamInfoItem> result) {
if (!result.hasNextPage()) {
isComplete = true;
}
@ -130,10 +132,8 @@ abstract class AbstractInfoPlayQueue<T extends ListInfo, U extends InfoItem> ext
private static List<PlayQueueItem> extractListItems(final List<StreamInfoItem> infoItems) {
final List<PlayQueueItem> result = new ArrayList<>();
for (final InfoItem stream : infoItems) {
if (stream instanceof StreamInfoItem) {
result.add(new PlayQueueItem((StreamInfoItem) stream));
}
for (final StreamInfoItem stream : infoItems) {
result.add(new PlayQueueItem(stream));
}
return result;
}