aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/sonar-findbugs-plugin/src/main/java/org/sonar/plugins/findbugs/xml/FindBugsFilter.java2
-rw-r--r--plugins/sonar-findbugs-plugin/src/test/java/org/sonar/plugins/findbugs/FindbugsProfileImporterTest.java6
-rw-r--r--plugins/sonar-findbugs-plugin/src/test/resources/org/sonar/plugins/findbugs/shouldImportPatterns.xml16
3 files changed, 13 insertions, 11 deletions
diff --git a/plugins/sonar-findbugs-plugin/src/main/java/org/sonar/plugins/findbugs/xml/FindBugsFilter.java b/plugins/sonar-findbugs-plugin/src/main/java/org/sonar/plugins/findbugs/xml/FindBugsFilter.java
index 9790f185d22..31d721deca1 100644
--- a/plugins/sonar-findbugs-plugin/src/main/java/org/sonar/plugins/findbugs/xml/FindBugsFilter.java
+++ b/plugins/sonar-findbugs-plugin/src/main/java/org/sonar/plugins/findbugs/xml/FindBugsFilter.java
@@ -151,7 +151,7 @@ public class FindBugsFilter {
}
private void mapRulePriority(Map<String, RulePriority> prioritiesByRule, RulePriority priority, String key) {
- if (prioritiesByRule.containsKey(key)) {
+ if (prioritiesByRule.containsKey(key) && prioritiesByRule.get(key) != null) {
if (prioritiesByRule.get(key).compareTo(priority) < 0) {
prioritiesByRule.put(key, priority);
}
diff --git a/plugins/sonar-findbugs-plugin/src/test/java/org/sonar/plugins/findbugs/FindbugsProfileImporterTest.java b/plugins/sonar-findbugs-plugin/src/test/java/org/sonar/plugins/findbugs/FindbugsProfileImporterTest.java
index b829ce9abf1..b8ccd2e4b5a 100644
--- a/plugins/sonar-findbugs-plugin/src/test/java/org/sonar/plugins/findbugs/FindbugsProfileImporterTest.java
+++ b/plugins/sonar-findbugs-plugin/src/test/java/org/sonar/plugins/findbugs/FindbugsProfileImporterTest.java
@@ -108,7 +108,7 @@ public class FindbugsProfileImporterTest {
assertThat(results.size(), is(0));
assertThat(messages.getErrors().size(), is(1));
}
-
+
@Test
public void testImportingXmlFileWithUnknownRule() throws IOException {
String uncorrectFindbugsXml = TestUtils.getResourceContent("/org/sonar/plugins/findbugs/findbugsXmlWithUnknownRule.xml");
@@ -119,7 +119,7 @@ public class FindbugsProfileImporterTest {
assertThat(results.size(), is(1));
assertThat(messages.getWarnings().size(), is(1));
}
-
+
@Test
public void testImportingXmlFileWithUnknownCategory() throws IOException {
String uncorrectFindbugsXml = TestUtils.getResourceContent("/org/sonar/plugins/findbugs/findbugsXmlWithUnknownCategory.xml");
@@ -130,7 +130,7 @@ public class FindbugsProfileImporterTest {
assertThat(results.size(), is(142));
assertThat(messages.getWarnings().size(), is(1));
}
-
+
@Test
public void testImportingXmlFileWithUnknownCode() throws IOException {
String uncorrectFindbugsXml = TestUtils.getResourceContent("/org/sonar/plugins/findbugs/findbugsXmlWithUnknownCode.xml");
diff --git a/plugins/sonar-findbugs-plugin/src/test/resources/org/sonar/plugins/findbugs/shouldImportPatterns.xml b/plugins/sonar-findbugs-plugin/src/test/resources/org/sonar/plugins/findbugs/shouldImportPatterns.xml
index b454f431b93..a07b9ca4295 100644
--- a/plugins/sonar-findbugs-plugin/src/test/resources/org/sonar/plugins/findbugs/shouldImportPatterns.xml
+++ b/plugins/sonar-findbugs-plugin/src/test/resources/org/sonar/plugins/findbugs/shouldImportPatterns.xml
@@ -1,9 +1,11 @@
<FindBugsFilter>
- <Match>
- <Or>
- <Bug pattern="NP_CLOSING_NULL"/>
- <Bug pattern="RC_REF_COMPARISON_BAD_PRACTICE"/>
- </Or>
- <Priority value="2"/>
- </Match>
+ <Match>
+ <Bug pattern="NP_CLOSING_NULL" />
+ </Match>
+ <Match>
+ <Bug pattern="RC_REF_COMPARISON_BAD_PRACTICE" />
+ </Match>
+ <Match>
+ <Bug pattern="RC_REF_COMPARISON_BAD_PRACTICE" />
+ </Match>
</FindBugsFilter> \ No newline at end of file