File tree Expand file tree Collapse file tree 4 files changed +17
-5
lines changed
src/main/java/com/intellij/plugins/bodhi/pmd/actions Expand file tree Collapse file tree 4 files changed +17
-5
lines changed Original file line number Diff line number Diff line change 33# PMDPlugin Changelog
44
55## [ Unreleased]
6+ ### Added
7+ - Update to PMD version 7.2.0
8+ - Fix issue with disabled PMD predefined rules menu
9+
610## [ 2.0.0]
711### Added
812- Update to PMD version 7.1.0
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
33
44fun properties (key : String ) = project.findProperty(key).toString()
55
6- val pmdVersion = " 7.1 .0"
6+ val pmdVersion = " 7.2 .0"
77
88plugins {
99 id(" java" )
Original file line number Diff line number Diff line change 33
44# pluginGroup = com.intellij.plugins.bodhi.pmd
55pluginName = PMDPlugin
6- pluginVersion = 2.0.0
6+ pluginVersion = 2.0.1
77
88# See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
99# for insight into build numbers and IntelliJ Platform versions.
Original file line number Diff line number Diff line change 99import com .intellij .plugins .bodhi .pmd .PMDUtil ;
1010import org .jetbrains .annotations .Nullable ;
1111
12+ import java .io .InputStream ;
1213import java .util .Properties ;
1314
1415/**
@@ -45,7 +46,7 @@ public void actionPerformed(AnActionEvent e) {
4546 Properties props = new Properties ();
4647 try {
4748 //Load the property file which has all the rulesets.
48- props .load (Thread . currentThread (). getContextClassLoader (). getResourceAsStream ( RULESETS_PROPERTY_FILE ));
49+ props .load (getRuleResourceStream ( ));
4950 String [] rulesetFilenames = props .getProperty (RULESETS_FILENAMES_KEY ).split (PMDInvoker .RULE_DELIMITER );
5051
5152 //We have 'All' rules in addition to the rulesets
@@ -67,11 +68,18 @@ public void actionPerformed(AnActionEvent e) {
6768 children .add (ruleAction );
6869 }
6970 } catch (Exception e ) {
70- //Should not happen
71- //e.printStackTrace();
71+ throw new RuntimeException (e );
7272 }
7373 }
7474
75+ private @ Nullable InputStream getRuleResourceStream () {
76+ InputStream resourceAsStream = getClass ().getClassLoader ().getResourceAsStream (RULESETS_PROPERTY_FILE );
77+ if (resourceAsStream == null ) {
78+ return Thread .currentThread ().getContextClassLoader ().getResourceAsStream (RULESETS_PROPERTY_FILE );
79+ }
80+ return resourceAsStream ;
81+ }
82+
7583 public AnAction [] getChildren (@ Nullable AnActionEvent event ) {
7684 return new AnAction []{this .children };
7785 }
You can’t perform that action at this time.
0 commit comments