Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Unable to override not initialized Boolean property with false value #1

@szpak

Description

@szpak

A try to override not initialized Boolean property like below:

class MyExtension {
    Boolean myBoolean
}

with false value

-Doverride.example.myBoolean=false

ends with true value assigned.

After some debugging the problem is in DotNotationWalkerOverrideStrategy. determineProperty() for not initialized field property it returns null and clazz is set to NullObject. parent.setProperty doesn't know that is a Boolean field and set false as String and for Groovy is true.

It would be required to get a type of not initialized property in Groovy object, but I don't know if Groovy offers that information.

In a few minutes I will make a pull request with test reproducing that case.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions