Skip to main content

Please review fix for 4978831: removing non-ASCII text in Status

5 replies [Last post]
fda
Offline
Joined: 2005-05-27

Status exit() and parse() methods do symmetric encode/decode.
ProcessCommand.StreamCopier decodes status line to print out

https://jtharness.dev.java.net/source/browse/jtharness?rev=1475&view=rev

Is it ok to use java.util.StringTokenizer in the Status class?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
bkurotsu
Offline
Joined: 2004-12-13

The original bug was not that specific, but I don't think other parts of the test result need fixing, they already support escaped string encoding/decoding.

fda
Offline
Joined: 2005-05-27

integrated

bkurotsu
Offline
Joined: 2004-12-13

No, it is probably not ok to use a complex class like the tokenizer in this core class. You can investigate though, need to check with the various platforms to see if they support StringTokenizer.

The concept of encoding/decoding is great of course. Is there a reason that you chose not to always encode/escape the string's content rather than marking it as encoded or not? Performance?

Brian

fda
Offline
Joined: 2005-05-27

I rewrote code without StringTokinzer, it wasn't hard:

https://jtharness.dev.java.net/source/browse/jtharness?rev=1480&view=rev

Why I not always encode strings? It was intuitive decision :)
To avoid question from users who do not use ProcessCommand class or override its run() method. I didn't think of performance.

bkurotsu
Offline
Joined: 2004-12-13

Looks good, thanks.

For most users there will be no effect, which is convenient.