Skip to content

Commit da998b5

Browse files
committed
Remove unnecessary "instanceof" check in ComplexPropertyCollection
1 parent c88387e commit da998b5

1 file changed

Lines changed: 7 additions & 9 deletions

File tree

src/main/java/microsoft/exchange/webservices/data/property/complex/ComplexPropertyCollection.java

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,13 @@ protected ComplexPropertyCollection() {
103103
*
104104
* @param complexProperty The complex property.
105105
*/
106-
protected void itemChanged(ComplexProperty complexProperty) {
107-
EwsUtilities
108-
.ewsAssert(complexProperty instanceof ComplexProperty, "ComplexPropertyCollection.ItemChanged",
109-
String.format("ComplexPropertyCollection." +
110-
"ItemChanged: the type of " +
111-
"the complexProperty argument " +
112-
"(%s) is not supported.", complexProperty.getClass().getName()));
113-
114-
TComplexProperty property = (TComplexProperty) complexProperty;
106+
protected void itemChanged(final ComplexProperty complexProperty) {
107+
final TComplexProperty property = (TComplexProperty) complexProperty;
108+
EwsUtilities.ewsAssert(
109+
complexProperty != null, "ComplexPropertyCollection.ItemChanged",
110+
"The complexProperty argument must be not null"
111+
);
112+
115113
if (!this.addedItems.contains(property)) {
116114
if (!this.modifiedItems.contains(property)) {
117115
this.modifiedItems.add(property);

0 commit comments

Comments
 (0)