Skip to content

Commit

Permalink
Reorganize code in EagerTagFactory to avoid error-prone bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jasmith-hs committed Aug 4, 2023
1 parent c28c28f commit e24f9ef
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,11 @@ public static <T extends Tag> Optional<EagerTagDecorator<T>> getEagerTagDecorato
if (TAG_CLASSES_TO_SKIP.contains(clazz)) {
return Optional.empty();
}
if (EAGER_TAG_OVERRIDES.containsKey(clazz)) {
EagerTagDecorator<?> decorator = EAGER_TAG_OVERRIDES
.get(clazz)
Class<? extends EagerTagDecorator<? extends Tag>> eagerOverrideClass = EAGER_TAG_OVERRIDES.get(
clazz
);
if (eagerOverrideClass != null) {
EagerTagDecorator<?> decorator = eagerOverrideClass
.getDeclaredConstructor(clazz)
.newInstance(tag);
if (decorator.getTag().getClass() == clazz) {
Expand Down

0 comments on commit e24f9ef

Please sign in to comment.