You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
IntelliJ IDEA 2019.2.3 (Ultimate Edition)
Build #IU-192.6817.14, built on September 24, 2019
Non-Bundled Plugins: CheckStyle-IDEA
Java version:
openjdk 11.0.2 2019-01-15
OpenJDK Runtime Environment 18.9 (build 11.0.2+9)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+9, mixed mode)
Operating system version: macOS Mojave 10.14.6
Issue
Attempted but unable to import checkstyle.xml using CheckStyle-IDEA, through Preferences --> Checkstyle --> +
Code/Log Trace
com.puppycrawl.tools.checkstyle.api.CheckstyleException: cannot initialize module TreeWalker - cannot initialize module FileContentsHolder - Unable to instantiate 'FileContentsHolder' class, it is also not possible to instantiate it as .FileContentsHolder, FileContentsHolderCheck, .FileContentsHolderCheck. Please recheck that class name is specified as canonical name or read how to configure short name usage https://checkstyle.org/config.html#Packages. Please also recheck that provided ClassLoader to Checker is configured correctly.
at com.puppycrawl.tools.checkstyle.Checker.setupChild(Checker.java:477)
at com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(AutomaticBean.java:198)
at org.infernus.idea.checkstyle.service.cmd.OpCreateChecker.execute(OpCreateChecker.java:61)
at org.infernus.idea.checkstyle.service.cmd.OpCreateChecker.execute(OpCreateChecker.java:26)
at org.infernus.idea.checkstyle.service.CheckstyleActionsImpl.executeCommand(CheckstyleActionsImpl.java:130)
at org.infernus.idea.checkstyle.service.CheckstyleActionsImpl.createChecker(CheckstyleActionsImpl.java:60)
at org.infernus.idea.checkstyle.service.CheckstyleActionsImpl.createChecker(CheckstyleActionsImpl.java:51)
at org.infernus.idea.checkstyle.checker.CheckerFactoryWorker.run(CheckerFactoryWorker.java:46)
Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: cannot initialize module FileContentsHolder - Unable to instantiate 'FileContentsHolder' class, it is also not possible to instantiate it as .FileContentsHolder, FileContentsHolderCheck, .FileContentsHolderCheck. Please recheck that class name is specified as canonical name or read how to configure short name usage https://checkstyle.org/config.html#Packages. Please also recheck that provided ClassLoader to Checker is configured correctly.
at com.puppycrawl.tools.checkstyle.TreeWalker.setupChild(TreeWalker.java:136)
at com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(AutomaticBean.java:198)
at com.puppycrawl.tools.checkstyle.Checker.setupChild(Checker.java:472)
... 7 more
Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: Unable to instantiate 'FileContentsHolder' class, it is also not possible to instantiate it as .FileContentsHolder, FileContentsHolderCheck, .FileContentsHolderCheck. Please recheck that class name is specified as canonical name or read how to configure short name usage https://checkstyle.org/config.html#Packages. Please also recheck that provided ClassLoader to Checker is configured correctly.
at com.puppycrawl.tools.checkstyle.PackageObjectFactory.createModule(PackageObjectFactory.java:210)
at com.puppycrawl.tools.checkstyle.TreeWalker.setupChild(TreeWalker.java:127)
... 9 more
The text was updated successfully, but these errors were encountered:
Is your Checkstyle version in your settings set to 8.1?
I looked through the release notes for Checkstyle and found that version 8.2 removed the FileContentsHolder module, which would explain the failure to instantiate the module and thereby, the exception thrown since Gradle uses version 8.1.
I changed my checkstyle version to 8.24 and received the same error that you received as well.
I looked through the release notes for Checkstyle and found that version 8.2 removed the FileContentsHolder module, which would explain the failure to instantiate the module and thereby, the exception thrown since Gradle uses version 8.1.
I changed my checkstyle version to 8.24 and received the same error that you received as well.
Kudos for the taking extra effort to look into the problem @shaoyi1997 👍
Environment
Describe your development environment
Issue
Attempted but unable to import checkstyle.xml using CheckStyle-IDEA, through Preferences --> Checkstyle --> +
Code/Log Trace
The text was updated successfully, but these errors were encountered: