Skip to content

Conversation

mawen12
Copy link
Contributor

@mawen12 mawen12 commented Sep 21, 2024

I have found the method checkGloballyForDiscriminatedNestedResultMaps in class Configuration contains unnecessary convert code.

protected final Map<String, ResultMap> resultMaps = new StrictMap<>("Result Maps collection");

...

protected void checkGloballyForDiscriminatedNestedResultMaps(ResultMap rm) {
  if (rm.hasNestedResultMaps()) {
    ...
    for (Object resultMapObject : resultMaps.values()) {
     // here is unnecessary code
      if (resultMapObject instanceof ResultMap) {
        ResultMap entryResultMap = (ResultMap) resultMapObject;
        ...
      }
    }
  }
}

Because variable resultMaps is Map<String, ResultMap>, so it's value type is ResultMap, no need convert from Object.

@mawen12 mawen12 closed this Sep 21, 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.

1 participant