Skip to content

spring-boot-configuration-processor fails compilation due to @DefaultValue with a long value and generates invalid metadata for byte and short properties with out-of-range default values #30020

@roded

Description

@roded

Using Spring Boot 2.6.4.

package test;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.ConstructorBinding;
import org.springframework.boot.context.properties.bind.DefaultValue;
import org.springframework.validation.annotation.Validated;

@Validated
@ConstructorBinding
@ConfigurationProperties(prefix = "myprefix")
public class Test {

    private final long myLongValue;

    public Test(@DefaultValue("3221225472") long myLongValue) {
        this.myLongValue = myLongValue;
    }

    public long getMyLongValue() {
        return myLongValue;
    }
}

Error:

error: Invalid number representation '3221225472'
    public Test(@DefaultValue("3221225472") long myLongValue) {

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions