GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: Dataloader helper Try classcast exception by ameerabdul · Pull Request #177 · graphql-java/java-dataloader

Conversation

@ameerabdul

@ameerabdul ameerabdul commented Mar 10, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@ameerabdul
fix: Dataloader helper Try set values
55d346f
@ameerabdul
ameerabdul marked this pull request as ready for review March 10, 2025 17:28
ameerabdul
ameerabdul commented Mar 10, 2025
View reviewed changes
Comment thread src/main/java/org/dataloader/DataLoaderHelper.java
valuesInKeyOrder.set(listIndex, Try.succeeded(v));
}
}
List<V> assembledValues = valuesInKeyOrder.stream().map(Try::get).collect(toList());

@ameerabdul ameerabdul Mar 10, 2025

Copy link
Copy Markdown
Author

There was a problem hiding this comment.

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bbakerman

bbakerman commented Mar 11, 2025

Copy link
Copy Markdown
Member

Can we please have a unit test showing this working.

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

dfa1 reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bbakerman

bbakerman commented Apr 2, 2025

Copy link
Copy Markdown
Member

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

github-actions Bot commented Jun 2, 2025

Copy link
Copy Markdown

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot added the Stale label Jun 2, 2025
@github-actions

github-actions Bot commented Jul 3, 2025

Copy link
Copy Markdown

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot closed this Jul 3, 2025
@bbakerman bbakerman reopened this Jul 3, 2025
@github-actions github-actions Bot removed the Stale label Jul 4, 2025
@dondonz dondonz added the keep-open label Jul 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

keep-open

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@ameerabdul @bbakerman @dondonz
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.