Skip to content
This repository was archived by the owner on Mar 3, 2019. It is now read-only.
This repository was archived by the owner on Mar 3, 2019. It is now read-only.

Argument factories should be using Class.isAssignableFrom, not instanceof #23

@qualidafial

Description

@qualidafial

instanceof is always false for null, which means the argument factory misses a chance to provide the correct SQL type.

These factories should be using e.g. Foo.class.isAssignableFrom(expectedType) instead of value instanceof Foo:

  • InstantArgumentFactory
  • LocalDateArgumentFactory
  • LocalDateTimeArgumentFactory
  • OptionalArgumentFactory
  • OptionalInstantArgumentFactory
  • OptionalLocalDateArgumentFactory
  • OptionalLocalDateTimeArgumentFactory

Although the optional ones are arguably moot, since one should never pass null to a method that expects an optional.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions