|
31 | 31 | import microsoft.exchange.webservices.data.core.PropertyBag; |
32 | 32 | import microsoft.exchange.webservices.data.core.PropertySet; |
33 | 33 | import microsoft.exchange.webservices.data.core.XmlElementNames; |
34 | | -import microsoft.exchange.webservices.data.core.service.schema.ServiceObjectSchema; |
35 | | -import microsoft.exchange.webservices.data.core.enumeration.service.calendar.AffectedTaskOccurrence; |
36 | | -import microsoft.exchange.webservices.data.core.enumeration.service.DeleteMode; |
37 | 34 | import microsoft.exchange.webservices.data.core.enumeration.misc.ExchangeVersion; |
| 35 | +import microsoft.exchange.webservices.data.core.enumeration.service.DeleteMode; |
38 | 36 | import microsoft.exchange.webservices.data.core.enumeration.service.SendCancellationsMode; |
| 37 | +import microsoft.exchange.webservices.data.core.enumeration.service.calendar.AffectedTaskOccurrence; |
39 | 38 | import microsoft.exchange.webservices.data.core.exception.misc.InvalidOperationException; |
40 | | -import microsoft.exchange.webservices.data.core.exception.misc.NotSupportedException; |
41 | 39 | import microsoft.exchange.webservices.data.core.exception.service.local.ServiceLocalException; |
42 | | -import microsoft.exchange.webservices.data.core.exception.service.local.ServiceObjectPropertyException; |
| 40 | +import microsoft.exchange.webservices.data.core.service.schema.ServiceObjectSchema; |
43 | 41 | import microsoft.exchange.webservices.data.misc.OutParam; |
44 | 42 | import microsoft.exchange.webservices.data.property.complex.ExtendedProperty; |
45 | 43 | import microsoft.exchange.webservices.data.property.complex.ExtendedPropertyCollection; |
@@ -395,27 +393,15 @@ public void load() throws Exception { |
395 | 393 | */ |
396 | 394 | public Object getObjectFromPropertyDefinition( |
397 | 395 | PropertyDefinitionBase propertyDefinition) throws Exception { |
398 | | - OutParam<Object> propertyValue = new OutParam<Object>(); |
399 | 396 | PropertyDefinition propDef = (PropertyDefinition) propertyDefinition; |
400 | 397 |
|
401 | 398 | if (propDef != null) { |
402 | 399 | return this.getPropertyBag().getObjectFromPropertyDefinition(propDef); |
403 | 400 | } else { |
404 | | - ExtendedPropertyDefinition extendedPropDef = (ExtendedPropertyDefinition) propertyDefinition; |
405 | | - if (extendedPropDef != null) { |
406 | | - if (this.tryGetExtendedProperty(Object.class, extendedPropDef, propertyValue)) { |
407 | | - return propertyValue; |
408 | | - } else { |
409 | | - throw new ServiceObjectPropertyException( |
410 | | - "You must load or assign this property before you can read its value.", |
411 | | - propertyDefinition); |
412 | | - } |
413 | | - } else { |
414 | | - // E14:226103 -- Other subclasses of PropertyDefinitionBase are not supported. |
415 | | - throw new NotSupportedException(String.format( |
416 | | - "This operation isn't supported for property definition type %s.", |
417 | | - propertyDefinition.getType().getName())); |
418 | | - } |
| 401 | + // E14:226103 -- Other subclasses of PropertyDefinitionBase are not supported. |
| 402 | + throw new UnsupportedOperationException(String.format( |
| 403 | + "This operation isn't supported for property definition type %s.", |
| 404 | + propertyDefinition.getType().getName())); |
419 | 405 | } |
420 | 406 | } |
421 | 407 |
|
@@ -470,15 +456,10 @@ public <T> boolean tryGetProperty(Class<T> cls, PropertyDefinitionBase propertyD |
470 | 456 | if (propDef != null) { |
471 | 457 | return this.getPropertyBag().tryGetPropertyType(cls, propDef, propertyValue); |
472 | 458 | } else { |
473 | | - ExtendedPropertyDefinition extPropDef = (ExtendedPropertyDefinition) propertyDefinition; |
474 | | - if (extPropDef != null) { |
475 | | - return this.tryGetExtendedProperty(cls, extPropDef, propertyValue); |
476 | | - } else { |
477 | | - // E14:226103 -- Other subclasses of PropertyDefinitionBase are not supported. |
478 | | - throw new NotSupportedException(String.format( |
479 | | - "This operation isn't supported for property definition type %s.", |
480 | | - propertyDefinition.getType().getName())); |
481 | | - } |
| 459 | + // E14:226103 -- Other subclasses of PropertyDefinitionBase are not supported. |
| 460 | + throw new UnsupportedOperationException(String.format( |
| 461 | + "This operation isn't supported for property definition type %s.", |
| 462 | + propertyDefinition.getType().getName())); |
482 | 463 | } |
483 | 464 | } |
484 | 465 |
|
|
0 commit comments