Conversation
Fixes raw type iterator warning
Changes done for publishing to Maven Central in SNAPSHOT versioning
| @@ -92,12 +92,11 @@ protected T1 send() throws ClientException { | |||
| * | |||
| * @param serializedObject the object to serialize as the body | |||
| * @param <T1> the type of the callback result | |||
| * @param serializedObject the object to serialize as the body | ||
| * @param <T1> the type of the callback result | ||
| * @param <T2> the type of the serialized body | ||
| * @param <BodyType> the type of the serialized body |
There was a problem hiding this comment.
Why is the term Body in use here?
There was a problem hiding this comment.
Inside post, send is being called with serializedObject. At send's declaration BodyType term is being used and Body in implementation with explanation "the type of the object to send to the service in the body of the request".
There was a problem hiding this comment.
Um, don't understand that sorry. What about this situation involves a Body? I know you are matching the language that's already there but why does the language that is there refer to a "body"?
|
The Example usage is: User u = new User();
client.users().buildRequest().post(u);When you delve into the source around that you see that the This is a marker for me of sub-optimal modelling in the generated code and we get code smells like this To demonstrate with more detail, when BaseUserCollectionRequest extends BaseCollectionRequest<BaseUserCollectionResponse, IUserCollectionPage>Both So can you see why it seems ridiculous to pass the type The fix for this is that public BaseCollectionRequest(final String requestUrl,
final IBaseClient client,
final List<? extends Option> options,
final Class<? extends ICollectionResponse<T>> responseClass,
final Class<? extends ICollectionPage<T>> collectionPageClass) {Note that |
|
@NakulSabharwal the use of the term "body" in this class is a bit confusing, would be nice to sort out some day but the main issue I have is in that long comment above. That's the change that will fix #66, not this PR which is more of a bandaid that continues to cover up possible type safety problems. To fix this requires work in the generator. My contributing there is made difficult because of microsoftgraph/MSGraph-SDK-Code-Generator#141. I just want to change a template then generate java classes in one command line call. I would then copy the new java classes to the msgraph-sdk-java to test. |
|
@davidmoten the use of term "Body" we can think upon. And the post method in above discussion, being a protected method is called by the following classes only. BaseDeviceCompliancePolicyAssignCollectionRequest If we want to remove the use of generic BodyType in post(final BodyType serializedObject) of BaseCollectionRequest. |
|
@NakulSabharwal I gave the suggested changes to |
|
@davidmoten Thanks for the pull request to demonstrate the suggested fixes. This post method is not exposed to the user of the SDK and is an internal method, having no impact on user experience. We agree that this is an issue and needs to be fixed. We will discuss this enhancement request internally and prioritize this work item. @deepak2016 @darrelmiller |
Publishes to Maven central.
Revert "Publishes to Maven central."
August Updates
…have been reduced
…-gradle reduce memory requirement for gradle to 2g
…tgraph/msgraph-sdk-java into Type-hiding-warning-fix
Fixes #66 Type hiding warning
Fix - Changing generic name from T2 to BodyType and using class level T1 by removing <T1,T2> in function.
Changes proposed in this pull request
BodyType generic will be used at function level and T1 of the class level generic paramater.