diff --git a/deegree-core/deegree-core-sqldialect/deegree-sqldialect-postgis/src/main/java/org/deegree/sqldialect/postgis/PostGISWhereBuilder.java b/deegree-core/deegree-core-sqldialect/deegree-sqldialect-postgis/src/main/java/org/deegree/sqldialect/postgis/PostGISWhereBuilder.java index 22715f18ed..dc99b8301d 100644 --- a/deegree-core/deegree-core-sqldialect/deegree-sqldialect-postgis/src/main/java/org/deegree/sqldialect/postgis/PostGISWhereBuilder.java +++ b/deegree-core/deegree-core-sqldialect/deegree-sqldialect-postgis/src/main/java/org/deegree/sqldialect/postgis/PostGISWhereBuilder.java @@ -403,7 +403,7 @@ protected SQLOperation toProtoSQL( TemporalOperator op ) if ( isTimeInstant( parameter2 ) ) { TimePosition timePosition = ( (GenericTimeInstant) ( (Literal) parameter2 ).getValue() ).getPosition(); second = createDateExpression( timePosition ); - } else if ( isTimePeriod( (Literal) parameter2 ) ) { + } else if ( isTimePeriod( parameter2 ) ) { TimePosition end = ( (GenericTimePeriod) ( (Literal) parameter2 ).getValue() ).getEndPosition(); second = createDateExpression( end ); } else { @@ -420,7 +420,7 @@ protected SQLOperation toProtoSQL( TemporalOperator op ) if ( isTimeInstant( parameter2 ) ) { TimePosition timePosition = ( (GenericTimeInstant) ( (Literal) parameter2 ).getValue() ).getPosition(); second = createDateExpression( timePosition ); - } else if ( isTimePeriod( (Literal) parameter2 ) ) { + } else if ( isTimePeriod( parameter2 ) ) { TimePosition begin = ( (GenericTimePeriod) ( (Literal) parameter2 ).getValue() ).getBeginPosition(); second = createDateExpression( begin ); } else { @@ -446,7 +446,7 @@ protected SQLOperation toProtoSQL( TemporalOperator op ) } case DURING: { Expression parameter2 = op.getParameter2(); - if ( isTimePeriod( (Literal) parameter2 ) ) { + if ( isTimePeriod( parameter2 ) ) { TimePosition begin = ( (GenericTimePeriod) ( (Literal) parameter2 ).getValue() ).getBeginPosition(); TimePosition end = ( (GenericTimePeriod) ( (Literal) parameter2 ).getValue() ).getEndPosition(); SQLExpression valueReference = toProtoSQL( op.getParameter1() ); @@ -564,12 +564,12 @@ private SQLOperation createSqlAfter( SQLExpression first, SQLExpression second ) return builder.toOperation(); } - private boolean isTimePeriod( Literal parameter2 ) { - return parameter2 instanceof Literal && parameter2.getValue() instanceof GenericTimePeriod; + private boolean isTimePeriod( Expression parameter2 ) { + return parameter2 instanceof Literal && ( (Literal) parameter2 ).getValue() instanceof GenericTimePeriod; } private boolean isTimeInstant( Expression parameter2 ) { - return parameter2 instanceof Literal && ((Literal)parameter2).getValue() instanceof GenericTimeInstant; + return parameter2 instanceof Literal && ( (Literal) parameter2 ).getValue() instanceof GenericTimeInstant; } } \ No newline at end of file