Skip to content

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

Merged
skylot merged 1 commit intoskylot:masterfrom
ewt45:fix-innerclass-parent-finding
Dec 11, 2024
Merged

fix: inner class parent is wrong when name formatted as Class$method$xxx#2364
skylot merged 1 commit intoskylot:masterfrom
ewt45:fix-innerclass-parent-finding

Conversation

@ewt45
Copy link
Copy Markdown
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
Copy Markdown
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
@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