Skip to content

Commit

Permalink
Merge pull request #4546 from fightyz:fix_registered_transcode_classe…
Browse files Browse the repository at this point in the history
…s_fun

PiperOrigin-RevId: 381908159
  • Loading branch information
glide-copybara-robot committed Jun 28, 2021
2 parents 9c7f7f8 + ce8b5e3 commit 10acc31
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 10acc31

Please sign in to comment.