◐ Shell
clean mode source ↗

fix: Dataloader helper Try classcast exception by ameerabdul · Pull Request #177 · graphql-java/java-dataloader

@ameerabdul

Summary

  • Creating a new DataLoader with newMappedDataLoaderWithTry and batchingEnabled as false and cachingEnabled as true.
  • This will cause the value to which is already a Try instance to be wrapped again in another Try.succeed causing class cast exception

ameerabdul

valuesInKeyOrder.set(listIndex, Try.succeeded(v));
}
}
List<V> assembledValues = valuesInKeyOrder.stream().map(Try::get).collect(toList());

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this might be a bigger change as I can't go a Try.get on failed instances

@bbakerman

Can we please have a unit test showing this working.

Its not enough to fix the code, we need to lock in that behavior

@bbakerman

I managed to do a reproducton of this. I can confirm its a genuine problem but this is not the fix for it

@github-actions

Hello, this pull request has been inactive for 60 days, so we're marking it as stale. If you would like to continue working on this pull request, please make an update within the next 30 days, or we'll close the pull request.

@github-actions

Hello, as this pull request has been inactive for 90 days, we're closing this pull request. We always welcome contributions, and if you would like to continue, please open a new pull request.