OpenejbJar openejb = (OpenejbJar)source;
ResourceLocator locator = openejb.getCmpConnectionFactory();
if (locator != null && isEmpty(locator.getResourceLink()) && isEmpty(locator.getUrl()) && isEmpty(locator.getPattern())) {
openejb.setCmpConnectionFactory(null);
}
Relationships relationships = openejb.getRelationships();
if (relationships != null && relationships.getEjbRelation().size() == 0) {
openejb.setRelationships(null);
}
} else if (source instanceof PersistenceContextRef) {
PersistenceContextRef contextRef = (PersistenceContextRef)source;
if (contextRef.getPattern() != null && isEmpty(contextRef.getPattern())) {