#1094 NPE in BlockContainer for ColumnArrangement

open
nobody
General (896)
5
2012-11-27
2012-08-23
Konstantin_R
No

According to the documentation BlockContainer's method add() permits null values. However, it's method arrange() fails with NullPointerException for ColumnArrangement arrangement in this case.

Code that shows the problem:

public void testBlockContainerArrange() throws Exception {
BlockContainer container = new BlockContainer(new ColumnArrangement());
container.add(null); // null is permitted
container.arrange(null, new RectangleConstraint(20, 10));
}

The exact same problem occurs for FlowArrangement and does not occur for other arrangements.

Discussion