Skip to content

Commit

Permalink
No repository reload without partialBean
Browse files Browse the repository at this point in the history
  • Loading branch information
skybber committed Jan 16, 2020
1 parent de0ecca commit f462db7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Expand Up @@ -102,14 +102,14 @@ public void registerRepositoryClasses(List<Class<?>> repositoryClassesList) {
// ds>=1.9
public void registerRepoProxy(Object repoProxy, Class<?> repositoryClass) {
if (repositoryClasses == null) {
return;
return;
}
if (!registeredRepoProxies.containsKey(repoProxy)) {
LOGGER.debug("DeltaspikePlugin - repository proxy registered : {}", repositoryClass.getName());
}
Class<?> checkedClass = repositoryClass;
while(checkedClass != null && !repositoryClasses.contains(checkedClass)) {
checkedClass = checkedClass.getSuperclass();
checkedClass = checkedClass.getSuperclass();
}
if (checkedClass != null) {
registeredRepoProxies.put(repoProxy, repositoryClass.getName());
Expand All @@ -134,7 +134,9 @@ public void registerWindowContext(Object windowContext) {
public void classReload(CtClass clazz, Class original, ClassPool classPool) throws NotFoundException {
checkRefreshViewConfigExtension(clazz, original);
PartialBeanClassRefreshCommand cmd = checkRefreshPartialBean(clazz, original, classPool);
checkRefreshRepository(clazz, classPool, cmd);
if (cmd != null) {
checkRefreshRepository(clazz, classPool, cmd);
}
}

private PartialBeanClassRefreshCommand checkRefreshPartialBean(CtClass clazz, Class original, ClassPool classPool) throws NotFoundException {
Expand All @@ -158,11 +160,7 @@ private void checkRefreshRepository(CtClass clazz, ClassPool classPool, PartialB
cmd = new RepositoryRefreshCommand(appClassLoader, clazz.getName(), getRepositoryProxies(clazz.getName()));
}
if (cmd != null) {
if (masterCmd != null) {
masterCmd.addChainedCommand(cmd);
} else {
scheduler.scheduleCommand(cmd, WAIT_ON_REDEFINE);
}
masterCmd.addChainedCommand(cmd);
}
}
}
Expand Down Expand Up @@ -190,7 +188,7 @@ private boolean isRepository(CtClass clazz, ClassPool classPool) throws NotFound
}
CtClass superClass = clazz.getSuperclass();
if (superClass != null) {
return isRepository(superClass, classPool);
return isRepository(superClass, classPool);
}
return false;
}
Expand Down
2 changes: 2 additions & 0 deletions run-tests.sh
Expand Up @@ -23,6 +23,8 @@ function test {
cd plugin/hotswap-agent-hibernate-plugin; ./run-tests.sh; cd ../..
cd plugin/hotswap-agent-hibernate3-plugin; ./run-tests.sh; cd ../..
cd plugin/hotswap-agent-weld-plugin; ./run-tests.sh; cd ../..
cd plugin/hotswap-agent-owb-plugin; ./run-tests.sh; cd ../..
cd plugin/hotswap-agent-deltaspike-plugin; ./run-tests.sh; cd ../..
cd plugin/hotswap-agent-resteasy-registry-plugin; ./run-tests.sh; cd ../..
}

Expand Down

0 comments on commit f462db7

Please sign in to comment.