You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CLI should print a flie name where exception is happen #2109
java -jar checkstyle-6.10.1-all.jar -c sun_checks.xml *.java
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.AbstractStringBuilder.charAt(Unknown Source)
at java.lang.StringBuilder.charAt(Unknown Source)
at com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocStyleCheck.trimTail(JavadocStyleCheck.java:315)
at com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocStyleCheck.getCommentText(JavadocStyleCheck.java:269)
at com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocStyleCheck.checkFirstSentenceEnding(JavadocStyleCheck.java:230)
at com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocStyleCheck.checkComment(JavadocStyleCheck.java:207)
at com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocStyleCheck.visitToken(JavadocStyleCheck.java:148)
at com.puppycrawl.tools.checkstyle.TreeWalker.notifyVisit(TreeWalker.java:392)
at com.puppycrawl.tools.checkstyle.TreeWalker.processIter(TreeWalker.java:503)
at com.puppycrawl.tools.checkstyle.TreeWalker.walk(TreeWalker.java:334)
at com.puppycrawl.tools.checkstyle.TreeWalker.processFiltered(TreeWalker.java:209)
at com.puppycrawl.tools.checkstyle.api.AbstractFileSetCheck.process(AbstractFileSetCheck.java:79)
at com.puppycrawl.tools.checkstyle.Checker.process(Checker.java:265)
at com.puppycrawl.tools.checkstyle.Main.runCheckstyle(Main.java:271)
at com.puppycrawl.tools.checkstyle.Main.main(Main.java:121)
So where is no easy way to find a reason (input file) of problem. File path should be printed.
We need to catch and rethrow with context information (file path) in Exception as we do not know how our code is used (plugin, embedded, ....), we can not reply on logger, as it could be switched off.
Activity
romani commentedon Oct 13, 2015
Getting details failure is almost impossible now, we need to address this ASAP.
See #2327 , #2326 .
Vampire commentedon Oct 13, 2015
I don't think this is related to #2326, there the real error is not shown at all, but the previously found one :-)
Issue #2109: CLI should print a flie name where exception is happen
romani commentedon Oct 30, 2015
@mkordas , do you have better approach to fix this ? (see my non merged commit and PR)
romani commentedon Oct 30, 2015
We need to catch and rethrow with context information (file path) in Exception as we do not know how our code is used (plugin, embedded, ....), we can not reply on logger, as it could be switched off.
Issue #2109: additioanl fix
Issue #2109: fix for build failures
Issue #2109: fix for build failures
Issue #2109: fix for build failures
Issue #2109: CLI should print a flie name where exception is happen
mkordas commentedon Oct 31, 2015
@romani, I like the approach.
Issue #2109: additional fix
Issue #2109: build fix for Windows
Issue #2109: fixes for build violations
Issue #2109: CLI should print a file name where exception is happen
romani commentedon Nov 1, 2015
merged.
See discussions at #2476 , #2487 .