Hi,
working on some unrelated fixes I've found what appears to be some
confusion about the case sensitivity in our filter factory, and more
confusion
in our actual filter implementation about it.
I've always assumed that if you are building a filter without specifying the
matchCase parameter, you get a case sensitive one.
Looking at the FilterFactoryImpl code it appears I'm wrong, but the code
is not consistent with itself either:
public PropertyIsEqualTo equals(Expression expr1, Expression expr2) {
*return equal( expr1,expr2,true);*
}
public PropertyIsEqualTo equal(Expression expr1, Expression expr2,
boolean matchCase) {
return new IsEqualsToImpl(expr1,expr2,matchCase);
}
public PropertyIsEqualTo equal(Expression expr1, Expression expr2,
boolean matchCase,
MatchAction matchAction) {
return new IsEqualsToImpl(expr1,expr2,matchCase,matchAction);
}
public PropertyIsNotEqualTo notEqual(Expression expr1, Expression
expr2) {
*return notEqual(expr1, expr2, false );*
}
public PropertyIsNotEqualTo notEqual(Expression expr1, Expression
expr2, boolean matchCase) {
return new IsNotEqualToImpl(expr1,expr2,matchCase);
}
public PropertyIsNotEqualTo notEqual(Expression expr1, Expression
expr2, boolean matchCase,
MatchAction matchAction) {
return new IsNotEqualToImpl(expr1,expr2,matchCase,matchAction);
}
public PropertyIsGreaterThan greater(Expression expr1, Expression
expr2) {
*return greater(expr1,expr2,false);*
}
public PropertyIsGreaterThan greater(Expression expr1, Expression
expr2, boolean matchCase) {
return new IsGreaterThanImpl(expr1, expr2);
}
public PropertyIsGreaterThan greater(Expression expr1, Expression
expr2, boolean matchCase,
MatchAction matchAction) {
return new IsGreaterThanImpl( expr1, expr2, matchAction);
}
public PropertyIsGreaterThanOrEqualTo greaterOrEqual(Expression expr1,
Expression expr2) {
*return greaterOrEqual(expr1,expr2,false);*
}
public PropertyIsGreaterThanOrEqualTo greaterOrEqual(Expression expr1,
Expression expr2, boolean matchCase) {
return new IsGreaterThanOrEqualToImpl(expr1,expr2,matchCase);
}
public PropertyIsGreaterThanOrEqualTo greaterOrEqual(Expression expr1,
Expression expr2,
boolean matchCase, MatchAction matchAction) {
return new
IsGreaterThanOrEqualToImpl(expr1,expr2,matchCase,matchAction);
}
public PropertyIsLessThan less(Expression expr1, Expression expr2) {
*return less(expr1,expr2,false);*
}
public PropertyIsLessThan less(Expression expr1, Expression expr2,
boolean matchCase) {
return new IsLessThenImpl(expr1,expr2,matchCase);
}
So, equal is case sensitive by default, but everything else is not?? That
does not sound right?
Moreover, looking at our implementations, it seems that only IsEqualsToImpl
uses the matchcase property,
all other comparison filters appear to simply ignore it.
And for SQL conversion, the matchCase is only handled for PropertyIsEqualTo
and PropertyIsEqualTo
(and of course if the attribute is a String). Holy mess Batman!
Ideas?
Cheers
Andrea
--
==
GeoServer Professional Services from the experts! Visit
http://goo.gl/NWWaa2 for more information.
==
Ing. Andrea Aime
@geowolf
Technical Lead
GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549
http://www.geo-solutions.it
http://twitter.com/geosolutions_it
*AVVERTENZE AI SENSI DEL D.Lgs. 196/2003*
Le informazioni contenute in questo messaggio di posta elettronica e/o
nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il
loro utilizzo è consentito esclusivamente al destinatario del messaggio,
per le finalità indicate nel messaggio stesso. Qualora riceviate questo
messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
darcene notizia via e-mail e di procedere alla distruzione del messaggio
stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso,
divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
utilizzarlo per finalità diverse, costituisce comportamento contrario ai
principi dettati dal D.Lgs. 196/2003.
The information in this message and/or attachments, is intended solely for
the attention and use of the named addressee(s) and may be confidential or
proprietary in nature or covered by the provisions of privacy act
(Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
Code).Any use not in accord with its purpose, any disclosure, reproduction,
copying, distribution, or either dissemination, either whole or partial, is
strictly forbidden except previous formal approval of the named
addressee(s). If you are not the intended recipient, please contact
immediately the sender by telephone, fax or e-mail and delete the
information in this message that has been received in error. The sender
does not give any warranty or accept liability as the content, accuracy or
completeness of sent messages and accepts no responsibility for changes
made after they were sent or for other risks which arise as a result of
e-mail transmission, viruses, etc.
-------------------------------------------------------
------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel