I was very excited to see that there is a check-style like plugin called CheckStyle-IDEA plugin for IntelliJ that i can enforce code style on the source.
I installed it using the IDE plugin repository, restarted it. Unfortunately After pressing the check this file or check project I got the an exception (see log below).
I am using windows 7 pro, IDEA 10.0.3 build #103.255 Build on April 2011 JDK 1.6.0_21
- did anyone encountered this problem?
- is there any other tool to do this job through the intelliJ IDE?
Thanks
2011-05-05 11:41:56,723 [1300492] INFO - ea.checkstyle.CheckStylePlugin - Scanning current file(s). 2011-05-05 11:41:56,727 [1300496] ERROR - style.checker.CheckFilesThread - An error occurred while scanning a file. org.infernus.idea.checkstyle.exception.CheckStylePluginException: An error occurred during a file scan. at org.infernus.idea.checkstyle.CheckStylePlugin.processError(CheckStylePlugin.java:409) at org.infernus.idea.checkstyle.checker.CheckFilesThread.run(CheckFilesThread.java:72) Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: 1 at java.lang.String.charAt(String.java:686) at java.util.regex.Matcher.appendReplacement(Matcher.java:703) at java.util.regex.Matcher.replaceAll(Matcher.java:813) at java.lang.String.replaceAll(String.java:2189) at org.infernus.idea.checkstyle.util.ScannableFile.parentDirFor(ScannableFile.java:72) at org.infernus.idea.checkstyle.util.ScannableFile.createTemporaryFileFor(ScannableFile.java:58) at org.infernus.idea.checkstyle.util.ScannableFile.(ScannableFile.java:40) at org.infernus.idea.checkstyle.checker.CreateScannableFileAction.run(CreateScannableFileAction.java:60)at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:757) at org.infernus.idea.checkstyle.checker.FileScanner.createTemporaryFile(FileScanner.java:228) at org.infernus.idea.checkstyle.checker.FileScanner.checkPsiFile(FileScanner.java:167) at org.infernus.idea.checkstyle.checker.Fi开发者_如何转开发leScanner.run(FileScanner.java:80) at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:770) at org.infernus.idea.checkstyle.checker.CheckFilesThread.runFileScanner(CheckFilesThread.java:39) at org.infernus.idea.checkstyle.checker.AbstractCheckerThread.processFilesForModuleInfoAndScan(AbstractCheckerThread.java:132) at org.infernus.idea.checkstyle.checker.CheckFilesThread.run(CheckFilesThread.java:57)
Checkstyle-idea plugin is sadly rather buggy :(
You can post or view issues at http://code.google.com/p/checkstyle-idea/ and get much faster support than here.
精彩评论