Menu

#319 TreeWalker is not allowed as a parent of RegexpHeader

closed
nobody
None
5
2014-08-17
2010-12-15
Anonymous
No

An exception occurs with a configuration file that worked properly in previous versions (i dont know which).
Tested with eclipse-cs contained in net.sf.eclipsecs_5.3.0.201012121300-updatesite-.zip

Stack trace is:

cannot initialize module TreeWalker - TreeWalker is not allowed as a parent of RegexpHeader

net.sf.eclipsecs.core.util.CheckstylePluginException: cannot initialize module TreeWalker - TreeWalker is not allowed as a parent of RegexpHeader
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:164)
at net.sf.eclipsecs.core.builder.CheckstyleBuilder.handleBuildSelection(CheckstyleBuilder.java:287)
at net.sf.eclipsecs.core.jobs.RunCheckstyleOnFilesJob.runInWorkspace(RunCheckstyleOnFilesJob.java:96)
at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: cannot initialize module TreeWalker - TreeWalker is not allowed as a parent of RegexpHeader
at com.puppycrawl.tools.checkstyle.Checker.setupChild(Checker.java:178)
at com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(AutomaticBean.java:184)
at net.sf.eclipsecs.core.builder.CheckerFactory.createCheckerInternal(CheckerFactory.java:320)
at net.sf.eclipsecs.core.builder.CheckerFactory.createChecker(CheckerFactory.java:143)
at net.sf.eclipsecs.core.builder.Auditor.runAudit(Auditor.java:140)
... 4 more
Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: TreeWalker is not allowed as a parent of RegexpHeader
at com.puppycrawl.tools.checkstyle.TreeWalker.setupChild(TreeWalker.java:163)
at com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(AutomaticBean.java:184)
at com.puppycrawl.tools.checkstyle.Checker.setupChild(Checker.java:157)
... 8 more

Discussion

  • Anonymous

    Anonymous - 2010-12-15

    After some time i eventualy figured out the rule that was causing me problems.
    But after removing it, eclipse-cs still throws an exception related to a supposedly wrong RegExp which leaves me now clueless.

    For that purpose, i proposed a validation of the RegExp rules directly in the input fields, as in:
    https://sourceforge.net/tracker/?func=detail&aid=3137961&group_id=80344&atid=559497

     

    Last edit: Anonymous 2015-01-16
  • Lars Koedderitzsch

    I suppose you tried to use an old Checkstyle 4.x configuration with the 5.x plugin.
    That won't work directly since Checkstyle 5 brought some incompatible changes, see their release notes: http://checkstyle.sourceforge.net/releasenotes.html

    Regarding Regexp rules, the feature you're asking for already exists - just not for RegexpHeader being a special case, where you provide multiple regexp (one for each header line) separated by \n.
    Check out some other modules using regex, e.g. the naming checks.

     
  • SourceForge Robot

    This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).

     

Log in to post a comment.