[JBoss JIRA] (JGRP-2062) TYPE_STRING does not handle unicode
by Bela Ban (JIRA)
[ https://issues.jboss.org/browse/JGRP-2062?page=com.atlassian.jira.plugin.... ]
Bela Ban updated JGRP-2062:
---------------------------
Description:
In several places throughout the org.jgroups.util.Util class, it is assumed that Strings are one byte per character.
For example, see objectToByteBuffer lines 561-567:
https://github.com/belaban/JGroups/blob/master/src/org/jgroups/util/Util....
{code:java}
case TYPE_STRING:
String str=(String)obj;
int len=str.length();
ByteBuffer retval=ByteBuffer.allocate(Global.BYTE_SIZE + len).put(TYPE_STRING);
for(int i=0; i < len; i++)
retval.put((byte)str.charAt(i));
return retval.array();
{code}
This code will incorrectly encode any String with non ASCII encoding.
There are several options to fix. You could use str.getBytes(StandardCharsets.UTF_8) to get a proper byte encoding, or you could use the existing TYPE_SERIALIZABLE code path.
was:
In several places throughout the org.jgroups.util.Util class, it is assumed that Strings are one byte per character.
For example, see objectToByteBuffer lines 561-567:
https://github.com/belaban/JGroups/blob/master/src/org/jgroups/util/Util....
{{case TYPE_STRING:
String str=(String)obj;
int len=str.length();
ByteBuffer retval=ByteBuffer.allocate(Global.BYTE_SIZE + len).put(TYPE_STRING);
for(int i=0; i < len; i++)
retval.put((byte)str.charAt(i));
return retval.array();}}
This code will incorrectly encode any String with non ASCII encoding.
There are several options to fix. You could use str.getBytes(StandardCharsets.UTF_8) to get a proper byte encoding, or you could use the existing TYPE_SERIALIZABLE code path.
> TYPE_STRING does not handle unicode
> -----------------------------------
>
> Key: JGRP-2062
> URL: https://issues.jboss.org/browse/JGRP-2062
> Project: JGroups
> Issue Type: Bug
> Reporter: Cody Ebberson
> Assignee: Bela Ban
> Priority: Minor
> Fix For: 4.0
>
>
> In several places throughout the org.jgroups.util.Util class, it is assumed that Strings are one byte per character.
> For example, see objectToByteBuffer lines 561-567:
> https://github.com/belaban/JGroups/blob/master/src/org/jgroups/util/Util....
> {code:java}
> case TYPE_STRING:
> String str=(String)obj;
> int len=str.length();
> ByteBuffer retval=ByteBuffer.allocate(Global.BYTE_SIZE + len).put(TYPE_STRING);
> for(int i=0; i < len; i++)
> retval.put((byte)str.charAt(i));
> return retval.array();
> {code}
> This code will incorrectly encode any String with non ASCII encoding.
> There are several options to fix. You could use str.getBytes(StandardCharsets.UTF_8) to get a proper byte encoding, or you could use the existing TYPE_SERIALIZABLE code path.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years, 9 months
[JBoss JIRA] (ELY-602) Add support for SASL mechanism ordering by name.
by Darran Lofthouse (JIRA)
[ https://issues.jboss.org/browse/ELY-602?page=com.atlassian.jira.plugin.sy... ]
Darran Lofthouse updated ELY-602:
---------------------------------
Description: We previously relied on ordering of the factories although this does not work well once multiple modules are in use, add SortedMechanismSasl*Factory implementations that can take a Comparator to sort the names from a delegate. (was: Ideally we would actually have policy to sort mechanisms however for the moment we can at the very least get our factories into a desired order.)
> Add support for SASL mechanism ordering by name.
> ------------------------------------------------
>
> Key: ELY-602
> URL: https://issues.jboss.org/browse/ELY-602
> Project: WildFly Elytron
> Issue Type: Feature Request
> Components: SASL
> Reporter: Darran Lofthouse
> Assignee: Darran Lofthouse
> Fix For: 1.1.0.Beta7
>
>
> We previously relied on ordering of the factories although this does not work well once multiple modules are in use, add SortedMechanismSasl*Factory implementations that can take a Comparator to sort the names from a delegate.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years, 9 months
[JBoss JIRA] (WFCORE-1673) Testsuite: tests for CLI controller aliases
by Brian Stansberry (JIRA)
[ https://issues.jboss.org/browse/WFCORE-1673?page=com.atlassian.jira.plugi... ]
Brian Stansberry commented on WFCORE-1673:
------------------------------------------
I put the CLI component on this so the CLI devs (i.e. [~jfdenise]) are aware that this work is being done.
> Testsuite: tests for CLI controller aliases
> -------------------------------------------
>
> Key: WFCORE-1673
> URL: https://issues.jboss.org/browse/WFCORE-1673
> Project: WildFly Core
> Issue Type: Task
> Components: CLI, Test Suite
> Reporter: Martin Schvarcbacher
> Assignee: Martin Schvarcbacher
> Priority: Minor
>
> Added integration tests for server aliases defined in jboss-cli.xml
> Usage in bin/jboss-cli.xml:
> {code:xml}
> <controllers>
> <controller name="ServerOne">
> <protocol>http-remoting</protocol>
> <host>localhost</host>
> <port>9990</port>
> </controller>
> </controllers>
> {code}
> {code:bash}
> ./bin/jboss-cli.sh --controller=ServerOne --connect
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years, 9 months
[JBoss JIRA] (WFCORE-1673) Testsuite: tests for CLI controller aliases
by Brian Stansberry (JIRA)
[ https://issues.jboss.org/browse/WFCORE-1673?page=com.atlassian.jira.plugi... ]
Brian Stansberry updated WFCORE-1673:
-------------------------------------
Component/s: CLI
> Testsuite: tests for CLI controller aliases
> -------------------------------------------
>
> Key: WFCORE-1673
> URL: https://issues.jboss.org/browse/WFCORE-1673
> Project: WildFly Core
> Issue Type: Task
> Components: CLI, Test Suite
> Reporter: Martin Schvarcbacher
> Assignee: Martin Schvarcbacher
> Priority: Minor
>
> Added integration tests for server aliases defined in jboss-cli.xml
> Usage in bin/jboss-cli.xml:
> {code:xml}
> <controllers>
> <controller name="ServerOne">
> <protocol>http-remoting</protocol>
> <host>localhost</host>
> <port>9990</port>
> </controller>
> </controllers>
> {code}
> {code:bash}
> ./bin/jboss-cli.sh --controller=ServerOne --connect
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years, 9 months