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

Scan issue on 14.1.4 IDEA #187

Closed
portchavz opened this issue Sep 10, 2015 · 5 comments
Closed

Scan issue on 14.1.4 IDEA #187

portchavz opened this issue Sep 10, 2015 · 5 comments

Comments

@portchavz
Copy link

An error occurred while scanning a file.: An error occurred during a file scan.
org.infernus.idea.checkstyle.exception.CheckStylePluginException: An error occurred during a file scan.
at org.infernus.idea.checkstyle.exception.CheckStylePluginException.wrap(CheckStylePluginException.java:34)
at org.infernus.idea.checkstyle.checker.CheckFilesThread.run(CheckFilesThread.java:43)
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.AbstractStringBuilder.charAt(AbstractStringBuilder.java:210)
at java.lang.StringBuilder.charAt(StringBuilder.java:76)
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 org.infernus.idea.checkstyle.checker.CheckStyleChecker.processAndAudit(CheckStyleChecker.java:64)
at org.infernus.idea.checkstyle.checker.CheckStyleChecker.scan(CheckStyleChecker.java:40)
at org.infernus.idea.checkstyle.checker.FileScanner.lambda$checkPsiFile$12(FileScanner.java:90)
at org.infernus.idea.checkstyle.checker.FileScanner$$Lambda$54/12579630.apply(Unknown Source)
at java.util.Optional.map(Optional.java:215)
at org.infernus.idea.checkstyle.checker.FileScanner.checkPsiFile(FileScanner.java:90)
at org.infernus.idea.checkstyle.checker.FileScanner.run(FileScanner.java:42)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:872)
at org.infernus.idea.checkstyle.checker.CheckFilesThread.runFileScanner(CheckFilesThread.java:30)
at org.infernus.idea.checkstyle.checker.AbstractCheckerThread.processFilesForModuleInfoAndScan(AbstractCheckerThread.java:113)
at org.infernus.idea.checkstyle.checker.CheckFilesThread.run(CheckFilesThread.java:39)

@jshiell
Copy link
Owner

jshiell commented Sep 10, 2015

Looking at the stack trace it appears most likely to be a check style bug. Does it occur if you use the command line check style client?
If not, please provide your rules file, the versions of the plugin and IDEA you're using, and a sample piece of code that triggers the error.

_____________________________

From: portchavz notifications@github.com
Sent: Thursday, September 10, 2015 10:37 pm
Subject: [checkstyle-idea] Scan issue on 14.1.4 IDEA (#187)
To: jshiell/checkstyle-idea checkstyle-idea@noreply.github.com

An error occurred while scanning a file.: An error occurred during a file scan.
org.infernus.idea.checkstyle.exception.CheckStylePluginException: An error occurred during a file scan.
at org.infernus.idea.checkstyle.exception.CheckStylePluginException.wrap(CheckStylePluginException.java:34)
at org.infernus.idea.checkstyle.checker.CheckFilesThread.run(CheckFilesThread.java:43)
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.AbstractStringBuilder.charAt(AbstractStringBuilder.java:210)
at java.lang.StringBuilder.charAt(StringBuilder.java:76)
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 org.infernus.idea.checkstyle.checker.CheckStyleChecker.processAndAudit(CheckStyleChecker.java:64)
at org.infernus.idea.checkstyle.checker.CheckStyleChecker.scan(CheckStyleChecker.java:40)
at org.infernus.idea.checkstyle.checker.FileScanner.lambda$checkPsiFile$12(FileScanner.java:90)
at org.infernus.idea.checkstyle.checker.FileScanner$$Lambda$54/12579630.apply(Unknown Source)
at java.util.Optional.map(Optional.java:215)
at org.infernus.idea.checkstyle.checker.FileScanner.checkPsiFile(FileScanner.java:90)
at org.infernus.idea.checkstyle.checker.FileScanner.run(FileScanner.java:42)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:872)
at org.infernus.idea.checkstyle.checker.CheckFilesThread.runFileScanner(CheckFilesThread.java:30)
at org.infernus.idea.checkstyle.checker.AbstractCheckerThread.processFilesForModuleInfoAndScan(AbstractCheckerThread.java:113)
at org.infernus.idea.checkstyle.checker.CheckFilesThread.run(CheckFilesThread.java:39)


Reply to this email directly or view it on GitHub.

@portchavz
Copy link
Author

I get the same problem if I use the default checkStyle file that came with the plugin. I can run checkstyle just fine using the following command: mvn compile checkstyle:check.

@jshiell
Copy link
Owner

jshiell commented Sep 10, 2015

Does it work with Checkstyle as downloaded from the website? As the maven plugin uses an older version if Checkstyle.

@jshiell
Copy link
Owner

jshiell commented Sep 10, 2015

Looks like it might be this, in which case it will be fixed when checkstyle 6.11 is released.

checkstyle/checkstyle#2094

@jshiell
Copy link
Owner

jshiell commented Sep 12, 2015

I'm considering this a Checkstyle bug at present, as reference in prior commit. Please reopen if this still occurs once the plugin has started to use Checkstyle 6.11 (which hasn't been released yet).

@jshiell jshiell closed this as completed Sep 12, 2015
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