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

Checkstyle error with latest checkstye plugin #5

Closed
adangel opened this issue Jan 21, 2018 · 1 comment
Closed

Checkstyle error with latest checkstye plugin #5

adangel opened this issue Jan 21, 2018 · 1 comment
Assignees

Comments

@adangel
Copy link
Member

adangel commented Jan 21, 2018

When using the current checkstyle rules within eclipse and the latest checkstyle plugin from http://eclipse-cs.sourceforge.net/update/ the following exception is thrown and checkstyle is not executed inside eclipse:

com.puppycrawl.tools.checkstyle.api.CheckstyleException: cannot initialize module TreeWalker - Fehler beim Instanziieren der Klasse 'FileContentsHolder'. Es war auch nicht möglich, sie als com.puppycrawl.tools.checkstyle.checks.annotation.FileContentsHolder, com.puppycrawl.tools.checkstyle.checks.blocks.FileContentsHolder, com.puppycrawl.tools.checkstyle.checks.coding.FileContentsHolder, com.puppycrawl.tools.checkstyle.checks.design.FileContentsHolder, com.puppycrawl.tools.checkstyle.checks.header.FileContentsHolder, com.puppycrawl.tools.checkstyle.checks.imports.FileContentsHolder, com.puppycrawl.tools.checkstyle.checks.indentation.FileContentsHolder, com.puppycrawl.tools.checkstyle.checks.javadoc.FileContentsHolder, com.puppycrawl.tools.checkstyle.checks.metrics.FileContentsHolder, com.puppycrawl.tools.checkstyle.checks.modifier.FileContentsHolder, com.puppycrawl.tools.checkstyle.checks.naming.FileContentsHolder, com.puppycrawl.tools.checkstyle.checks.regexp.FileContentsHolder, com.puppycrawl.tools.checkstyle.checks.sizes.FileContentsHolder, com.puppycrawl.tools.checkstyle.checks.whitespace.FileContentsHolder, com.puppycrawl.tools.checkstyle.checks.FileContentsHolder, com.puppycrawl.tools.checkstyle.filefilters.FileContentsHolder, com.puppycrawl.tools.checkstyle.filters.FileContentsHolder, com.puppycrawl.tools.checkstyle.FileContentsHolder, FileContentsHolderCheck, com.puppycrawl.tools.checkstyle.checks.annotation.FileContentsHolderCheck, com.puppycrawl.tools.checkstyle.checks.blocks.FileContentsHolderCheck, com.puppycrawl.tools.checkstyle.checks.coding.FileContentsHolderCheck, com.puppycrawl.tools.checkstyle.checks.design.FileContentsHolderCheck, com.puppycrawl.tools.checkstyle.checks.header.FileContentsHolderCheck, com.puppycrawl.tools.checkstyle.checks.imports.FileContentsHolderCheck, com.puppycrawl.tools.checkstyle.checks.indentation.FileContentsHolderCheck, com.puppycrawl.tools.checkstyle.checks.javadoc.FileContentsHolderCheck, com.puppycrawl.tools.checkstyle.checks.metrics.FileContentsHolderCheck, com.puppycrawl.tools.checkstyle.checks.modifier.FileContentsHolderCheck, com.puppycrawl.tools.checkstyle.checks.naming.FileContentsHolderCheck, com.puppycrawl.tools.checkstyle.checks.regexp.FileContentsHolderCheck, com.puppycrawl.tools.checkstyle.checks.sizes.FileContentsHolderCheck, com.puppycrawl.tools.checkstyle.checks.whitespace.FileContentsHolderCheck, com.puppycrawl.tools.checkstyle.checks.FileContentsHolderCheck, com.puppycrawl.tools.checkstyle.filefilters.FileContentsHolderCheck, com.puppycrawl.tools.checkstyle.filters.FileContentsHolderCheck, com.puppycrawl.tools.checkstyle.FileContentsHolderCheck zu instanziieren. Bitte prüfen Sie, dass der Klassenname als kanonischer Name angegeben wurde oder lesen Sie, wie Sie abgekürzte Namen konfigurieren: http://checkstyle.sourceforge.net/config.html#Packages. Bitte prüfen Sie auch, dass der angegebene ClassLoader des Checkers richtig konfiguriert ist.
	at com.puppycrawl.tools.checkstyle.Checker.setupChild(Checker.java:464)
	at com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(AutomaticBean.java:197)
	at net.sf.eclipsecs.core.builder.CheckerFactory.createCheckerInternal(CheckerFactory.java:299)
	at net.sf.eclipsecs.core.builder.CheckerFactory.createChecker(CheckerFactory.java:133)
	at net.sf.eclipsecs.core.builder.Auditor.runAudit(Auditor.java:141)
	at net.sf.eclipsecs.core.builder.CheckstyleBuilder.handleBuildSelection(CheckstyleBuilder.java:306)
	at net.sf.eclipsecs.core.builder.CheckstyleBuilder.build(CheckstyleBuilder.java:172)
	at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:735)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:206)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:246)
	at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:301)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:304)
	at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:360)
	at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:383)
	at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:142)
	at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:232)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56)
Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: Fehler beim Instanziieren der Klasse 'FileContentsHolder'. Es war auch nicht möglich, sie als com.puppycrawl.tools.checkstyle.checks.annotation.FileContentsHolder, com.puppycrawl.tools.checkstyle.checks.blocks.FileContentsHolder, com.puppycrawl.tools.checkstyle.checks.coding.FileContentsHolder, com.puppycrawl.tools.checkstyle.checks.design.FileContentsHolder, com.puppycrawl.tools.checkstyle.checks.header.FileContentsHolder, com.puppycrawl.tools.checkstyle.checks.imports.FileContentsHolder, com.puppycrawl.tools.checkstyle.checks.indentation.FileContentsHolder, com.puppycrawl.tools.checkstyle.checks.javadoc.FileContentsHolder, com.puppycrawl.tools.checkstyle.checks.metrics.FileContentsHolder, com.puppycrawl.tools.checkstyle.checks.modifier.FileContentsHolder, com.puppycrawl.tools.checkstyle.checks.naming.FileContentsHolder, com.puppycrawl.tools.checkstyle.checks.regexp.FileContentsHolder, com.puppycrawl.tools.checkstyle.checks.sizes.FileContentsHolder, com.puppycrawl.tools.checkstyle.checks.whitespace.FileContentsHolder, com.puppycrawl.tools.checkstyle.checks.FileContentsHolder, com.puppycrawl.tools.checkstyle.filefilters.FileContentsHolder, com.puppycrawl.tools.checkstyle.filters.FileContentsHolder, com.puppycrawl.tools.checkstyle.FileContentsHolder, FileContentsHolderCheck, com.puppycrawl.tools.checkstyle.checks.annotation.FileContentsHolderCheck, com.puppycrawl.tools.checkstyle.checks.blocks.FileContentsHolderCheck, com.puppycrawl.tools.checkstyle.checks.coding.FileContentsHolderCheck, com.puppycrawl.tools.checkstyle.checks.design.FileContentsHolderCheck, com.puppycrawl.tools.checkstyle.checks.header.FileContentsHolderCheck, com.puppycrawl.tools.checkstyle.checks.imports.FileContentsHolderCheck, com.puppycrawl.tools.checkstyle.checks.indentation.FileContentsHolderCheck, com.puppycrawl.tools.checkstyle.checks.javadoc.FileContentsHolderCheck, com.puppycrawl.tools.checkstyle.checks.metrics.FileContentsHolderCheck, com.puppycrawl.tools.checkstyle.checks.modifier.FileContentsHolderCheck, com.puppycrawl.tools.checkstyle.checks.naming.FileContentsHolderCheck, com.puppycrawl.tools.checkstyle.checks.regexp.FileContentsHolderCheck, com.puppycrawl.tools.checkstyle.checks.sizes.FileContentsHolderCheck, com.puppycrawl.tools.checkstyle.checks.whitespace.FileContentsHolderCheck, com.puppycrawl.tools.checkstyle.checks.FileContentsHolderCheck, com.puppycrawl.tools.checkstyle.filefilters.FileContentsHolderCheck, com.puppycrawl.tools.checkstyle.filters.FileContentsHolderCheck, com.puppycrawl.tools.checkstyle.FileContentsHolderCheck zu instanziieren. Bitte prüfen Sie, dass der Klassenname als kanonischer Name angegeben wurde oder lesen Sie, wie Sie abgekürzte Namen konfigurieren: http://checkstyle.sourceforge.net/config.html#Packages. Bitte prüfen Sie auch, dass der angegebene ClassLoader des Checkers richtig konfiguriert ist.
	at com.puppycrawl.tools.checkstyle.PackageObjectFactory.createModule(PackageObjectFactory.java:208)
	at com.puppycrawl.tools.checkstyle.TreeWalker.setupChild(TreeWalker.java:166)
	at com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(AutomaticBean.java:197)
	at com.puppycrawl.tools.checkstyle.Checker.setupChild(Checker.java:459)
	... 18 more

Seems like the module "FileContentsHolderCheck" was renamed/moved/removed. It was removed with checkstyle 8.2 (see release notes):

remove FileContentsHolder module as FileContents object is available for filters on TreeWalker in TreeWalkerAudit Event. Author: Timur, Roman Ivanov #3573

@adangel adangel self-assigned this Jan 21, 2018
@jsotuyod
Copy link
Member

Just removing it should work, but we should also update the checkstyle version used by Maven.

@adangel adangel closed this as completed in ae83259 Feb 1, 2018
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

No branches or pull requests

2 participants