We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ContextAutoTypeBeforeHandler 跨 ClassLoader 使用时 classCache 缓存会导致类转换异常
部分代码省略 public class ContextAutoTypeBeforeHandler implements JSONReader.AutoTypeBeforeHandler { final Map<String, Class> classCache = new ConcurrentHashMap<>(16, 0.75f, 1); @Override public Class<?> apply(String typeName, Class<?> expectClass, long features) { if (Arrays.binarySearch(acceptHashCodes, hash) >= 0) { Class clazz = classCache.get(typeName); if (clazz == null) { clazz = loadClass(typeName); if (clazz != null) { Class origin = classCache.putIfAbsent(typeName, clazz); if (origin != null) { clazz = origin; } } } if (clazz != null) { return clazz; } } } } }
The text was updated successfully, but these errors were encountered:
fix : ContextAutoTypeBeforeHandler not work on multi class loader, fo…
7fcb898
…r issue #753
https://github.com/alibaba/fastjson2/releases/tag/2.0.14 问题已修复,请用新版本
Sorry, something went wrong.
No branches or pull requests
问题描述
ContextAutoTypeBeforeHandler 跨 ClassLoader 使用时 classCache 缓存会导致类转换异常
重现步骤
The text was updated successfully, but these errors were encountered: