MNT-21967 - ClassCastException when using CMIS query with SCORE() function (#128)

* Added missing validation before if columnName is the expected column
before normalizing value to float, in case the column is Score
This commit is contained in:
evasques
2020-11-05 19:19:14 +00:00
committed by GitHub
parent 67bbfed474
commit acac23f29a

View File

@@ -177,13 +177,13 @@ public class CMISResultSetRow implements ResultSetRow
context.setScore(getScore()); context.setScore(getScore());
for (Column column : query.getColumns()) for (Column column : query.getColumns())
{ {
// When an SCORE selector is included, score must be adapted to range 0..1 due to CMIS specification if (column.getAlias().equals(columnName))
if (column.getFunction()!= null && column.getFunction().getName().equals(Score.NAME))
{
return getNormalisedScore();
}
else if (column.getAlias().equals(columnName))
{ {
//When an SCORE selector is included, score must be adapted to range 0..1 due to CMIS specification
if (column.getFunction()!= null && column.getFunction().getName().equals(Score.NAME))
{
return getNormalisedScore();
}
return column.getFunction().getValue(column.getFunctionArguments(), context); return column.getFunction().getValue(column.getFunctionArguments(), context);
} }
// Special case for one selector - ignore any table aliases // Special case for one selector - ignore any table aliases