Open robtimus opened 1 year ago
Do we have same problem with this extension https://github.com/sevntu-checkstyle/sevntu.checkstyle ?
I have not been able to find the time to upgrade the plugin and setup a new project with some rules from that extension. I will let you know the results when I get around to it.
I've done the following:
sevntu-checks-1.44.1.jar
to the dropins folder. I've also tried sevntu-checkstyle-idea-extension-1.44.1.jar
(even though that's for IntelliJ)My Eclipse log now contains the following error:
!ENTRY net.sf.eclipsecs.core 4 0 2023-08-24 21:02:01.607
!MESSAGE Checkstyle Plugin: cannot initialize module TreeWalker - cannot initialize module com.github.sevntu.checkstyle.checks.coding.ReturnNullInsteadOfBooleanCheck - Unable to instantiate 'com.github.sevntu.checkstyle.checks.coding.ReturnNullInsteadOfBooleanCheck' class, it is also not possible to instantiate it as null. 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.
!STACK 0
com.puppycrawl.tools.checkstyle.api.CheckstyleException: cannot initialize module TreeWalker - cannot initialize module com.github.sevntu.checkstyle.checks.coding.ReturnNullInsteadOfBooleanCheck - Unable to instantiate 'com.github.sevntu.checkstyle.checks.coding.ReturnNullInsteadOfBooleanCheck' class, it is also not possible to instantiate it as null. 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:481)
at com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(AutomaticBean.java:201)
at net.sf.eclipsecs.core.builder.CheckerFactory.createCheckerInternal(CheckerFactory.java:238)
at net.sf.eclipsecs.core.builder.CheckerFactory.createChecker(CheckerFactory.java:124)
at net.sf.eclipsecs.core.builder.Auditor.runAudit(Auditor.java:139)
at net.sf.eclipsecs.core.builder.CheckstyleBuilder.handleBuildSelection(CheckstyleBuilder.java:313)
at net.sf.eclipsecs.core.builder.CheckstyleBuilder.build(CheckstyleBuilder.java:171)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:1020)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:247)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:303)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:392)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:395)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:354)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:616)
at org.eclipse.core.internal.resources.Project$1.run(Project.java:571)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2382)
at org.eclipse.core.internal.resources.Project.internalBuild(Project.java:609)
at org.eclipse.core.internal.resources.Project.build(Project.java:121)
at net.sf.eclipsecs.core.jobs.BuildProjectJob.run(BuildProjectJob.java:87)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: cannot initialize module com.github.sevntu.checkstyle.checks.coding.ReturnNullInsteadOfBooleanCheck - Unable to instantiate 'com.github.sevntu.checkstyle.checks.coding.ReturnNullInsteadOfBooleanCheck' class, it is also not possible to instantiate it as null. 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:129)
at com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(AutomaticBean.java:201)
at com.puppycrawl.tools.checkstyle.Checker.setupChild(Checker.java:476)
... 21 more
Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: Unable to instantiate 'com.github.sevntu.checkstyle.checks.coding.ReturnNullInsteadOfBooleanCheck' class, it is also not possible to instantiate it as null. 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:215)
at com.puppycrawl.tools.checkstyle.TreeWalker.setupChild(TreeWalker.java:120)
... 23 more
Maven on the other hand works just fine, with sevntu-checks
as dependency to the Maven Checkstyle plugin.
@robtimus, so it works on eclipsecs 9.3 and not working on eclipsecs 10.0 (next release after 9.3)?
https://checkstyle.org/eclipse-cs/#!/releasenotes we changed min required Eclipse at 10.0.0 . f80470f0 Issue #340: change minimum Eclipse version to 2019-06 .
No big updates from library, except for min jdk bump.
@romani I had only tested with versions 9.3.0 (no error), 10.7.0 (auto-updated or something, error) and 10.9.3 (reinstall, error).
I have just finished testing with more versions, starting with 9.3.0 and going through the following procedure:
Version 10.0.0 through 10.5.0 showed no errors, and the violation was correctly displayed. After the upgrade from 10.5.0 to 10.6.0 the error returned.
I've used the latest Eclipse (2023-06, 4.28.0) with the default JDK (Java 17).
https://checkstyle.org/releasenotes.html#Release_10.5.0.
Allow 3rd party Check providers to group modules under custom parent module. Author: rnveach #11644
@rnveach , do you experience any issues with sevntu usage in Eclipse?
I don't use sevntu in eclipse. https://github.com/checkstyle/eclipse-cs/issues/316
https://checkstyle.org/releasenotes.html#Release_10.5.0.
Allow 3rd party Check providers to group modules under custom parent module. Author: rnveach #11644
That change seems to be more lenient, and it should not block my custom checks. Besides, that change got introduced in Checkstyle 10.5.0, a version that can load my checks just fine. Maven can also load them just fine.
I have a Checkstyle extension, https://github.com/robtimus/checkstyle-extension. This works great in Maven. It used to work great in Eclipse as well, by simply adding it to the
dropins
folder. However, recently it stopped working. The thing is, Eclipse recognizes the plugin just fine. It's available under thePlug-ins
tab of theInstallation Details
dialog, and it's also available for global Checkstyle configurations - if I create a new one, then configure it, theCheckstyle Extension
category with my custom checks shows up, and I can add and configure these as needed. Actually performing the checks upon changing code doesn't work though: Eclipse shows an error ("Checkstyle execution failed due to an internal error. Please check the error log for details..."), and the logs show the following error:However, one of the attempted classes is
com.github.robtimus.checkstyle.checks.LicenseCommentCheck
, and that class exists in my extension.This problem started occurring a few days ago. I was still using Eclipse 2022-12 at the time, but upgrading to Eclipse 2023-06 didn't solve anything. I've tried running
eclipse -clean
, also after removing and re-adding my extension, but nothing has been working so far.I've now downgraded the Checkstyle plugin to version 9.3 https://checkstyle.org/releasenotes.html#Release_9.3 , and it now works again, so I'm fairly confident that this is caused by something in the plugin.