Skip to content

spring-configuration-metadata : when two properties have the same Object type F3 fails on the later ones #1031

Closed

Description

@space88man

Describe the bug
When @ConfigurationProperties has more than one field of the same non-primitive type, F3 navigation fails on the later(lexicographic) ones.

To Reproduce
Editor -> application.yml -> press F3 on property

Observe:

  • app3, app3.service1.** - navigates with F3
  • app3.service2 - does not navigate
  • rename service2 to service0: now app3.service0 navigates but app3.service1 stops working

Sample
gh-sts4-sampleV2.zip
We add a primitive type field to app3, OTW it won't navigate see #1030

app3:
  value: true
  service1:
    host: 1.2.3.4
    port: 5000
  service2:
    host: 1.2.3.4
    port: 5000
@ConfigurationProperties(prefix = "app3")
public class Settings3 {
    public static class Endpoint {
        private String host;
        private int port;
        public String getHost() {
            return host;
        }
        public void setHost(String host) {
            this.host = host;
        }
        public int getPort() {
            return port;
        }
        public void setPort(int port) {
            this.port = port;
        }
        
    }

    private Endpoint service1;
    private Endpoint service2;
    private boolean value;

    public Endpoint getService1() {
        return service1;
    }
    public void setService1(Endpoint service1) {
        this.service1 = service1;
    }
    public Endpoint getService2() {
        return service2;
    }
    public void setService2(Endpoint service2) {
        this.service2 = service2;
    }
    public boolean isValue() {
        return value;
    }
    public void setValue(boolean value) {
        this.value = value;
    }
}

Activity

  1. added this to the 4.18.1.RELEASE milestone on Apr 27, 2023
  2. self-assigned this
    on Apr 27, 2023
  3. BoykoAlex commented on Apr 27, 2023

    @BoykoAlex
    Contributor

    Fixed with e9b7518 (and two commits above it)
    Update from the nightly build. Find appropriate p2 repo here: https://dist.springsource.com/snapshot/STS4/nightly-distributions.html (see STS4 Distribution section at the top of the page)
    The snapshot build should be available Apr 27 AM hours EST

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions