Details
Description
I tried to do some parsing of GML geometries via the built-in parser and dedicated configurations (org.geotools.gml3.GMLConfiguration, org.geotools.gml3.v3_2.GMLConfiguration).
Somehow, parsing of a GML 3.2 polygon is problematic due to SAX bindings. I am using exactly the same geometry markup for both GML 3.1.1 and 3.2.1 (see used xml below), but parsing fails for 3.2.1.
I traced down the cause and found the root of the issue inside the GML 3.2.1 schemas. While the 3.1.1 AbstractRingType has a defined baseType (AbstractGeometryType), the 3.2.1 version does not provide a base. So, the GeoTools XML handler resolves xsd:any as the base, linking it with the XSAnyTypeBinding. When it comes to actually resolving the value of the Node, the handler first resolves it for LinearRingTypeBinding (which is good) but then overrides it with the value from XSAnyTypeBinding (which is likely to be a String). This results in a ClassCastException later when the parser tries to cast it to a JTS LinearRing.
I have tested this with version 2.7.4 and 2.7.5, same behaviour in both versions. I have created a workaround (registering an additional binding for gml32:AbstractRingType, which returns Binding.OVERRIDE resulting in a break out of binding resolving). See attached JUnit test for details.