Hi, since the upgrade from Eclipse 4.4.1 to 4.4.2 I'm getting a popup on every source file I open inside eclipse: "Checking files...." has encountered a problem.
Is there any workaround?
Thanks,
Patric
The eclipse error log contains the following exception:
net.sf.eclipsecs.core.util.CheckstylePluginException: cannot initialize module StrictDuplicateCode - Unable to instantiate StrictDuplicateCode
at net.sf.eclipsecs.core.util.CheckstylePluginException.rethrow(CheckstylePluginException.java:66)
at net.sf.eclipsecs.core.util.CheckstylePluginException.rethrow(CheckstylePluginException.java:77)
at net.sf.eclipsecs.core.builder.Auditor.runAudit(Auditor.java:166)
at net.sf.eclipsecs.core.builder.CheckstyleBuilder.handleBuildSelection(CheckstyleBuilder.java:300)
at net.sf.eclipsecs.core.jobs.RunCheckstyleOnFilesJob.runInWorkspace(RunCheckstyleOnFilesJob.java:116)
at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: cannot initialize module StrictDuplicateCode - Unable to instantiate StrictDuplicateCode
at com.puppycrawl.tools.checkstyle.Checker.setupChild(Checker.java:179)
at com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(AutomaticBean.java:185)
at net.sf.eclipsecs.core.builder.CheckerFactory.createCheckerInternal(CheckerFactory.java:310)
at net.sf.eclipsecs.core.builder.CheckerFactory.createChecker(CheckerFactory.java:146)
at net.sf.eclipsecs.core.builder.Auditor.runAudit(Auditor.java:142)
... 4 more
Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: Unable to instantiate StrictDuplicateCode
at com.puppycrawl.tools.checkstyle.PackageObjectFactory.createModule(PackageObjectFactory.java:156)
at com.puppycrawl.tools.checkstyle.Checker.setupChild(Checker.java:154)
... 8 more
Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: Unable to instantiate StrictDuplicateCodeCheck
at com.puppycrawl.tools.checkstyle.PackageObjectFactory.doMakeObject(PackageObjectFactory.java:98)
at com.puppycrawl.tools.checkstyle.PackageObjectFactory.createModule(PackageObjectFactory.java:153)
... 9 more
Hi, most likely the issue is not relating to the Eclipse update but due to installing a newer eclipse-cs version alongside.
In recent Checkstyle releases certain checks have been removed (e.g. StrictDuplicateCode, RedundantThrows).
This means you will either have to update your Checkstyle configuration, removing the now non-existing checks - or to downgrade to an earlier eclipse-cs version, where the integrated Checkstyle core still had those checks.
Please refer to the Checkstyle release notes to find the release where the change happened:
http://checkstyle.sourceforge.net/releasenotes.html
Kind regards,
Lars
Hi Lars,
thank you for pointing into the right direction and I learned that eclipse-cs is not responsible for this.
I'm wondering why checkstyle is silently dropping features and it seems that I'm not the only one when looking at the related checkstyle issues:
https://github.com/checkstyle/checkstyle/issues/523
https://github.com/checkstyle/checkstyle/issues/22
Is it easily possible to switch back to an older version of eclipse-cs (containing an older release of checkstyle) using eclipse update manager?
Thank you and best regards,
Patric
Last edit: Pat 2015-03-05
Hi Patric,
you're welcome. Reverting to an older eclipse-cs version won't be possible via the update manager directly, since this only offers the most recent version.
You can, however, download a packaged update site of previous eclipse-cs versions here:
https://sourceforge.net/projects/eclipse-cs/files/Eclipse%20Checkstyle%20Plug-in/
To install from this please follow instructions here:
http://eclipse-cs.sourceforge.net/#!/install (section "From an update site archive").
Kind regards,
Lars