[MAGNOLIA-3165] C2B and N2B too eager when adding items to collections Created: 24/Mar/10  Updated: 11/Feb/13  Resolved: 29/Jan/13

Status: Closed
Project: Magnolia
Component/s: cache, content2bean
Affects Version/s: 4.4.9, 4.5.7, 5.0
Fix Version/s: 4.4.10, 4.5.8, 5.0

Type: Bug Priority: Major
Reporter: Jan Haderka Assignee: Jaroslav Simak
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
dependency
is depended upon by MGNLETK-94 java.lang.ClassCastException: java.la... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled

 Description   

C2B adds also items of incorrect types to the typed collections.

To reproduce:

  • go to /modules/cache/config/configurations and create new NodeData there
  • wait for observation to kick in and reload the module

Result:
ClassCastException in CacheModule:110 when attempting to cast String into a CacheConfiguration.
since the addCacheConfiguration() method in the CacheModule provides C2B with the info that value in the map should be CacheConfiguration, it should not attempt to add String as a value (and succeed since generics are erased at runtime) but only instances of classes that can be cast to CacheConfiguration.


Generated at Mon Feb 12 03:43:49 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.