Skip to content

Commit e3104d9

Browse files
committed
Fixes #101 Moving bundle to proper location
1 parent 5eaa39f commit e3104d9

File tree

5 files changed

+12
-8
lines changed

5 files changed

+12
-8
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
.idea/
22
out/
3+
.gradle
4+
build

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
# PMDPlugin Changelog
44

55
## [Unreleased]
6+
### Changed
7+
- Fixed #101: bundle loading error during vcs commit
8+
69
## [1.8.20]
710
### Added
811
- Update to PMD version 6.38.0

gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
# pluginGroup = com.intellij.plugins.bodhi.pmd
55
pluginName = PMDPlugin
6-
pluginVersion = 1.8.20
6+
pluginVersion = 1.8.21
77

88
# See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
99
# for insight into build numbers and IntelliJ Platform versions.

src/main/java/com/intellij/plugins/bodhi/pmd/handlers/PMDCheckinHandler.java

+6-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.intellij.plugins.bodhi.pmd.handlers;
22

3+
import com.intellij.AbstractBundle;
34
import com.intellij.CommonBundle;
45
import com.intellij.openapi.project.Project;
56
import com.intellij.openapi.ui.Messages;
@@ -37,7 +38,7 @@
3738
public class PMDCheckinHandler extends CheckinHandler {
3839

3940
private static final Log log = LogFactory.getLog(PMDCheckinHandler.class);
40-
private static final String BUNDLE = "com.intellij.plugins.bodhi.pmd.PMD-Intellij";
41+
private static final String BUNDLE = "messages.PMD-Intellij";
4142

4243
@NonNls
4344
private final CheckinProjectPanel checkinProjectPanel;
@@ -81,17 +82,13 @@ public void restoreState() {
8182

8283
@NotNull
8384
private String message(@PropertyKey(resourceBundle = BUNDLE) String key, Object... params) {
84-
return CommonBundle.message(ResourceBundle.getBundle(BUNDLE), key, params);
85+
return AbstractBundle.message(ResourceBundle.getBundle(BUNDLE), key, params);
8586
}
8687

8788
@Override
8889
public ReturnResult beforeCheckin(@Nullable CommitExecutor executor,
8990
PairConsumer<Object, Object> additionalDataConsumer) {
9091
Project project = checkinProjectPanel.getProject();
91-
if (project == null) {
92-
log.error("Could not get project for check-in panel, skipping");
93-
return ReturnResult.COMMIT;
94-
}
9592

9693
PMDProjectComponent plugin = project.getComponent(PMDProjectComponent.class);
9794
if (plugin == null) {
@@ -180,7 +177,9 @@ private void showToolWindow(List<PMDBranchNode> ruleSetResultNodes, Project proj
180177
resultPanel.addNode(rootNode, ruleSetNode);
181178
}
182179
ToolWindow toolWindow = ToolWindowManager.getInstance(project).getToolWindow(PMDProjectComponent.TOOL_ID);
183-
toolWindow.activate(null);
180+
if (toolWindow != null) {
181+
toolWindow.activate(null);
182+
}
184183
plugin.setLastRunActionAndRules(null, StringUtils.join(plugin.getCustomRuleSetPaths(), PMDInvoker.RULE_DELIMITER), true);
185184
}
186185
}

0 commit comments

Comments
 (0)