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

fix: inner class parent is wrong when name formatted as Class$method$xxx #2364

Merged
merged 1 commit into from
Dec 11, 2024

Conversation

ewt45
Copy link
Contributor

@ewt45 ewt45 commented Dec 11, 2024

inner class name format can be Class1$InnerClass1. but it can also be Class1$method1$InnerClass1 (example). In ClassInfo.splitAndApplyNames(), only the former situation is considered.

This pr is trying to cover the latter situation. If the inner class ClassInfo see its parent class as Class1$method1, parent classNode will not be found. In this case resolveParentClass() will try to split it again, into Class1 and method1, make sure Class1 exists and contains method method1, then set Class1 as inner class's parent.

@ewt45 ewt45 closed this Dec 11, 2024
@ewt45 ewt45 reopened this Dec 11, 2024
Copy link
Owner

@skylot skylot left a comment

Choose a reason for hiding this comment

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

Nice fix! Thanks 👍

@skylot skylot merged commit 0d105a5 into skylot:master Dec 11, 2024
7 checks passed
@ewt45 ewt45 deleted the fix-innerclass-parent-finding branch December 12, 2024 01:18
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.

2 participants