Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 576983 - fix ClassCastException for Types#asMemberOf of a Record #199

Merged
merged 1 commit into from
Oct 12, 2022

Conversation

raouldh
Copy link
Contributor

@raouldh raouldh commented Jul 7, 2022

Bug 576983 - fix ClassCastException for Types#asMemberOf of a RecordComponent. Cast to VariableBinding instead.

A ClassCastException occurs when binding a member of a Java Record component to a FieldBinding, cast to supertype of FieldBinding instead(VariableBinding). See bugreport.

With this patch applied to my Eclipse installation I can now open all my Java Record classes without the ClassCastException.

…omponent.

Bug 576983 - fix ClassCastException for Types#asMemberOf of a RecordComponent. Cast to VariableBinding instead.
Signed-off-by: Raoul de Haard <raouldehaard@gmail.com>
@filiphr
Copy link

filiphr commented Jul 25, 2022

I am the project lead of MapStruct. We have received multiple different bug reports about certain problems around this problem in our project.

Is it possible for someone from the JDT team to look into this PR? It would be very appreciated.

cc: @jarthana, @mpalat, @iloveeclipse

@iloveeclipse
Copy link
Member

@filiphr : I would recommend to provide a test case that demonstrates the problem and the fix, see for example a5e6a89 or 12f5e79.

I personally have no idea about this code, so I can't help you here.

@filiphr
Copy link

filiphr commented Jul 25, 2022

good point @iloveeclipse. @raouldh can you look into adding a test case that would fail without your fix?

gzsombor added a commit to gzsombor/eclipse.jdt.core that referenced this pull request Aug 17, 2022
@gzsombor gzsombor mentioned this pull request Aug 17, 2022
3 tasks
@gzsombor
Copy link
Contributor

I've added a test case, because I need this fix as well ... 😉

gzsombor added a commit to gzsombor/eclipse.jdt.core that referenced this pull request Aug 22, 2022
gzsombor added a commit to gzsombor/eclipse.jdt.core that referenced this pull request Aug 24, 2022
gzsombor added a commit to gzsombor/eclipse.jdt.core that referenced this pull request Aug 24, 2022
gzsombor added a commit to gzsombor/eclipse.jdt.core that referenced this pull request Aug 26, 2022
@gzsombor
Copy link
Contributor

gzsombor commented Sep 6, 2022

Can anyone review or merge my patch?

gzsombor added a commit to gzsombor/eclipse.jdt.core that referenced this pull request Sep 6, 2022
gzsombor added a commit to gzsombor/eclipse.jdt.core that referenced this pull request Sep 6, 2022
gzsombor added a commit to gzsombor/eclipse.jdt.core that referenced this pull request Sep 9, 2022
gzsombor added a commit to gzsombor/eclipse.jdt.core that referenced this pull request Sep 9, 2022
gzsombor added a commit to gzsombor/eclipse.jdt.core that referenced this pull request Sep 18, 2022
gzsombor added a commit to gzsombor/eclipse.jdt.core that referenced this pull request Sep 23, 2022
gzsombor added a commit to gzsombor/eclipse.jdt.core that referenced this pull request Oct 7, 2022
@jarthana jarthana self-requested a review October 11, 2022 05:30
@jarthana
Copy link
Member

The patch looks good to me. But looks the like the testcase commit is not in the same branch and hence can't squash/merge. Can you take care of that please?

@gzsombor
Copy link
Contributor

The patch looks good to me. But looks the like the testcase commit is not in the same branch and hence can't squash/merge. Can you take care of that please?

The fix with the test is on a different pull request, as I - of course - couldn't modify someone else branch: #321

@jarthana jarthana merged commit 0541dd3 into eclipse-jdt:master Oct 12, 2022
gzsombor added a commit to gzsombor/eclipse.jdt.core that referenced this pull request Oct 12, 2022
@raouldh raouldh deleted the patch-1 branch November 3, 2022 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants