Skip to content

Commit

Permalink
Remove unnecessary "instanceof" check in ComplexPropertyCollection
Browse files Browse the repository at this point in the history
  • Loading branch information
vbauer committed May 30, 2015
1 parent c88387e commit da998b5
Showing 1 changed file with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,13 @@ protected ComplexPropertyCollection() {
*
* @param complexProperty The complex property.
*/
protected void itemChanged(ComplexProperty complexProperty) {
EwsUtilities
.ewsAssert(complexProperty instanceof ComplexProperty, "ComplexPropertyCollection.ItemChanged",
String.format("ComplexPropertyCollection." +
"ItemChanged: the type of " +
"the complexProperty argument " +
"(%s) is not supported.", complexProperty.getClass().getName()));

TComplexProperty property = (TComplexProperty) complexProperty;
protected void itemChanged(final ComplexProperty complexProperty) {
final TComplexProperty property = (TComplexProperty) complexProperty;
EwsUtilities.ewsAssert(
complexProperty != null, "ComplexPropertyCollection.ItemChanged",
"The complexProperty argument must be not null"
);

if (!this.addedItems.contains(property)) {
if (!this.modifiedItems.contains(property)) {
this.modifiedItems.add(property);
Expand Down

0 comments on commit da998b5

Please sign in to comment.