ModuleBuilder.createModule() causes
Originally, I was using ModuleBuilder#createModule() to get a single module, then ModuleBuilder#commit() to commit it to the project.
However, this seemed to caused root provider listeners to not get disposed.
Caused by: java.lang.AssertionError: Listeners for 1 root providers aren't disposed: com.intellij.openapi.projectRoots.impl.ProjectJdkImpl$MyRootProvider@4a759724 referenced by 6 order entries:
I discovered that I could just omit the createModule() call and assert that the module list returned from commit() returned only one module, but it's not clear why this caused problems in the first place, and why createModule() is adding listeners that don't get disposed.
Is there a better way to create a single module? Asserting that I get back only one module is kind of hacky, and I'd prefer to use the API in a more idiomatic way, if possible.
Please sign in to leave a comment.