-
Notifications
You must be signed in to change notification settings - Fork 693
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2345 +/- ##
============================================
- Coverage 81.10% 74.04% -7.06%
+ Complexity 2313 2098 -215
============================================
Files 259 259
Lines 7551 7563 +12
Branches 783 785 +2
============================================
- Hits 6124 5600 -524
- Misses 1102 1603 +501
- Partials 325 360 +35
Continue to review full report at Codecov.
|
This is the second merge request resulting from requests I have made. That leads me to wonder if it is possible for me to become a contributor to this project. Is there a process in place? |
* @return a Map where the key values are the field names and the values the field | ||
* values. | ||
*/ | ||
<T, R> Map<T, R> readAsMap(Class<T> keyType, TypeInformation<R> componentType, | ||
BaseEntity entity); | ||
BaseEntity entity, TypeInformation typeInformation); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Technically, it's a breaking change. Can we just overload with a new method that has an additional argument?
This especially seems to make sense because you sometimes call the method withnull
typeInformation
. - Also, can we rename
typeInformation
tomapTypeInformation
? - If you're getting the type information for the whole map, why do you need the key and value type information? Maybe it would be easier if the caller just passed the map they wanted to fill with results?
Object customMap = null; | ||
if (typeInformation != null && !typeInformation.getType().isInterface()) { | ||
try { | ||
customMap = ((Constructor<?>) typeInformation.getType().getConstructor()).newInstance(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This just doesn't seem right. Can we put the burden on the caller to create the map?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you elaborate why it doesn't seem right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think if the caller has to create it, it will perhaps be inconsistent with the other cases.
@ashesfall We welcome contributions! All you have to do is open a pull request. |
…o datastore-custom-map
Kudos, SonarCloud Quality Gate passed! 0 Bugs |
fixes #2334