Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Do not setup SimpleXmppStringprep twice. #44

Merged

Conversation

bgrozev
Copy link
Contributor

@bgrozev bgrozev commented Apr 17, 2024

JxmppContext.java already does it. Calling it from XmppStringPrepUtil can result in replacing the desired instance if it's done prior to XmppStringPrepUtil being loaded, e.g.:

System.err.println("Initially: " + JxmppContext.getDefaultContext().xmppStringprep.getClass().getName());
JxmppContext.setDefaultXmppStringprep(RocksXmppPrecisStringprep.INSTANCE);
System.err.println("Changed to Rocks: " + JxmppContext.getDefaultContext().xmppStringprep.getClass().getName());
try {
    JidCreate.from("example.com");
} catch(Exception e) {}
System.err.println("After parsing: " + JxmppContext.getDefaultContext().xmppStringprep.getClass().getName());

Results in:

Initially: org.jxmpp.stringprep.simple.SimpleXmppStringprep
Changed to Rocks: org.jxmpp.stringprep.rocksxmppprecis.RocksXmppPrecisStringprep
After parsing: org.jxmpp.stringprep.simple.SimpleXmppStringprep

@Flowdalic
Copy link
Member

Thanks, please squash

JxmppContext.java already does it.
@bgrozev bgrozev force-pushed the do-not-setup-simple-stringprep-twice branch from 93f7fe9 to aad620a Compare July 24, 2024 09:35
@Flowdalic Flowdalic merged commit 245a720 into igniterealtime:master Sep 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants