openmicroscopy/bioformats — pull request #629 by melissalinkert (2013-08-06 20:44:44+00:00)
Title: Override getValue() in OriginalMetadataAnnotation (rebased onto develop)

This is the same as gh-617 but rebased onto develop.

----

This prevents getValue() from returning null, as it previously delegated
to the implementation in XMLAnnotation, which returns XMLAnnotation's
internal 'value'.

Noticed by Stéphane Dallongeville.

This test code demonstrates the issue:

```
ImageReader reader = new ImageReader();
reader.setOriginalMetadataPopulated(true);
reader.setMetadataStore(new OMEXMLMetadataImpl());
reader.setId(filename);

OMEXMLMetadataImpl meta = (OMEXMLMetadataImpl) reader.getMetadataStore();
OME root = (OME) meta.getRoot();
StructuredAnnotations struct = root.getStructuredAnnotations();

System.out.println(struct.getXMLAnnotation(0).getValue());

reader.close();
```

Without this PR, ```null``` should be printed for any file. For the same file with this PR, a non-null value matching the ```Value``` of the first ```OriginalMetadata``` annotation should be printed.

/cc @Stephane-D