String className = entry.getValue();
Class elementType = null;
try {
if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()) {
try {
elementType = (Class) AccessController.doPrivileged(new PrivilegedClassForName(className, true, classLoader));
} catch (PrivilegedActionException exception) {
throw ValidationException.classNotFoundWhileConvertingClassNames(className, exception.getException());
}
} else {
elementType = org.eclipse.persistence.internal.security.PrivilegedAccessHelper.getClassForName(className, true, classLoader);
}
} catch (ClassNotFoundException exc) {
throw ValidationException.classNotFoundWhileConvertingClassNames(className, exc);
}
XMLMapping mapping = this.choiceElementMappings.get(entry.getKey());
mapping.convertClassNamesToClasses(classLoader);
if (fieldToClassMappings.get(entry.getKey()) == null) {
fieldToClassMappings.put(entry.getKey(), elementType);
}
}
for(Entry<String, XMLField> next: this.classNameToFieldMappings.entrySet()) {
String className = next.getKey();
Class elementType = null;
try {
if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()) {
try {
elementType = (Class) AccessController.doPrivileged(new PrivilegedClassForName(className, true, classLoader));
} catch (PrivilegedActionException exception) {
throw ValidationException.classNotFoundWhileConvertingClassNames(className, exception.getException());
}
} else {
elementType = org.eclipse.persistence.internal.security.PrivilegedAccessHelper.getClassForName(className, true, classLoader);
}
} catch (ClassNotFoundException exc) {
throw ValidationException.classNotFoundWhileConvertingClassNames(className, exc);
}
classToFieldMappings.put(elementType, next.getValue());
}
if(classNameToSourceFieldsMappings != null) {
Iterator<Entry<String, List<XMLField>>> sourceFieldEntries = classNameToSourceFieldsMappings.entrySet().iterator();
while(sourceFieldEntries.hasNext()) {
Entry<String, List<XMLField>> nextEntry = sourceFieldEntries.next();
String className = nextEntry.getKey();
List<XMLField> fields = nextEntry.getValue();
Class elementType = null;
try {
if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()) {
try {
elementType = (Class) AccessController.doPrivileged(new PrivilegedClassForName(className, true, classLoader));
} catch (PrivilegedActionException exception) {
throw ValidationException.classNotFoundWhileConvertingClassNames(className, exception.getException());
}
} else {
elementType = org.eclipse.persistence.internal.security.PrivilegedAccessHelper.getClassForName(className, true, classLoader);
}
} catch (ClassNotFoundException exc) {
throw ValidationException.classNotFoundWhileConvertingClassNames(className, exc);
}
this.getClassToSourceFieldsMappings().put(elementType,fields);
}
}
if(classNameToConverter != null) {
if(this.classToConverter == null) {
this.classToConverter = new HashMap<Class, Converter>();
}
for(Entry<String, Converter> next: classNameToConverter.entrySet()) {
String className = next.getKey();
Class elementType = null;
try {
if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()) {
try {
elementType = (Class) AccessController.doPrivileged(new PrivilegedClassForName(className, true, classLoader));
} catch (PrivilegedActionException exception) {
throw ValidationException.classNotFoundWhileConvertingClassNames(className, exception.getException());
}
} else {
elementType = org.eclipse.persistence.internal.security.PrivilegedAccessHelper.getClassForName(className, true, classLoader);
}
} catch (ClassNotFoundException exc) {
throw ValidationException.classNotFoundWhileConvertingClassNames(className, exc);
}
this.classToConverter.put(elementType, next.getValue());
}
}
if(!choiceElementMappingsByClassName.isEmpty()) {
for(Entry<String, XMLMapping> next:choiceElementMappingsByClassName.entrySet()) {
Class elementType = null;
String className = next.getKey();
try {
if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()) {
try {
elementType = (Class) AccessController.doPrivileged(new PrivilegedClassForName(className, true, classLoader));
} catch (PrivilegedActionException exception) {
throw ValidationException.classNotFoundWhileConvertingClassNames(className, exception.getException());
}
} else {
elementType = org.eclipse.persistence.internal.security.PrivilegedAccessHelper.getClassForName(className, true, classLoader);