You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If it is feasible with reasonable effort, we could take the constant pool of classes into account when importing classes. This would make it possible to detect dependencies which occur just through the constant pool of a class (compare #298)
Note that ASM does not support a direct access to the constant pool, thus I don't know out of the box how to achieve this in the best way. Maybe it would be possible to observe all the ldc instructions of all classes through ASM. Or we would need a different approach to read the constant pool of classes.
The text was updated successfully, but these errors were encountered:
So far ArchUnit has not been able to detect the pure usage of class objects as dependencies. E.g. the following example would not have detected a dependency on `Evil`, since besides the reference to the class object no further dependency on `Evil` (like a field access or method call) has occurred.
```
class Example {
final Map<Class<?>, Object> association = Map.of(Evil.class, anything);
}
```
With this PR `JavaClass` now knows its `referencedClassObjects`, including the respective line number. Furthermore class objects are now parts of the `dependencies{From/To}Self` of a `JavaClass`.
Resolves: #309
Issue: #446Resolves: #474Resolves: #515
So far ArchUnit has not been able to detect the pure usage of class objects as dependencies. E.g. the following example would not have detected a dependency on `Evil`, since besides the reference to the class object no further dependency on `Evil` (like a field access or method call) has occurred.
```
class Example {
final Map<Class<?>, Object> association = Map.of(Evil.class, anything);
}
```
With this PR `JavaClass` now knows its `referencedClassObjects`, including the respective line number. Furthermore class objects are now parts of the `dependencies{From/To}Self` of a `JavaClass`.
Resolves: #309
Issue: #446Resolves: #474Resolves: #515
If it is feasible with reasonable effort, we could take the constant pool of classes into account when importing classes. This would make it possible to detect dependencies which occur just through the constant pool of a class (compare #298)
Note that ASM does not support a direct access to the constant pool, thus I don't know out of the box how to achieve this in the best way. Maybe it would be possible to observe all the
ldc
instructions of all classes through ASM. Or we would need a different approach to read the constant pool of classes.The text was updated successfully, but these errors were encountered: