I've found a bug with annotations that are loaded via classgraph.
When invoking the equals method on the annotation after the scan result is closed, a NullPointerException is thrown here.
From what I can tell, the reason for this is that the preceding code is checking the wrong thing. When the scan result is closed, annotationInfo.scanResult is not touched. However, annotationInfo.scanResult.reflectionUtils IS set to null. I think the fix is to change the condition of that ternary to check for annotationInfo.scanResult.reflectionUtils == null.
I've created a small reproducible example here: https://github.com/Skater901/classgraph-annotation-equals-problem/blob/main/src/main/kotlin/au/com/skater901/main.kt
I've found a bug with annotations that are loaded via classgraph.
When invoking the
equalsmethod on the annotation after the scan result is closed, aNullPointerExceptionis thrown here.From what I can tell, the reason for this is that the preceding code is checking the wrong thing. When the scan result is closed,
annotationInfo.scanResultis not touched. However,annotationInfo.scanResult.reflectionUtilsIS set to null. I think the fix is to change the condition of that ternary to check forannotationInfo.scanResult.reflectionUtils == null.I've created a small reproducible example here: https://github.com/Skater901/classgraph-annotation-equals-problem/blob/main/src/main/kotlin/au/com/skater901/main.kt