Skip to content

Commit 5aac170

Browse files
committed
Merge branch 'issue-70'
2 parents bf1b2c8 + 8493ddb commit 5aac170

File tree

3 files changed

+28
-1
lines changed

3 files changed

+28
-1
lines changed

ReleaseNotes.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,12 @@ Eclipse Update Site:
1313

1414
### Fixed Issues
1515

16+
* [#70](https://github.com/pmd/pmd-eclipse-plugin/issues/70): UnsupportedOperationException opening Rule Configuration
17+
1618
### External Contributions
1719

20+
* [#75](https://github.com/pmd/pmd-eclipse-plugin/pull/75): Prevent UnsupportedOperationException #70
21+
1822

1923
## 20-December-2018: 4.0.18.v20181220-1448
2024

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package net.sourceforge.pmd.eclipse.ui.preferences.br;
2+
3+
import static org.junit.Assert.assertNotNull;
4+
5+
import org.junit.Test;
6+
7+
import net.sourceforge.pmd.Rule;
8+
import net.sourceforge.pmd.eclipse.ui.IndexedString;
9+
import net.sourceforge.pmd.lang.rule.XPathRule;
10+
11+
public class RuleUIUtilTest {
12+
13+
/**
14+
* There should be no UnsupportedOperationException...
15+
*/
16+
@Test
17+
public void testTndexedPropertyStringFromRule() {
18+
Rule rule = new XPathRule();
19+
IndexedString s = RuleUIUtil.indexedPropertyStringFrom(rule);
20+
assertNotNull(s);
21+
}
22+
}

net.sourceforge.pmd.eclipse.plugin/src/main/java/net/sourceforge/pmd/eclipse/ui/preferences/panelmanagers/Configuration.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

22
package net.sourceforge.pmd.eclipse.ui.preferences.panelmanagers;
33

4+
import java.util.HashMap;
45
import java.util.Map;
56

67
import net.sourceforge.pmd.Rule;
@@ -23,7 +24,7 @@ private Configuration() { }
2324

2425
public static Map<PropertyDescriptor<?>, Object> filteredPropertiesOf(PropertySource source) {
2526

26-
Map<PropertyDescriptor<?>, Object> valuesByProp = source.getPropertiesByPropertyDescriptor();
27+
Map<PropertyDescriptor<?>, Object> valuesByProp = new HashMap<>(source.getPropertiesByPropertyDescriptor());
2728

2829
for (PropertyDescriptor<?> excludedRuleProperty : EXCLUDED_RULE_PROPERTIES) {
2930
valuesByProp.remove(excludedRuleProperty);

0 commit comments

Comments
 (0)