private static void updateInjections(final Collection<Injection> injections, final ClassLoader classLoader, final boolean keepInjection) {
final Iterator<Injection> it = injections.iterator();
final List<Injection> newOnes = new ArrayList<Injection>();
while (it.hasNext()) {
final Injection injection = it.next();
if (injection.getTarget() == null) {
try {
final Class<?> target = classLoader.loadClass(injection.getClassname());
if (keepInjection) {
final Injection added = new Injection(injection.getJndiName(), injection.getName(), target);
newOnes.add(added);
} else {
injection.setTarget(target);
}
} catch (ClassNotFoundException cnfe) {