Skip to content

Commit 6f10c9f

Browse files
committed
Remove NotSupportedException class
1 parent 75904e2 commit 6f10c9f

3 files changed

Lines changed: 12 additions & 109 deletions

File tree

src/main/java/microsoft/exchange/webservices/data/core/exception/misc/NotSupportedException.java

Lines changed: 0 additions & 53 deletions
This file was deleted.

src/main/java/microsoft/exchange/webservices/data/core/service/ServiceObject.java

Lines changed: 11 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,13 @@
3131
import microsoft.exchange.webservices.data.core.PropertyBag;
3232
import microsoft.exchange.webservices.data.core.PropertySet;
3333
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;
3734
import microsoft.exchange.webservices.data.core.enumeration.misc.ExchangeVersion;
35+
import microsoft.exchange.webservices.data.core.enumeration.service.DeleteMode;
3836
import microsoft.exchange.webservices.data.core.enumeration.service.SendCancellationsMode;
37+
import microsoft.exchange.webservices.data.core.enumeration.service.calendar.AffectedTaskOccurrence;
3938
import microsoft.exchange.webservices.data.core.exception.misc.InvalidOperationException;
40-
import microsoft.exchange.webservices.data.core.exception.misc.NotSupportedException;
4139
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;
4341
import microsoft.exchange.webservices.data.misc.OutParam;
4442
import microsoft.exchange.webservices.data.property.complex.ExtendedProperty;
4543
import microsoft.exchange.webservices.data.property.complex.ExtendedPropertyCollection;
@@ -395,27 +393,15 @@ public void load() throws Exception {
395393
*/
396394
public Object getObjectFromPropertyDefinition(
397395
PropertyDefinitionBase propertyDefinition) throws Exception {
398-
OutParam<Object> propertyValue = new OutParam<Object>();
399396
PropertyDefinition propDef = (PropertyDefinition) propertyDefinition;
400397

401398
if (propDef != null) {
402399
return this.getPropertyBag().getObjectFromPropertyDefinition(propDef);
403400
} 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()));
419405
}
420406
}
421407

@@ -470,15 +456,10 @@ public <T> boolean tryGetProperty(Class<T> cls, PropertyDefinitionBase propertyD
470456
if (propDef != null) {
471457
return this.getPropertyBag().tryGetPropertyType(cls, propDef, propertyValue);
472458
} 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()));
482463
}
483464
}
484465

src/main/java/microsoft/exchange/webservices/data/security/SafeXmlDocument.java

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323

2424
package microsoft.exchange.webservices.data.security;
2525

26-
import microsoft.exchange.webservices.data.core.exception.misc.NotSupportedException;
2726
import org.apache.commons.logging.Log;
2827
import org.apache.commons.logging.LogFactory;
2928
import org.w3c.dom.DOMImplementation;
@@ -56,37 +55,13 @@ public class SafeXmlDocument extends DocumentBuilder {
5655
/**
5756
* Initializes a new instance of the SafeXmlDocument class.
5857
*/
59-
public XMLInputFactory inputFactory;
58+
private final XMLInputFactory inputFactory;
6059

6160
public SafeXmlDocument() {
6261
super();
6362
inputFactory = XMLInputFactory.newInstance();
6463
}
6564

66-
/**
67-
* Initializes a new instance of the SafeXmlDocument class with the
68-
* specified XSImplementation.
69-
*
70-
* @param imp The XmlImplementation to use.
71-
* @throws NotSupportedException
72-
*/
73-
// <remarks>Not supported do to no use within exchange dev code.</remarks>
74-
public SafeXmlDocument(DocumentBuilder imp) throws NotSupportedException {
75-
throw new NotSupportedException("Not supported");
76-
}
77-
78-
/**
79-
* Initializes a new instance of the SafeXmlDocument class with the
80-
* specified XmlNameTable.
81-
*
82-
* @param nt The XmlNameTable to use.
83-
*/
84-
public SafeXmlDocument(XmlNameTable nt) {
85-
super();
86-
if (inputFactory == null) {
87-
inputFactory = XMLInputFactory.newInstance();
88-
}
89-
}
9065

9166
/**
9267
* Loads the XML document from the specified stream.

0 commit comments

Comments
 (0)