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 #84 - MapiTypeConverterMapEntry.validateValueAsArray is wrong Fix 84 - MapiTypeConverterMapEntry.validateValueAsArray is wrong Oct 6, 2014
@avromf avromf changed the title Fix 84 - MapiTypeConverterMapEntry.validateValueAsArray is wrong #{84} - MapiTypeConverterMapEntry.validateValueAsArray is wrong Oct 6, 2014
@avromf avromf changed the title #{84} - MapiTypeConverterMapEntry.validateValueAsArray is wrong Issue #84 - MapiTypeConverterMapEntry.validateValueAsArray is wrong Oct 6, 2014
@avromf avromf changed the title Issue #84 - MapiTypeConverterMapEntry.validateValueAsArray is wrong This commit fixes #84 Oct 6, 2014
@avromf avromf changed the title This commit fixes #84 Issue #84 - MapiTypeConverterMapEntry.validateValueAsArray is wrong Oct 6, 2014
@vboctor
Copy link
Contributor

vboctor commented Oct 6, 2014

@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.

@avromf
Copy link
Contributor Author

avromf commented Oct 6, 2014

@vboctor I did create a separate branch for this issue but it seems to still contain my original commits.
What am I missing here?

@avromf
Copy link
Contributor Author

avromf commented Oct 6, 2014

@vboctor I tried this for another issue but the "squash" did not seem to work.
Basically, my original procedure today was revert my original commits, branch off into separate branch, apply my fix to that branch, commit, publish, then create the pull request.
This resulted in it showing only the changed files for the fix but all the original commits as well.

@vboctor
Copy link
Contributor

vboctor commented Oct 6, 2014

Thanks @avromf - a modified version of this changed was checked in via 6cdd098 -- thanks for the contribution.

@vboctor vboctor closed this Oct 6, 2014
@avromf avromf deleted the Fix-for-#84 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