Skip to content

Commit

Permalink
Added range check for line numbers (#100).
Browse files Browse the repository at this point in the history
  • Loading branch information
jshiell committed Mar 22, 2014
1 parent c3ff146 commit 1c2dcff
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 19 deletions.
2 changes: 2 additions & 0 deletions CheckStyle-IDEA.iml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="module-library" scope="TEST">
<library name="Hamcrest">
Expand Down
36 changes: 19 additions & 17 deletions CheckStyle-IDEA.ipr
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,26 @@
<component name="CheckStyle-IDEA">
<option name="configuration">
<map>
<entry key="active-configuration" value="LOCAL_FILE:$PRJ_DIR$/test-configs/issue-96.xml:Issue 96" />
<entry key="active-configuration" value="LOCAL_FILE:$PRJ_DIR$/test-configs/import-control.xml:ImportControl" />
<entry key="check-nonjava-files" value="false" />
<entry key="check-test-classes" value="false" />
<entry key="location-0" value="LOCAL_FILE:$PRJ_DIR$/test-configs/issue-23.xml:23" />
<entry key="location-1" value="LOCAL_FILE:$PRJ_DIR$/test-configs/beyondtrack_checks.xml:Issue 86" />
<entry key="location-10" value="LOCAL_FILE:$PRJ_DIR$/test-configs/sonar.xml:Sonar" />
<entry key="location-11" value="LOCAL_FILE:$PRJ_DIR$/test-configs/issue-53.xml:Issue 53" />
<entry key="location-0" value="LOCAL_FILE:$PRJ_DIR$/test-configs/issue-96.xml:Issue 96" />
<entry key="location-1" value="LOCAL_FILE:$PRJ_DIR$/test-configs/issue-98.xml:Issue 98" />
<entry key="location-10" value="LOCAL_FILE:$PRJ_DIR$/test-configs/issue-23.xml:Issue 23" />
<entry key="location-11" value="LOCAL_FILE:$PRJ_DIR$/test-configs/sonar.xml:Sonar" />
<entry key="location-12" value="LOCAL_FILE:$PRJ_DIR$/test-configs/import-control.xml:ImportControl" />
<entry key="location-13" value="LOCAL_FILE:$PRJ_DIR$/test-configs/man-checkstyle.xml:Man2" />
<entry key="location-2" value="LOCAL_FILE:$PRJ_DIR$/test-configs/amigo-cs5.0.xml:A2" />
<entry key="location-3" value="CLASSPATH:/sun_checks.xml:The default CheckStyle rules" />
<entry key="location-4" value="LOCAL_FILE:$PRJ_DIR$/test-configs/man-checkstyle.xml:Man" />
<entry key="location-5" value="LOCAL_FILE:/Users/jshiell/Projects/Yazino/support/build/checkstyle-loose/src/main/resources/yazino-checkstyle-rules.xml:Yazino" />
<entry key="location-6" value="LOCAL_FILE:$PRJ_DIR$/test-configs/amigo-cs5.0.xml:Amigo" />
<entry key="location-7" value="LOCAL_FILE:$PRJ_DIR$/test-configs/beyondtrack_checks.xml:BT" />
<entry key="location-8" value="LOCAL_FILE:$PRJ_DIR$/test-configs/issue-96.xml:Issue 96" />
<entry key="location-9" value="LOCAL_FILE:$PRJ_DIR$/test-configs/issue-23.xml:Issue 23" />
<entry key="property-5.checkstyle.suppressions.file" value="$PROJECT_DIR$/../Yazino/support/build/checkstyle-loose/src/main/resources/yazino-checkstyle-suppressions.xml" />
<entry key="location-13" value="LOCAL_FILE:$PRJ_DIR$/test-configs/amigo-cs5.0.xml:Amigo" />
<entry key="location-14" value="CLASSPATH:/sun_checks.xml:The default CheckStyle rules" />
<entry key="location-2" value="LOCAL_FILE:$PRJ_DIR$/test-configs/beyondtrack_checks.xml:Issue 86" />
<entry key="location-3" value="LOCAL_FILE:/Users/jshiell/Projects/Yazino/support/build/checkstyle-loose/src/main/resources/yazino-checkstyle-rules.xml:Yazino" />
<entry key="location-4" value="LOCAL_FILE:$PRJ_DIR$/test-configs/issue-53.xml:Issue 53" />
<entry key="location-5" value="LOCAL_FILE:$PRJ_DIR$/test-configs/man-checkstyle.xml:Man" />
<entry key="location-6" value="LOCAL_FILE:$PRJ_DIR$/test-configs/beyondtrack_checks.xml:BT" />
<entry key="location-7" value="LOCAL_FILE:$PRJ_DIR$/test-configs/man-checkstyle.xml:Man2" />
<entry key="location-8" value="LOCAL_FILE:$PRJ_DIR$/test-configs/issue-23.xml:23" />
<entry key="location-9" value="LOCAL_FILE:$PRJ_DIR$/test-configs/amigo-cs5.0.xml:A2" />
<entry key="property-1.samedir" value="" />
<entry key="property-3.checkstyle.suppressions.file" value="$PROJECT_DIR$/../Yazino/support/build/checkstyle-loose/src/main/resources/yazino-checkstyle-suppressions.xml" />
<entry key="suppress-errors" value="false" />
<entry key="thirdparty-classpath" value="$PROJECT_DIR$/../Third Party/CreateYourOwnCheckStyleCheck/BlundellCheckstyle/target/blundell-checkstyle-checks-1.0.jar" />
</map>
Expand Down Expand Up @@ -151,13 +153,13 @@
<version value="1.0" />
<info color="800080">
<option name="EFFECT_COLOR" value="800080" />
<option name="EFFECT_TYPE" value="1" />
<option name="ERROR_STRIPE_COLOR" value="800080" />
<option name="EFFECT_TYPE" value="1" />
<option name="myName" value="CHECKSTYLE" />
<option name="myVal" value="50" />
<option name="myExternalName" value="CHECKSTYLE" />
<option name="myDefaultAttributes">
<value />
<option name="EFFECT_TYPE" value="0" />
</option>
</info>
<list size="7">
Expand Down
1 change: 1 addition & 0 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ LICENCE file.
Version History
---------------

4.5.3 - Fixed: Added range check for line numbers (#100).
4.5.2 - New: When adding a HTTPS location you can now choose to ignore certificate errors (#99).
4.5.2 - Fixed: HTTP basic auth is now supported for URLs with a username/password (#93).
4.5.2 - Fixed: Better handling of NPE case (#97).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,8 @@ private void scrollToError(final TreePath treePath) {
virtualFile, true);

if (editor.length > 0 && editor[0] instanceof TextEditor) {
final LogicalPosition problemPos = new LogicalPosition(lineFor(nodeInfo) - 1, columnFor(nodeInfo));
final LogicalPosition problemPos = new LogicalPosition(
Math.max(lineFor(nodeInfo) - 1, 0), Math.max(columnFor(nodeInfo), 0));

final Editor textEditor = ((TextEditor) editor[0]).getEditor();
textEditor.getCaretModel().moveToLogicalPosition(problemPos);
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</p>
]]>
</description>
<version>4.5.2</version>
<version>4.5.3</version>
<idea-version since-build="129.677"/>
<vendor url="http://infernus.org/" email="james@infernus.org">James Shiell</vendor>

Expand All @@ -19,6 +19,7 @@
<change-notes>
<![CDATA[
<ul>
<li>4.5.3: Fixed: Added range check for line numbers (#100).</li>
<li>4.5.2: New: When adding a HTTPS location you can now choose to ignore certificate errors (#99).</li>
<li>4.5.2: Fixed: HTTP basic auth is now supported for URLs with a username/password (#93).</li>
<li>4.5.2: Fixed: Better handling of NPE case (#97).</li>
Expand Down

0 comments on commit 1c2dcff

Please sign in to comment.