Skip to content

Conversation

Jonas-Isr
Copy link
Member

Context

SAP/cloud-sdk-java-backlog#DRAFT.

A user reported that there can be instances where a change in the order of complex keys causes issues (see GH issue). To circumvent that, this PR changes the use of HashMap into LinkedHashMap in the code generator for odata v2.

Feature scope:

  • generator for odata v2 uses LinkedHashMap instead of HashMap

Definition of Done

  • Functionality scope stated & covered
  • Tests cover the scope above
  • Error handling created / updated & covered by the tests above
  • Documentation updated
  • Release notes updated

@Jonas-Isr Jonas-Isr requested a review from MatKuhr December 18, 2024 16:08
@Jonas-Isr Jonas-Isr added the please review Request to review a pull request label Dec 18, 2024
@@ -356,7 +356,7 @@ protected Map<String, Object> toMapOfFields()
@Override
protected void fromMap( final Map<String, Object> inputValues )
{
final Map<String, Object> cloudSdkValues = Maps.newHashMap(inputValues);
final Map<String, Object> cloudSdkValues = Maps.newLinkedHashMap(inputValues);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(minor) technically, changing the fromMap implementation should have no influence for the ordering of keys. Still, it doesn't hurt to use a linked map here as well.

@MatKuhr MatKuhr merged commit cace223 into main Dec 18, 2024
14 checks passed
@MatKuhr MatKuhr deleted the linkedHashMap-in-generator branch December 18, 2024 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
please review Request to review a pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants