-
Notifications
You must be signed in to change notification settings - Fork 566
Issue #84 - MapiTypeConverterMapEntry.validateValueAsArray is wrong #86
Conversation
In ExchangeService, method internalGetAttachments:
List propsArray = new ArrayList();
for (PropertyDefinitionBase propertyDefinitionBase :
additionalProperties)
If addtionalProperties is null (and it can be), this throws a
NullPointerException.
A check for null is done here:
if (additionalProperties != null) {
request.getAdditionalProperties().addAll(propsArray);
}
This check should be done earlier.
And
propsArray.add(additionalProperties);
This will result in adding a list to another list and later on result in
a ClassCastException.
It should be:
for (PropertyDefinitionBase propertyDefinitionBase :
additionalProperties)
{
propsArray.add(propertyDefinitionBase);
}
There is a loop through an ArrayList written as: for (int index = 0; index <= array.size(); index++) It should be written as: for (int index = 0; index < array.size(); index++)
The method validateValueAsArray is completely wrong. For starters, arrays are not instances of the class Array. Secondly, extended properties of “arrays” have been implemented by the EWS API using ArrayList which is not an array, its a list.
This reverts commit 3031da5.
This reverts commit 8aee4f2.
…wrong" This reverts commit 24adcb4.
|
@Avrom I recommend that you squash the changes on this branch into a new branch so that there is a single commit that has the fix for the bug. Then submit that as a new pull request. For example:
Then submit a pull request from Issue84 branch. As part of the pull request preview, make sure that there is a single commit that has the change related to this specific bug. Hope this helps. |
|
@vboctor I did create a separate branch for this issue but it seems to still contain my original commits. |
|
@vboctor I tried this for another issue but the "squash" did not seem to work. |
No description provided.