All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.openl.rules.project.SafeCloner Maven / Gradle / Ivy

package org.openl.rules.project;

import com.rits.cloning.Cloner;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Map;

public class SafeCloner extends Cloner {
    @Override
    @SuppressWarnings("unchecked")
    public  T cloneInternal(T o, Map clones) throws IllegalAccessException {
        if (o instanceof Logger) {
            return (T) LoggerFactory.getLogger(o.getClass());
        }
        if (o instanceof ClassLoader) {
            // There is no need to clone ClassLoader
            return null;
        }
        return super.cloneInternal(o, clones);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy