Skip to content

Breaking change introduced in 1.3.2 #1189

@jonatan-ivanov

Description

@jonatan-ivanov

It seems 1.3.2 was released with some breaking changes (compared to 1.3.1). This is unexpected given that it is a patch release.

The change was introduced here: eb48f5d#diff-03bebb9eaf09f2cec3a24afb7ff939663924dd8b47ed8612bf5fcef9edd2e018R36

The commit is big, please wait a few seconds so that your browser can load it and jump there, if it does not work, scroll to MetricSnapshots.java#36:

- public MetricSnapshots(Collection<MetricSnapshot> snapshots) {
+ public MetricSnapshots(Collection<MetricSnapshot<?>> snapshots) {

Which can cause compiler errors, it is a breaking change in a public class. In Micrometer, the compiler error we get is:

MicrometerCollector.java:88: error: no suitable constructor found for MetricSnapshots(Collection<MetricSnapshot>)
        return new MetricSnapshots(metricSnapshots);

I think this change was causing compile-time failures in the Prometheus Client during refactor but here is a simple reproducer that is ok with 1.3.1 but fails with 1.3.2:

Collection<MetricSnapshot> collection = new ArrayList<>();
MetricSnapshots metricSnapshots = new MetricSnapshots(collection);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions