Merge pull request #225 from davydotcom/patch-type-registry-correct
Patch type registry synchronized and Fix clearing of ReflectionUtils
This commit is contained in:
@@ -441,6 +441,15 @@ 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
|
||||
}
|
||||
|
||||
typeRegistry.fireReloadEvent(this, versionsuffix);
|
||||
|
||||
|
||||
@@ -1125,10 +1125,13 @@ public class TypeRegistry {
|
||||
if (typeId >= reloadableTypes.length) {
|
||||
resizeReloadableTypeArray(typeId);
|
||||
}
|
||||
reloadableTypes[typeId] = rtype;
|
||||
if ((typeId + 1) > reloadableTypesSize) {
|
||||
reloadableTypesSize = typeId + 1;
|
||||
synchronized(this) {
|
||||
reloadableTypes[typeId] = rtype;
|
||||
if ((typeId + 1) > reloadableTypesSize) {
|
||||
reloadableTypesSize = typeId + 1;
|
||||
}
|
||||
}
|
||||
|
||||
// allocatedIds.put(slashname, rtype);
|
||||
// allocatedButNotYetRegisteredItds.remove(slashname);
|
||||
int cglibIndex = slashname.indexOf("$$EnhancerBy");
|
||||
@@ -1196,10 +1199,13 @@ public class TypeRegistry {
|
||||
if (typeId >= reloadableTypes.length) {
|
||||
resizeReloadableTypeArray(typeId);
|
||||
}
|
||||
reloadableTypes[typeId] = rtype;
|
||||
if ((typeId + 1) > reloadableTypesSize) {
|
||||
reloadableTypesSize = typeId + 1;
|
||||
synchronized(this) {
|
||||
reloadableTypes[typeId] = rtype;
|
||||
if ((typeId + 1) > reloadableTypesSize) {
|
||||
reloadableTypesSize = typeId + 1;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user