Skip to content

Fix IntegrationManagementConfiguration.obtainObservationPatterns() for HashSet sort #9260

Closed
@artembilan

Description

When we provide config like:

@EnableIntegrationManagement(observationPatterns ={  "!notObserved", "*" })

that HashSet in the IntegrationManagementConfiguration.obtainObservationPatterns() makes specific pattern useless: the common * is moved to the first position and when we call PatternMatchUtils.smartMatch(), this * always wins.
That is according to Javadocs:

	 * Pattern match against the supplied patterns; also supports negated ('!')
	 * patterns. First match wins (positive or negative).
	 * To match the names starting with {@code !} symbol,
	 * you have to escape it prepending with the {@code \} symbol in the pattern definition.

Revise the logic in the IntegrationManagementConfiguration.obtainObservationPatterns() to retain order of the provided patterns.
Or even make it smarter to ignore all the regular patterns if common * is present.
Plus move * to the end of the final array to let all those negative patterns make their decision.

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions