Skip to content

Commit 695a42f

Browse files
committed
Fix NPE for not initialized widgets field when switching selected rule
1 parent 34c4b9f commit 695a42f

File tree

1 file changed

+2
-10
lines changed
  • net.sourceforge.pmd.eclipse.plugin/src/main/java/net/sourceforge/pmd/eclipse/ui/preferences/panelmanagers

1 file changed

+2
-10
lines changed

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

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -130,15 +130,6 @@ private int rearrangeFor(PropertySource theSource) {
130130

131131
Map<PropertyDescriptor<?>, Object> valuesByDescriptor = Configuration.filteredPropertiesOf(propertySource);
132132

133-
if (valuesByDescriptor.isEmpty()) {
134-
if (RuleUtil.isXPathRule(propertySource)) {
135-
addAddButton();
136-
parent.pack();
137-
return 1;
138-
}
139-
return 0;
140-
}
141-
142133
PropertyDescriptor<?>[] orderedDescs = valuesByDescriptor.keySet().toArray(new PropertyDescriptor[0]);
143134
Arrays.sort(orderedDescs, Comparator.comparing(PropertyDescriptor::name));
144135

@@ -151,9 +142,10 @@ private int rearrangeFor(PropertySource theSource) {
151142
layout.verticalSpacing = 2;
152143
layout.marginTop = 1;
153144
parent.setLayout(layout);
154-
155145
widgets = new Control[rowCount][columnCount];
156146

147+
148+
157149
int rowsAdded = 0;
158150

159151
for (PropertyDescriptor<?> desc : orderedDescs) {

0 commit comments

Comments
 (0)