Skip to content

RUM-4342 simplify generic type in mappers#2015

Merged
xgouchet merged 1 commit into
developfrom
xgouchet/RUM-4342/remove_generic_from_mappers
May 2, 2024
Merged

RUM-4342 simplify generic type in mappers#2015
xgouchet merged 1 commit into
developfrom
xgouchet/RUM-4342/remove_generic_from_mappers

Conversation

@xgouchet

Copy link
Copy Markdown
Contributor

What does this PR do?

On SR mappers, we added a generic type argument to tell the type of wireframe we output. In practice, this became useless as the map method returns a list of wireframe, more often than not of different types, meaning almost every implementation uses the most generic type as an argument (MobileSegment.Wireframe instead of ImageWireframe or TextWireframe), and the actual type is never used in calling methods.

In addition, we have to use some unchecked casts when creating the list of mappers, e.g.:

@Suppress("UNCHECKED_CAST")
val sliderWireframeMapper = SliderWireframeMapper(…) as WireframeMapper<View, *>

This PR aims at simplifying this part.

@xgouchet
xgouchet requested review from a team as code owners April 30, 2024 14:25
@codecov-commenter

codecov-commenter commented Apr 30, 2024

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 93.87755% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 83.48%. Comparing base (1434002) to head (0e77e6c).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2015      +/-   ##
===========================================
- Coverage    83.53%   83.48%   -0.05%     
===========================================
  Files          478      478              
  Lines        17531    17578      +47     
  Branches      2661     2672      +11     
===========================================
+ Hits         14643    14674      +31     
- Misses        2164     2177      +13     
- Partials       724      727       +3     
Files Coverage Δ
...sessionreplay/material/MaterialExtensionSupport.kt 100.00% <100.00%> (ø)
...id/sessionreplay/material/SliderWireframeMapper.kt 97.40% <ø> (ø)
...droid/sessionreplay/material/TabWireframeMapper.kt 98.33% <100.00%> (ø)
...datadog/android/sessionreplay/MapperTypeWrapper.kt 100.00% <100.00%> (ø)
...ndroid/sessionreplay/SessionReplayConfiguration.kt 100.00% <100.00%> (ø)
.../sessionreplay/internal/DefaultRecorderProvider.kt 85.59% <100.00%> (+0.71%) ⬆️
...oid/sessionreplay/internal/NoOpExtensionSupport.kt 100.00% <100.00%> (ø)
...oid/sessionreplay/internal/SessionReplayFeature.kt 99.08% <ø> (-0.92%) ⬇️
...ssionreplay/internal/recorder/TreeViewTraversal.kt 100.00% <100.00%> (ø)
...order/mapper/BaseAsyncBackgroundWireframeMapper.kt 95.08% <100.00%> (ø)
... and 12 more

... and 25 files with indirect coverage changes

@xgouchet
xgouchet merged commit 5e0f0f2 into develop May 2, 2024
@xgouchet
xgouchet deleted the xgouchet/RUM-4342/remove_generic_from_mappers branch May 2, 2024 06:58
@xgouchet xgouchet added this to the 2.10.x milestone Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants