Skip to content
This repository was archived by the owner on Jun 18, 2024. It is now read-only.

Conversation

@avromf
Copy link
Contributor

@avromf avromf commented Oct 6, 2014

No description provided.

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.
@avromf avromf changed the title Fix for #83 Fix for #83 - Incorrect loop check in ExtendedProperty Oct 6, 2014
@vboctor
Copy link
Contributor

vboctor commented Oct 6, 2014

Thanks @avromf -- I've manually checked in your fix with a credit in the comment. See b8ec0c0

@vboctor vboctor closed this Oct 6, 2014
@avromf
Copy link
Contributor Author

avromf commented Oct 7, 2014

@vboctor Thanks.

@avromf avromf deleted the Fix-for-#83 branch October 7, 2014 13:53
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants