Details
-
Bug
-
Resolution: Done
-
Major
-
None
-
Undefined
-
+
Description
With instrumentation enabled, If there are updated classes AND new classes, instrumentation will occur, but the new "ADDED" classes won't be loaded.
In fact, consider the case:
changedClassResults.addedClasses.isEmpty() == false
&& changedClassResults.changedClasses.isEmpty() == false
in `RuntimeUpdatesProcessor` the following `if` condition will be `true`, causing the body to execute, setting `instrumentationChange = true`
```
if (changedClassResults.deletedClasses.isEmpty() && !changedClassResults.changedClasses.isEmpty()) {
```
however, the check a few lines later:
```
boolean restartNeeded = !instrumentationChange && (changedClassResults.isChanged()
(IsolatedDevModeMain.deploymentProblem != null && userInitiated) | configFileRestartNeeded); ``` |
---|
will always be false, skipping over `changedClassResults.isChanged()` which expands to:
```
!changedClasses.isEmpty() || !deletedClasses.isEmpty() || !addedClasses.isEmpty();
```
so either (1) instrumentation should be skipped over when there are ADDED class files, or (2) the check below should read something along the lines of:
```
boolean restartNeeded = !changedClassResults.addedClasses.isEmpty() ||
!instrumentationChange &&
((IsolatedDevModeMain.deploymentProblem != null && userInitiated) || configFileRestartNeeded);
```
this patch is for (1).
(This should be backported to 1.11)
EDIT: This is draft as I am still verifying this works locally with both `main` and `1.11`
related: https://github.com/kiegroup/kogito-runtimes/pull/1123