RUMM-2494 Use View hashcode as unique identifier for mapped Wireframe #1037
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
In this PR we are fixing the collision problem when taking the screen snapshot as a tree of wireframes. We were currently using the following approach:
return if(view.id!=View.NO_ID) view.id else view.hashCode
to resolve the view unique identifier to be used in the equivalent mappedWireframe
. Following our tests we cannot rely on theview.id
property as this is not unique in a view tree and it can actually be the same for more views in a tree creating collisions.Instead we are going to use the
View
reference address returned by theView.hashCode
function. In addition to this in order to avoid problems in case subclasses of theView
class override thehashCode
class we will use theSystem.identityHashCode
function which will always return the default value from the default implementation of thehashCode
function.Motivation
What inspired you to submit this pull request?
Additional Notes
Anything else we should know when reviewing?
Review checklist (to be filled by reviewers)