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 #64

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 #64 into develop will decrease coverage by 0.03%. The diff coverage is 100%.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop      #64      +/-   ##
=============================================
- Coverage       70.1%   70.06%   -0.04%     
  Complexity        27       27              
=============================================
  Files            152      152              
  Lines           3813     3812       -1     
  Branches         423      423              
=============================================
- Hits            2673     2671       -2     
  Misses          1026     1026              
- Partials         114      115       +1
Impacted Files Coverage Δ Complexity Δ
.../no/ssb/vtl/script/operations/FilterOperation.java 86.66% <100%> (-0.84%) 0 <0> (ø)
...odel/src/main/java/no/ssb/vtl/model/VTLObject.java 81.63% <0%> (-2.05%) 0% <0%> (ø)

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 9dafa42...5a3a840. Read the comment docs.

takvamborgen commented 6 years ago

As develop is reverted, I close this and open a new one branched from current develop head.