I found this issue by trying to create a feature type with a field
called "POINT". This failed with the following stack trace:
java.util.EmptyStackException
at java.base/java.util.Stack.peek(Unknown Source)
at java.base/java.util.Stack.pop(Unknown Source)
-- lots of ECQL stack trace removed for brevity --
at org.geotools.filter.text.ecql.ECQL.toExpression(ECQL.java:125)
at org.geoserver.catalog.impl.AttributeTypeInfoImpl.getSource(AttributeTypeInfoImpl.java:147)
A review of the source code in AttributeTypeInfoImpl helped me find two issues:
1. Simply being able to parse a string as ECQL doesn't tell us if the
resulting ECQL would do what we want - what we need to know, before
deciding to apply quotes, is if the ECQL parser would currently parse
this field name as a PropertyName (what we want) or something else.
2. Not all ECQL parsing failures are CQLException - there is also
(as the stack trace shows) EmptyStackException and there may be more.
I found this issue by trying to create a feature type with a field called "POINT". This failed with the following stack trace: java.util.EmptyStackException at java.base/java.util.Stack.peek(Unknown Source) at java.base/java.util.Stack.pop(Unknown Source) -- lots of ECQL stack trace removed for brevity -- at org.geotools.filter.text.ecql.ECQL.toExpression(ECQL.java:125) at org.geoserver.catalog.impl.AttributeTypeInfoImpl.getSource(AttributeTypeInfoImpl.java:147) A review of the source code in AttributeTypeInfoImpl helped me find two issues: 1. Simply being able to parse a string as ECQL doesn't tell us if the resulting ECQL would do what we want - what we need to know, before deciding to apply quotes, is if the ECQL parser would currently parse this field name as a PropertyName (what we want) or something else. 2. Not all ECQL parsing failures are CQLException - there is also (as the stack trace shows) EmptyStackException and there may be more.