Permalink
Browse files

undo parser changes, remove misleading comment in query walker

git-svn-id: https://svn.apache.org/repos/asf/chemistry/opencmis/trunk@1328119 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
Jens Hübel
Jens Hübel committed Apr 19, 2012
1 parent 0ee6fd6 commit d39c662abefc543c0215881a96fff35286426078
@@ -55,7 +55,6 @@
import org.apache.chemistry.opencmis.inmemory.types.PropertyUtil;
import org.apache.chemistry.opencmis.server.support.TypeManager;
import org.apache.chemistry.opencmis.server.support.query.AbstractPredicateWalker;
-import org.apache.chemistry.opencmis.server.support.query.CalendarHelper;
import org.apache.chemistry.opencmis.server.support.query.CmisQueryWalker;
import org.apache.chemistry.opencmis.server.support.query.CmisSelector;
import org.apache.chemistry.opencmis.server.support.query.ColumnReference;
@@ -660,20 +659,12 @@ protected int compareTo(PropertyDefinition<?> td, Object lValue, Object rVal) {
break;
}
case DATETIME:
- // parse date from string
- GregorianCalendar dt;
-
- if (rVal instanceof String)
- dt = CalendarHelper.fromString((String) rVal); // will throw exception if not parsable
- else if (rVal instanceof GregorianCalendar)
- dt = (GregorianCalendar) rVal;
- else
- throw new IllegalArgumentException("Unsupported date type " + rVal);
- // LOG.debug("left:" +
- // CalendarHelper.toString((GregorianCalendar)lValue) +
- // " right: " +
- // CalendarHelper.toString((GregorianCalendar)rVal));
- return ((GregorianCalendar) lValue).compareTo(dt);
+ if (rVal instanceof GregorianCalendar) {
+ return ((GregorianCalendar) lValue).compareTo((GregorianCalendar) rVal);
+ } else {
+ throwIncompatibleTypesException(lValue, rVal);
+ }
+ break;
case DECIMAL: {
Double lDoubleValue = ((BigDecimal) lValue).doubleValue();
if (rVal instanceof Double) {
@@ -350,11 +350,6 @@ literal returns [Object value]:
{
String s = $TIME_LIT.text;
s = s!= null ? s.substring(s.indexOf('\'') + 1, s.length() - 1) : null;
- try {
- // $value = CalendarHelper.fromString(s);
- } catch (IllegalArgumentException e) {
- throw new UnwantedTokenException(Token.INVALID_TOKEN_TYPE, input);
- }
}
| BOOL_LIT
{

0 comments on commit d39c662

Please sign in to comment.