[ 
https://issues.apache.org/jira/browse/AMQ-8122?focusedWorklogId=934372&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-934372
 ]

ASF GitHub Bot logged work on AMQ-8122:
---------------------------------------

                Author: ASF GitHub Bot
            Created on: 11/Sep/24 21:13
            Start Date: 11/Sep/24 21:13
    Worklog Time Spent: 10m 
      Work Description: azotcsit commented on PR #1291:
URL: https://github.com/apache/activemq/pull/1291#issuecomment-2344713471

   @mattrpav 
   
   I gave a though to "non-Java applications can send things over the wire" 
scenario that you had pointed out. I think you're right, and we need to have 
corresponding tests as a part of `DataByteArrayInputStreamTest`. Could you 
please take a look at the latest changes.
   




Issue Time Tracking
-------------------

    Worklog Id:     (was: 934372)
    Time Spent: 1h 20m  (was: 1h 10m)

> DataByteArrayInputStreamTest.testNonAscii() is faulty
> -----------------------------------------------------
>
>                 Key: AMQ-8122
>                 URL: https://issues.apache.org/jira/browse/AMQ-8122
>             Project: ActiveMQ Classic
>          Issue Type: Bug
>          Components: KahaDB
>            Reporter: Marcono1234
>            Assignee: Jean-Baptiste Onofré
>            Priority: Minor
>          Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> It appears the unit test 
> [{{DataByteArrayInputStreamTest.testNonAscii()}}|https://github.com/apache/activemq/blob/1c315db1d1a5432a87e0e43d82d8e926811c6419/activemq-client/src/test/java/org/apache/activemq/util/DataByteArrayInputStreamTest.java#L29]
>  is faulty:
> # It loops with {{while(Character.isDefined(test))}}, however the Unicode 
> data has gaps, currently with Java 15 the first gap is the code point 888, 
> {{Character.isDefined(888) == false}}.
> Therefore this test never tries any higher code points. Looping up to, 
> including {{Character.MAX_CODE_POINT}} might be better.
> # Based on the comment next to the variable {{test}}, it appears the author 
> wanted to test supplementary code points as well, however by casting them to 
> {{char}} when creating the String, they are cutting off code points > 
> {{\uFFFF}}. It should instead convert the code point to a String like this:
> {code:java}
> // Java 11
> String toTest = Character.toString(test);
> // Java < 11
> String toTest = String.valueOf(Character.toChars(test));
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact


Reply via email to