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
Custom checks broken with Checkstyle 8.0 #4885
Comments
@lkoe Please provide us information to reproduce problem like check source, and how you are calling Checkstyle with it. |
I missed this when reading the issue before.
I can't reproduce this issue in our tests. The ones I have looked at have the periods, so I am not sure why the jar is not showing them. The nightly jar produces the same result as the release. |
Looking at the end of the error displayed is:
I can produce the invalid display with modifying the test @lkoe List of tried results may just be a display problem, and not a result of failing to load the check. We still need your details to determine why your check won't load if it is defined correctly. |
fix for correct message print is provided. |
As maintainer of Jsr305Annotations I can confirm that the current master of the plugin is able to run against checkstyle 8 as seen in the tests https://travis-ci.org/bjrke/JSR305CheckstylePlugin. Anyway, the class names in output pasted by @lkoe was generated by me in the eclipse-cs environment. |
ok , I am closing this issue for now, if some other problems found it could be reopened or it is better to create new issue. |
Please note this bug against eclipse-cs-8.0.0, which I believe to be an issue in Checkstyle core introduced somewhere after 7.6 (confirmed in 8.0):
https://sourceforge.net/p/eclipse-cs/discussion/274377/thread/4ab4f095/?limit=25#1334
Due to a "recent" change to PackageNamesLoader (supposedly this commit ddeb553) the class name guessing algorithm based on checkstyle_packages.xml files is not working properly anymore.
Please note the missing dot between package name and class name in the error message:
Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: Unable to instantiate 'Jsr305Annotations' class, it is also not possible to instantiate it as com.puppycrawl.tools.checkstyle.checks.annotationJsr305Annotations, com.puppycrawl.tools.checkstyle.checks.blocksJsr305Annotations, com.puppycrawl.tools.checkstyle.checks.codingJsr305Annotations, com.puppycrawl.tools.checkstyle.checks.designJsr305Annotations, com.puppycrawl.tools.checkstyle.checks.headerJsr305Annotations, com.puppycrawl.tools.checkstyle.checks.importsJsr305Annotations, com.puppycrawl.tools.checkstyle.checks.indentationJsr305Annotations, com.puppycrawl.tools.checkstyle.checks.javadocJsr305Annotations, com.puppycrawl.tools.checkstyle.checks.metricsJsr305Annotations, com.puppycrawl.tools.checkstyle.checks.modifierJsr305Annotations, com.puppycrawl.tools.checkstyle.checks.namingJsr305Annotations, com.puppycrawl.tools.checkstyle.checks.regexpJsr305Annotations, com.puppycrawl.tools.checkstyle.checks.sizesJsr305Annotations, com.puppycrawl.tools.checkstyle.checks.whitespaceJsr305Annotations, com.puppycrawl.tools.checkstyle.checksJsr305Annotations, com.puppycrawl.tools.checkstyle.filefiltersJsr305Annotations, com.puppycrawl.tools.checkstyle.filtersJsr305Annotations, com.puppycrawl.tools.checkstyle.Jsr305Annotations, Jsr305AnnotationsCheck, com.puppycrawl.tools.checkstyle.checks.annotationJsr305AnnotationsCheck, com.puppycrawl.tools.checkstyle.checks.blocksJsr305AnnotationsCheck, com.puppycrawl.tools.checkstyle.checks.codingJsr305AnnotationsCheck, com.puppycrawl.tools.checkstyle.checks.designJsr305AnnotationsCheck, com.puppycrawl.tools.checkstyle.checks.headerJsr305AnnotationsCheck, com.puppycrawl.tools.checkstyle.checks.importsJsr305AnnotationsCheck, com.puppycrawl.tools.checkstyle.checks.indentationJsr305AnnotationsCheck, com.puppycrawl.tools.checkstyle.checks.javadocJsr305AnnotationsCheck, com.puppycrawl.tools.checkstyle.checks.metricsJsr305AnnotationsCheck, com.puppycrawl.tools.checkstyle.checks.modifierJsr305AnnotationsCheck, com.puppycrawl.tools.checkstyle.checks.namingJsr305AnnotationsCheck, com.puppycrawl.tools.checkstyle.checks.regexpJsr305AnnotationsCheck, com.puppycrawl.tools.checkstyle.checks.sizesJsr305AnnotationsCheck, com.puppycrawl.tools.checkstyle.checks.whitespaceJsr305AnnotationsCheck, com.puppycrawl.tools.checkstyle.checksJsr305AnnotationsCheck, com.puppycrawl.tools.checkstyle.filefiltersJsr305AnnotationsCheck, com.puppycrawl.tools.checkstyle.filtersJsr305AnnotationsCheck, com.puppycrawl.tools.checkstyle.Jsr305AnnotationsCheck. Please recheck that class name is specified as canonical name or read how to configure short name usage http://checkstyle.sourceforge.net/config.html#Packages. Please also recheck that provided ClassLoader to Checker is configured correctly.
The text was updated successfully, but these errors were encountered: