Repository navigation
Conversation
51a916f to
9ac86a4
Compare
8f16049 to
cf276f8
Compare
a9b37c1 to
912f7d1
Compare
912f7d1 to
59e49c8
Compare
7c2f162 to
f8763d6
Compare
f8763d6 to
0bcd956
Compare
0bcd956 to
25d880a
Compare
89058ee to
bbd4aaa
Compare
579ff2f to
0985f6b
Compare
0985f6b to
3eab65c
Compare
a4876b7 to
dd3aee3
Compare
5a64df9 to
ad8be26
Compare
sebhofmann
left a comment
There was a problem hiding this comment.
One more: the record ConfigurationKey in MCRConfiguration2 is unused now that the configuration cache is removed and can be deleted.
| }); | ||
| MCRProperTree properties = annotation.absolute() ? configuration.fullProperties() : configuration.properties(); | ||
| Map<String, String> rawProperties = treeFinder.apply(properties).toProperties(); | ||
| rawProperties.remove(MCRInstanceConfiguration.CLASS_KEY); |
There was a problem hiding this comment.
Behaviour change for prefix patterns like Values.*: The Javadoc of @MCRRawProperties says all properties starting with the given prefix and ., and the old code filtered with key.startsWith(prefix). Now tree.deeplyNested("Values").toProperties() also contains the value of the node itself under the key "", so Foo.Values=x adds "" -> "x" to the map. Conversely, Foo.Values.Class is now removed by this line, while it used to be included as Class.
This affects e.g. MCRXsonifyTransformer (Namespaces.*) and MCRPersistenceUnitDescriptor (Properties.*). MCRInstantiatorRawPropertiesBasicTest covers neither case.
There was a problem hiding this comment.
I added support for those uncommon configurations and expanded the test class. Exact same test pass under main and this PR branch.
| Throwables.throwIfUnchecked(e.getCause()); | ||
| throw new MCRException("Failed to create instance configuration for " + name, e.getCause()); | ||
| } | ||
| return MCRInstanceConfiguration.ofName(superClass, name, getAllPropertiesTree(), Options.IMPLICIT); |
There was a problem hiding this comment.
With the CONFIGURATIONS cache gone, every getInstanceOf / getSingleInstanceOf call runs resolveValueClass and thus MCRClassTools.forName again, even if the singleton is already in instanceHolder. For classes from plugin JARs in mycore-home/lib, Class.forName first throws a ClassNotFoundException on every call before the extendedClassLoader is tried. The cache was explicitly reintroduced in MCR-3668 (7d9a135). Is dropping it intended, or should the resolved configuration (or at least the value class) still be cached?
| } | ||
| } | ||
|
|
||
| public MCRProperTree nested(String key) { |
There was a problem hiding this comment.
Question: Class is now hidden on every level of the tree (keys(), nested()). A map entry named Class (e.g. Prefix.Map.Class=...) used to be possible and is now silently ignored. If that is intended, it should be documented.
There was a problem hiding this comment.
Fixed by excluding Class properties only when using a tree node to instantiate a class. Additionally, sentinel values are excluded after they are interpreted.
73c5ee1 to
8ac5e85
Compare
8ac5e85 to
66d0d7d
Compare
…l properties only where consumed
66d0d7d to
61d419e
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?