elasticsearch/elasticsearch — pull request #9105 by nknize (2014-12-30 17:32:03+00:00)
Title: [GEO] Throw helpful exception for Polygons with holes outside of shell

A recent situation occured in #9071 where a MultiPolygon coordinate array was accidentally defined as a single polygon with multiple holes. Since the intent was a MultiPolygon, the holes of the unintended Polygon fell outside the outer shell. This exposed a bug in the contains logic inside BasePolygonBuilder. An ArrayIndexOutOfBoundsException was being thrown instead of a more useful ElasticsearchParseException( "hole is not within polygon" ). This pull request fixes the bug and adds additional unit tests for verifying proper MultiPolygon type parsing.

closes #9071