statisticsnorway / java-vtl

An Open Source Java implementation of the Validation Transformation Language, based on the VTL 1.1 draft specification. The implementation follows the JSR-223 Java Scripting API and exposes a simple connector interface one can implement in order to integrate with any data stores. VTL is a standard language for defining validation and transformation rules (set of operators, their syntax and semantics) for any kind of statistical data.
http://java-vtl.org
Apache License 2.0
21 stars 7 forks source link

Fix ClassCastException when filter check encounters null values #67

Closed takvamborgen closed 6 years ago

takvamborgen commented 6 years ago

When filter on a value encounters a null value, that null value is resolved as (VTLObject)null, which gave a ClassCastException when trying to cast the result to VTLBoolean. This is solved by only casting to VTLBoolean if the value is not null.

codecov[bot] commented 6 years ago

Codecov Report

Merging #67 into develop will decrease coverage by 0.06%. The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop      #67      +/-   ##
===========================================
- Coverage    77.38%   77.31%   -0.07%     
===========================================
  Files          133      133              
  Lines         3312     3311       -1     
  Branches       381      381              
===========================================
- Hits          2563     2560       -3     
- Misses         635      636       +1     
- Partials       114      115       +1
Impacted Files Coverage Δ
.../no/ssb/vtl/script/operations/FilterOperation.java 85.71% <100%> (-0.96%) :arrow_down:
...odel/src/main/java/no/ssb/vtl/model/VTLObject.java 79.59% <0%> (-4.09%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 1ddbf49...adb4ff1. Read the comment docs.