Skip to content

Commit

Permalink
#3766 - fixed cast
Browse files Browse the repository at this point in the history
  • Loading branch information
lgoltz authored and dstenger committed Jul 5, 2019
1 parent 6f8059b commit 497b832
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand All @@ -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() );
Expand Down Expand Up @@ -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;
}

}

0 comments on commit 497b832

Please sign in to comment.