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 for 'Cannot invoke ... because "classPath" is null.' #11

Merged
merged 3 commits into from
Apr 21, 2023

Conversation

jonasPoehler
Copy link
Contributor

Hi,

we are using annotation processing to generate mapping files for internationalisation at compile time. These are properies-files, which causes this plugin to error out, since the compile task returns the properties files along with the "normal" class files as compiler output. However, these properties files do not have a classname and thus BuiltInJavaCompiler throws an exception, when trying to create a ClassFile object. This pull request fixes this issue, so that ClassFile-objects are only created for actual classes. I did some debugging and can also say, that filtering out these files matches the behaviour, when checking with HotSwapManager.scanForModifiedClasses, so although I am not an expert in the IntelliJ-Platform and Plugin-API I think this is the correct fix for this issue.

2023-04-19 14_23_33-Window

With this fix in place, the issue did not occur and the classes were being hotswapped, as expected.
Thanks for providing this plugin and all the best
Jonas

LabyStudio and others added 3 commits March 6, 2023 16:39
always complete the background task, even if an error occurs
fix exception when hotswapping with IntelliJ 2023.1 using the new UI, version 2.5, closes LabyStudio#9
Compiler output can contain non-class files like files generated by annotation processing. These cannot be "hotswapped" and don't have a classname, so have to be filtered out.
@LabyStudio LabyStudio changed the base branch from master to 2.6 April 21, 2023 12:32
@LabyStudio LabyStudio merged commit 707fbef into LabyStudio:2.6 Apr 21, 2023
@LabyStudio
Copy link
Owner

We sometimes had the same error in some classes and I haven't had time to debug it yet.
But your change looks right so far and also fixed the error for us.
Thank you very much for your contribution!

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