sagarmiglani commented on PR #53:
URL:
https://github.com/apache/sling-org-apache-sling-xss/pull/53#issuecomment-2591857027
Thanks @rombert , I initially tried implementing it in the constructor, but
the tests began to fail. I believe Jackson does not allow this approach when
the constructor is marked with @JsonCreator.
```
[ERROR] org.apache.sling.xss.impl.AntiSamyPolicyTest Time elapsed: 0.33 s
<<< ERROR!
com.fasterxml.jackson.databind.exc.ValueInstantiationException:
Cannot construct instance of `org.apache.sling.xss.impl.xml.Regexp`,
problem: Cannot invoke "String.isEmpty()" because "this.pattern" is null
at [Source: (com.ctc.wstx.sr.ValidatingStreamReader); line: 178, column:
17] (through reference chain:
org.apache.sling.xss.impl.xml.AntiSamyRules["common-attributes"]->java.util.ArrayList[1]->org.apache.sling.xss.impl.xml.Attribute["regexp-list"]->java.util.ArrayList[0])
at
org.apache.sling.xss.impl.AntiSamyPolicyTest.setup(AntiSamyPolicyTest.java:48)
Caused by: java.lang.NullPointerException: Cannot invoke "String.isEmpty()"
because "this.pattern" is null
at
org.apache.sling.xss.impl.AntiSamyPolicyTest.setup(AntiSamyPolicyTest.java:48)
```
If the current approach doesn’t work, I will explore other solutions. If you
have any insights on what might be causing the issue with Jackson, please let
me know.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]