Augmenter throws null pointer exception when casting the related object ids retrieved from the GeoContext
Augmenter throws null pointer exception when it tried to get the reference id and the reference object id is null. The bug was introduced by the MR 620 included in M21.
The issue was discovered in M22 deployment when augmenter tried to cast a null reference object id from GoeContext object. GeoContext has 5 reference object id properties defined in Schema. In each GeoContext, only 1 reference object id is not null.
Here is the example:
- Format in Storage record
{
"GeoContexts": [{
"GeoPoliticalEntityID": "opendes:master-data--GeoPoliticalEntity:111111:",
"GeoTypeID": "opendes:reference-data--GeoPoliticalEntityType:LicenseBlock:"
}, {
"FieldID": "opendes:master-data--Field:444444:"
}
]
}
- Format in index record
{
"GeoContexts": [{
"BasinID": null,
"FieldID": null,
"PlayID": null,
"GeoPoliticalEntityID": "opendes:master-data--GeoPoliticalEntity:111111:",
"GeoTypeID": "opendes:reference-data--GeoPoliticalEntityType:LicenseBlock:",
"ProspectID": null
}, {
"BasinID": null,
"FieldID": "opendes:master-data--Field:444444:",
"PlayID": null,
"GeoPoliticalEntityID": null,
"GeoTypeID": "Field",
"ProspectID": null
}
]
}
With the bug introduced, the Augmenter considers the related object id "FieldID" has value without checking whether the value is null or not before casting it to String. In this case, a NullPointerException is thrown. The augmenting for the record will fail though it does not affect the normal indexing.
Edited by Zhibin Mai