Specifically if the field has a different name than its getter/setter (real example io.awspring.cloud.autoconfigure.core.RegionProperties):

@ConfigurationProperties(prefix = RegionProperties.PREFIX)
public static class RegionProperties {

    public static final String PREFIX = "spring.cloud.aws.region";

    private String staticRegion;

    private boolean instanceProfile = false;

    public String getStatic() {
        return staticRegion;
    }

    public void setStatic(@Nullable String staticRegion) {
        this.staticRegion = staticRegion;
    }

    public boolean isInstanceProfile() {
        return this.instanceProfile;
    }

    public void setInstanceProfile(boolean instanceProfile) {
        this.instanceProfile = instanceProfile;
    }

    @Override
    public String toString() {
        return "RegionProperties{" +
                "staticRegion='" + staticRegion + '\'' +
                ", instanceProfile=" + instanceProfile +
                '}';
    }
}

With the following configuration:

spring:
  cloud:
    aws:
      region:
        static: eu-central-1
        static-region: us-east-1
        instance-profile: true

When loaded System.out.println(properties) prints:

RegionProperties{staticRegion='null', instanceProfile=true}

If you change the getter and setter to match the field name (i.e. getStaticRegion and setStaticRegion) the same configuration prints:

RegionProperties{staticRegion='us-east-1', instanceProfile=true}

I'm not sure what the root cause is or if it's a known limitation (Is there any documentation regarding known limitation apart from beta version?), neither do I know where is the right place to file the issue.

Comment From: wilkinsona

I can't reproduce this behaviour with either 3.0.0-RC2 or 3.0.0-SNAPSHOT:

$ build/native/nativeCompile/gh-33242

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::            (v3.0.0-RC2)

2022-11-17T17:08:16.260Z  INFO 60407 --- [           main] com.example.gh33242.Gh33242Application   : Starting AOT-processed Gh33242Application using Java 17.0.5 with PID 60407 (/Users/awilkinson/Downloads/gh-33242/build/native/nativeCompile/gh-33242 started by awilkinson in /Users/awilkinson/Downloads/gh-33242)
2022-11-17T17:08:16.260Z  INFO 60407 --- [           main] com.example.gh33242.Gh33242Application   : No active profile set, falling back to 1 default profile: "default"
2022-11-17T17:08:16.265Z  INFO 60407 --- [           main] com.example.gh33242.Gh33242Application   : Started Gh33242Application in 0.013 seconds (process running for 0.022)
RegionProperties{staticRegion='eu-central-1', instanceProfile=true}

If you would like us to spend some more time investigating, please spend some time providing a complete yet minimal sample that reproduces the problem. You can share it with us by pushing it to a separate repository on GitHub or by zipping it up and attaching it to this issue.

Comment From: akefirad

OK, while preparing the sample project, I found the root cause. It is the additional isStatic method in the original RegionProperties class. Removing it resolves the issue. Adding getStaticRegion would also solve the issue, but only because the field becomes visible under the new name. I must have removed the isStatic method while cleaning up the code to paste it here. Sorry for the confusion. Here's the sample project. Let me know if you want to have it as a repo. test-property-getter.zip

Comment From: wilkinsona

Thanks, @akefirad. I've reproduced the problem now using 3.0.0-RC2. It doesn't occur with 3.0.0-SNAPSHOT due to, I believe, the changes made for https://github.com/spring-projects/spring-boot/issues/33232. I'll retitle and retag that issue to reflect the fact that it has fixed a bug.