Repository navigation
MCR-3787 Harmonize handling of instance and property annotations - #3074
sebhofmann merged 4 commits into
Conversation
ddc9476 to
b0403b7
Compare
b0403b7 to
fedb784
Compare
ffdc15f to
6f67c26
Compare
6f67c26 to
b49b6d7
Compare
b49b6d7 to
2ee5057
Compare
614efbf to
5fd60cc
Compare
sebhofmann
left a comment
There was a problem hiding this comment.
Reviewed the branch locally. All 1274 tests in mycore-base pass and Checkstyle is clean.
One finding blocks: the short form insertion point in MCRValueListSourceBase can throw IndexOutOfBoundsException. See the inline comment for the reproduction.
One point has no line to attach to. MCRInstanceConfiguration.nested(Class, String), both nestedMap(...) overloads, MCRSourceContext.incompatibilityException and MCRSourceContext.orderedKeys(Map) are public API shipped in v2026.06.0 and are removed here, while neither commit message marks a breaking change. Nothing outside mycore-base uses them in my workspace, so this is about the marker, not about the removal itself. Along with them MCRInstanceConfigurationTest (352 lines) is dropped, which leaves the nestedMap edge cases (empty prefix, mixed nesting depth) uncovered.
The remaining inline comments are nits.
| return reducedProperties; | ||
| } | ||
|
|
||
| protected static Set<String> nextNestedKeys(Map<String, String> properties) { |
There was a problem hiding this comment.
This turns intermediate segments of deeper keys into list and map keys. For lists that reaches orderedIntegerKeys, so
Foo.Values.1 = A
Foo.Values.Oops.Sub = X
now throws has element with non-integer key Oops, while on main the indexOf('.', keyPrefixLength) == -1 filter dropped such keys silently. For instance lists the stricter behaviour looks right, for @MCRPropertyList it is a behaviour change that can surface on update in an application with a grown property file. If it is intended, it seems worth naming in the ticket and the documentation.
There was a problem hiding this comment.
I've added this as an example benefit of the harmonization in the ticket description.
|
|
||
| } | ||
|
|
||
| protected static Map<String, String> reduceProperties(Map<String, String> properties, String prefix) { |
There was a problem hiding this comment.
This is line for line identical to the private MCRInstanceConfiguration.reduceProperties (line 194 there). One of the two should call the other.
There was a problem hiding this comment.
Both occurrences are going to be removed in MCR-3703. I've added a copy temporarily, so I do not have make one method public and remove a public method in the next PR.
| Map<String, String> fullProperties) { | ||
|
|
||
| MCRInstanceConfiguration<?> configuration = MCRInstanceConfiguration.ofComponents( | ||
| superClass, MCRInstanceName.of(context.property()), properties, fullProperties); |
There was a problem hiding this comment.
The name is recovered from the property string here, while the previous code built it structurally via name.nested(prefix). MCRInstanceName.of strips a trailing .Class, so an instance map entry keyed Class ends up with a name short by one segment in messages and in the [IMPLICIT] log. Pathological, but avoidable.
5fd60cc to
156c326
Compare
156c326 to
e32c67e
Compare
Link to jira.
Pull Request Checklist (Author)
Please go through the following checklist before assigning the PR for review:
Ticket & Documentation
fixed-versionis correctly set in the ticket and matches the PR's target branch (main).Feature & Improvement Specific Checks
Testing
MCR Conventions & Metadata
mycore.properties.mycore.properties.Multi-Repo Considerations
MIRrequired?