getAs is problematic as we have to check if type of `Any` is castable into type of `T` and store the result as `Option(result)`. This is difficult as we can't catch the runtime cast exception and set the result as None - because scala wouldnt pattern match it and we would end up with `Some(None)` values which wasn't ideal.
We moved to using reflection, which also has issues because we check against the exact type as such and is prone to error because we can't rely on implicit conversions from Integer to Long `.getAs[Integer]("nscanned")` would work but not the conversion to Long.
I'm happy to review any patches to see if this can be improved on and perhaps this will become less of an issue once support for older scala versions is dropped.
댓글 없음:
댓글 쓰기