|
Fix Sanitizer crashing on JDK-internal fields when given JDK objects
findItems() unconditionally read every field's value via reflection just to check whether it was annotated or embeddable, even for fields neither use needed. This forces access to JDK-internal fields (e.g. java.util.ArrayList#serialVersionUID) when a JDK collection/object is passed directly as the sanitize() target, which the module system blocks without --add-opens and throws InaccessibleObjectException for. Now the annotated/embeddable check happens first, using only field metadata, and the value is read only when actually needed. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> |
|---|
|
|
| src/main/java/io/ljunggren/sanitizer/Sanitizer.java |
|---|
| src/test/java/io/ljunggren/sanitizer/SanitizerExtraTest.java |
|---|