Skip to content

Commit

Permalink
TranscoderRegistry.getTranscodeClasses method should return registere…
Browse files Browse the repository at this point in the history
…d transcode classes
  • Loading branch information
fightyz committed Apr 12, 2021
1 parent a2b759b commit ce8b5e3
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public synchronized <Z, R> ResourceTranscoder<Z, R> get(
}

@NonNull
@SuppressWarnings("unchecked")
public synchronized <Z, R> List<Class<R>> getTranscodeClasses(
@NonNull Class<Z> resourceClass, @NonNull Class<R> transcodeClass) {
List<Class<R>> transcodeClasses = new ArrayList<>();
Expand All @@ -70,8 +71,9 @@ public synchronized <Z, R> List<Class<R>> getTranscodeClasses(
}

for (Entry<?, ?> entry : transcoders) {
if (entry.handles(resourceClass, transcodeClass)) {
transcodeClasses.add(transcodeClass);
if (entry.handles(resourceClass, transcodeClass)
&& !transcodeClasses.contains((Class<R>) entry.toClass)) {
transcodeClasses.add((Class<R>) entry.toClass);
}
}

Expand Down

0 comments on commit ce8b5e3

Please sign in to comment.