Repository: micronaut-projects/micronaut-core
File: inject/src/main/java/io/micronaut/context/env/PropertySourcePropertyResolver.java (Java)

Code before:
        }
        return value;
    }

    private List<String> resolvePropertiesForConvention(String property, PropertySource.PropertyConvention convention) {
        if (convention == PropertySource.PropertyConvention.ENVIRONMENT_VARIABLE) {
            return environmentProperties.findPropertyNamesForEnvironmentVariable(property);
        }
        return Collections.singletonList(
                NameUtils.hyphenate(property, true)
        );
    }

    private void fill(List list, int toIndex, Object value) {
        if (toIndex >= list.size()) {
            for (int i = list.size(); i <= toIndex; i++) {
                list.add(i, value);
            }
        }
    }

    @Override
    public void close() throws Exception {
        if (propertyPlaceholderResolver instanceof AutoCloseable autoCloseable) {
            autoCloseable.close();
        }
    }

    private record ConversionCacheKey(@NonNull String name, Class<?> requiredType) {

        @Override
        public boolean equals(Object o) {
            if (this == o) {
                return true;
            }
            if (o == null) {
                return false;
            }
            ConversionCacheKey that = (ConversionCacheKey) o;
            return Objects.equals(name, that.name) && Objects.equals(requiredType, that.requiredType);
        }

        @Override
        public int hashCode() {
            return name.hashCode();
        }
    }
}


Review comment (suggestion):
this is a breaking change for classes that subclass this class. Deprecate using `forRemoval` instead.

Code after:
        return value;
    }

    private List<String> resolvePropertiesForConvention(String property, PropertySource.PropertyConvention convention) {
        if (convention == PropertySource.PropertyConvention.ENVIRONMENT_VARIABLE) {
            return environmentProperties.findPropertyNamesForEnvironmentVariable(property);
        }
        return Collections.singletonList(
                NameUtils.hyphenate(property, true)
        );
    }

    private void fill(List list, int toIndex, Object value) {
        if (toIndex >= list.size()) {
            for (int i = list.size(); i <= toIndex; i++) {
                list.add(i, value);
            }
        }
    }

    @Override
    public void close() throws Exception {
        if (propertyPlaceholderResolver instanceof AutoCloseable autoCloseable) {
            autoCloseable.close();
        }
    }

    /**
     * The property catalog to use.
     *
     * @deprecated Replaced by {@link io.micronaut.core.value.PropertyCatalog}
     */
    @Deprecated(forRemoval = true)
    protected enum PropertyCatalog {
        /**
         * The catalog that contains the raw keys.
         */
        RAW,
        /**
         * The catalog that contains normalized keys. A key is normalized into
         * lower case hyphen separated form. For example an environment variable {@code FOO_BAR} would be
         * normalized to {@code foo.bar}.
         */
        NORMALIZED,
        /**
         * The catalog that contains normalized keys and also generated keys. A synthetic key can be generated from
         * an environment variable such as {@code FOO_BAR_BAZ} which will produce the following keys: {@code foo.bar.baz},
         * {@code foo.bar-baz}, and {@code foo-bar.baz}.
         */
        GENERATED
    }