Found reliance on default encoding in ... 66 cases

160 views
Skip to first unread message

Matthias Vach

unread,
Aug 21, 2013, 11:23:15 AM8/21/13
to jenkin...@googlegroups.com
Hi all,
while building jenkins and running findbugs on the jenkins sources I noticed that findbugs detected 66 issues were the coding is relying on the default platform encoding.

Is that intended? Or does it make sence when I'll propose a change which switches all those cases to utf-8?


Regards Matthias

Jesse Glick

unread,
Aug 21, 2013, 4:57:50 PM8/21/13
to jenkin...@googlegroups.com
On Wed, Aug 21, 2013 at 11:23 AM, Matthias Vach
<matthi...@googlemail.com> wrote:
> Is that intended?

Not sure. At least *some* uses of the default encoding are intentional
(however unfortunate): the build log is written in default encoding
for the slave, for example.

Generally speaking, we should be using UTF-8 wherever possible, but
when interaction with the stdio of external processes is involved,
this may not be possible.

teilo

unread,
Aug 21, 2013, 5:54:25 PM8/21/13
to jenkin...@googlegroups.com
In those cases would it not be better to explicitly pass the platform charset to make it obvious it is a conscious decision?

Jesse Glick

unread,
Aug 21, 2013, 6:14:46 PM8/21/13
to jenkin...@googlegroups.com
On Wed, Aug 21, 2013 at 5:54 PM, teilo <teilo+...@teilo.net> wrote:
> In those cases would it not be better to explicitly pass the platform charset to make it obvious it is a conscious decision?

Yes. At least for the run log it already does, so if FB is turning up
usages of e.g. new FileWriter(File) then these ought to get corrected.

A fair number of usages are known to be ASCII-only, but passing
"ASCII" there would be clearer and safer.

Matthias Vach

unread,
Aug 22, 2013, 2:39:40 AM8/22/13
to jenkin...@googlegroups.com
... oke I'll try to find those who can be clearly fixed.

Reply all
Reply to author
Forward
0 new messages