Hi Seb, On Thu, Jun 19, 2014 at 1:46 PM, <[email protected]> wrote:
> > it seems to be related to NUTCH-1714: > WebPage-owned maps (metadata, headers, etc.) are not > initialized any more in the constructor. > Yeah, I thought we had addressed this in the patch! We should create empty data structures for MapWrapper, ArrayWrapper, etc to work with rather than a null field. This causes also other tests to fail. > > The solution would be to replace > WebPage page = new WebPage(); > by > WebPage page = WebPage.newBuilder().build(); > in every test where a WebPage object is needed. > > Right? > Yes, this is the best way to use new Objects. Unlike constructors, builders will automatically set any default values specified in the WebPage/Host (or any others JSON) schema. Additionally, builders validate the data as it set, whereas objects constructed directly will not cause an error until the object is serialized. However, using constructors directly generally offers better performance, as builders create a copy of the datastructure before it is written. > > I'll open a Jira and try to provide a patch. > > That would be excellent. I thought that this was related to something else entirely... e.g. a dodgy commit. Hopefully this is the root of the problem.

