|
1 | 1 | package com.intellij.plugins.bodhi.pmd.handlers;
|
2 | 2 |
|
| 3 | +import com.intellij.AbstractBundle; |
3 | 4 | import com.intellij.CommonBundle;
|
4 | 5 | import com.intellij.openapi.project.Project;
|
5 | 6 | import com.intellij.openapi.ui.Messages;
|
|
37 | 38 | public class PMDCheckinHandler extends CheckinHandler {
|
38 | 39 |
|
39 | 40 | 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"; |
41 | 42 |
|
42 | 43 | @NonNls
|
43 | 44 | private final CheckinProjectPanel checkinProjectPanel;
|
@@ -81,17 +82,13 @@ public void restoreState() {
|
81 | 82 |
|
82 | 83 | @NotNull
|
83 | 84 | 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); |
85 | 86 | }
|
86 | 87 |
|
87 | 88 | @Override
|
88 | 89 | public ReturnResult beforeCheckin(@Nullable CommitExecutor executor,
|
89 | 90 | PairConsumer<Object, Object> additionalDataConsumer) {
|
90 | 91 | 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 |
| - } |
95 | 92 |
|
96 | 93 | PMDProjectComponent plugin = project.getComponent(PMDProjectComponent.class);
|
97 | 94 | if (plugin == null) {
|
@@ -180,7 +177,9 @@ private void showToolWindow(List<PMDBranchNode> ruleSetResultNodes, Project proj
|
180 | 177 | resultPanel.addNode(rootNode, ruleSetNode);
|
181 | 178 | }
|
182 | 179 | ToolWindow toolWindow = ToolWindowManager.getInstance(project).getToolWindow(PMDProjectComponent.TOOL_ID);
|
183 |
| - toolWindow.activate(null); |
| 180 | + if (toolWindow != null) { |
| 181 | + toolWindow.activate(null); |
| 182 | + } |
184 | 183 | plugin.setLastRunActionAndRules(null, StringUtils.join(plugin.getCustomRuleSetPaths(), PMDInvoker.RULE_DELIMITER), true);
|
185 | 184 | }
|
186 | 185 | }
|
0 commit comments