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

@ConfigProperty defaultValue marked wrongly as an error ...'does not match expected type of '... despite fact that correct org.eclipse.microprofile.config.spi.Converter exists #396

Open
mariankassovic opened this issue May 10, 2023 · 1 comment
Labels
bug Something isn't working validation

Comments

@mariankassovic
Copy link

mariankassovic commented May 10, 2023

Validation incorrectly reports:
'00:00' does not match the expected type of 'LocalTime'.

despite fact that there is defined org.eclipse.microprofile.config.spi.Converter for LocalTime

  @Inject
  @ConfigProperty(name = "startTime", defaultValue = "00:00")
  private LocalTime startTime;

converter is implemented as simple as

import java.time.LocalTime;

import org.eclipse.microprofile.config.spi.Converter;

public class LocalTimePropertyConverter implements Converter<LocalTime> {
  @Override
  public LocalTime convert(String value) {
    return LocalTime.parse(value);
  }
}

code works as expected, compiles and junits works as well - only validation reports incorrect error.

@fbricon fbricon added bug Something isn't working validation labels May 10, 2023
@angelozerr
Copy link
Contributor

We should have the same problem in JDT. If I remember we skip converter because it is not an easy task to support them and we take care of simple type without converter.

I dont know if it will be easy to support this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working validation
Projects
None yet
Development

No branches or pull requests

3 participants