-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Description
ChangeUnits that contain unnamed variables (the "_" placeholder) anywhere in them, are not found or executed by Mongock. Replacing the placeholder with a named (and unused) variable will result in the ChangeUnit being found again.
PRIORITY
NORMAL / Not Sure
Version and environment
Mongock
- Mongock version: COMMUNITY version[5.3.4]
- Modules involved: springboot, MongoDB
- How Mongock is used: annotation approach
Environment
- Framework and libraries versions. Especially those that affect directly to Mongock:
- Spring Boot Version: 3.1.4
- Infrastructure: Kubernetes, Docker
- Importing the mongock-bom dependency
- Java Language Level 21 (Preview Features Enabled)
Steps to Reproduce
- Create a ChangeUnit that uses a Lambda Function with an unnamed variable, e.g.
.map(document -> (AggregationOperation) _ -> document)somewhere in a stream. - Start the application as normal
Behaviour
Expected behavior: The ChangeUnit gets executed
Actual behavior: Mongock does not find the ChangeUnit.
How often the bug happens: Every time.
Additional context
The reflection library Mongock uses apparently can't return classes containing these features.
In ChangeLogServiceBase.java:163 the ChangeUnit class is present in the Object constructed by new Reflections(changeLogsBasePackageList) but the getTypesAnnotatedWith(ChangeUnit.class) returns an empty list, if the "_"-Placeholder is used anywhere in the file.
spalberg
Metadata
Metadata
Assignees
Labels
No labels