This bug came from the 4950972 bug.
The problem is that this:
container.add(component, BorderLayout.NORTH);
is not quite the same as:
container.add(component);
container.getLayout().addLayoutComponent(BorderLayout.NORTH,component);
The latter is what the XMLEncoder creates for the former.
The latter is equivalent to:
container.add(BorderLayout.CENTER,component);
container.getLayout().addLayoutComponent(BorderLayout.NORTH,component);
The problem is that the same component is both the CENTER and the NORTH component in the BorderLayout! BorderLayout assigns bounds to the NORTH first and then to the CENTER; our poor component gets its bounds set twice and lands in the center, with space taken in the east for a phantom version.