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

Fixed Class.forName for primitive array types #372

Merged

Conversation

zhangwen0411
Copy link
Contributor

For example, in the current implementation Class.forName("[B") fails with:

java.lang.ClassNotFoundException: class not found: B

which should be fixed by this patch. The type resolution is based on that of INSTANCEOF.execute (here and here).

(Incidentally, Class.forName("[B") does work in unit tests because there exists a class named B in the unnamed package.)

@cyrille-artho
Copy link
Member

Great, this fixes the bug indeed! Is there an issue relating to it?

@zhangwen0411
Copy link
Contributor Author

I'm not aware of any issue relating to this!

@cyrille-artho
Copy link
Member

@pparizek : This patch looks good to me, can you please take a look also?
@zhangwen0411 : Thank you for finding and fixing this. Please keep your branch in your repo (once we merge your PR) as this PR can probably also be made against branch java-10-gradle, which will soon fully support Java 11 for JPF.

@pparizek
Copy link
Contributor

I agree with this fix.

@cyrille-artho
Copy link
Member

Thank you, and please make the same PR against java-10-gradle (if the patch makes sense for that branch also).

@cyrille-artho cyrille-artho merged commit db08794 into javapathfinder:master Jul 19, 2023
2 checks passed
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.

3 participants