Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
space88man opened this issue Apr 26, 2023 · 1 comment

Comments

@space88man
Copy link

space88man commented Apr 26, 2023

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;
    }
}
@BoykoAlex
Copy link
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
Projects
None yet
Development

No branches or pull requests

3 participants