* @throws IllegalArgumentException If new package fails to validate.
*/
private static final EPackage eAdd(EPackage ePackage) throws IllegalArgumentException {
EPackage eOldPackage = eContext.eAdd(ePackage);
if(eOldPackage!=ePackage) {
EFeatureStatus eStatus = eContext().eStructure().validate();
if(eStatus.isFailure()) {
throw new IllegalArgumentException("EPackage not properly added. "
+ eStatus.getMessage(),eStatus.getCause());
}
}
return eOldPackage;
}