*/
package org.opendaylight.yangtools.sal.binding.generator.impl;
+import com.google.common.base.Preconditions;
+
import java.util.Map;
import java.util.concurrent.Callable;
import java.util.concurrent.ConcurrentHashMap;
import org.opendaylight.yangtools.yang.model.api.ChoiceCaseNode;
import org.opendaylight.yangtools.yang.model.api.SchemaPath;
-import com.google.common.base.Preconditions;
-
/**
* Abstract base class which defines the baseline for the real {@link TransformerGenerator}.
* This class exists to expose the basic interface and common interactions with the rest
* will VerificationErrors.
*/
@Extension
- protected static final ClassLoadingStrategy CLASS_LOADING_STRATEGY =
- GeneratedClassLoadingStrategy.getTCCLClassLoadingStrategy();
+ protected static final ClassLoadingStrategy CLASS_LOADING_STRATEGY = GeneratedClassLoadingStrategy.getTCCLClassLoadingStrategy();
@Extension
protected final TypeResolver typeResolver;
@Extension
lock.lock();
try {
- javAssist.appendClassLoaderIfMissing(cls);
- return ClassLoaderUtils.withClassLoader(cls, function);
+ synchronized (javAssist) {
+ javAssist.appendClassLoaderIfMissing(cls);
+ return ClassLoaderUtils.withClassLoader(cls, function);
+ }
} finally {
lock.unlock();
}
*/
package org.opendaylight.yangtools.sal.binding.generator.util;
+import com.google.common.base.Preconditions;
+
import java.util.Collection;
import java.util.Map;
import java.util.WeakHashMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import com.google.common.base.Preconditions;
-
public final class JavassistUtils {
private static final Logger LOG = LoggerFactory.getLogger(JavassistUtils.class);
return ret;
}
+ /**
+ * Get reference to the internal lock.
+ *
+ * @return Lock object
+ *
+ * @deprecated Synchronize on an instance of this class instead.
+ */
+ @Deprecated
public Lock getLock() {
return lock;
}