Checking if ReflectionUtils class exists and clears its cache in the event of a class chanage
This commit is contained in:
@@ -441,6 +441,16 @@ public class ReloadableType {
|
||||
tagAsAffectedByReload();
|
||||
tagSupertypesAsAffectedByReload();
|
||||
tagSubtypesAsAffectedByReload();
|
||||
//ReflectionUtils has a cache that needs cleared
|
||||
try {
|
||||
Class<?> reflecutionUtil = Class.forName("org.springframework.util.ReflectionUtils");
|
||||
// java.lang.NoSuchMethodException: org.codehaus.groovy.reflection.ClassInfo$LazyCachedClassRef.clear()
|
||||
Method clearMethod = reflecutionUtil.getMethod("clearCache");//DeclaredMethod("clear");
|
||||
clearMethod.invoke(null);
|
||||
} catch(Exception e3) {
|
||||
//this better not blow up in my face
|
||||
}
|
||||
// ReflectionUtils.clearCache();
|
||||
|
||||
typeRegistry.fireReloadEvent(this, versionsuffix);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user