String o1typeName = o1.getName();
String o2typeName = o2.getName();
if (o1typeName.equals(o2typeName))
// o1typeName==o2typeName==newName
return new DatatypeException(
XSDatatypeImpl.localize(XSDatatypeImpl.ERR_INCONSISTENT_FACETS_1, facetName1, facetName2));
if (o1typeName.equals(newName))
// o2 must be specified in somewhere in the derivation chain
return new DatatypeException(
XSDatatypeImpl.localize(
XSDatatypeImpl.ERR_INCONSISTENT_FACETS_2,
facetName1,
o2.displayName(),
facetName2));
if (o2typeName.equals(newName))
// vice versa
return new DatatypeException(
XSDatatypeImpl.localize(
XSDatatypeImpl.ERR_INCONSISTENT_FACETS_2,
facetName2,
o1.displayName(),
facetName1));