Community
Participate
Eclipse IDE
ReliableFile may throw a NumberFormatException when parsing the checksum into a long. This problem was discovered in the SMF version of reliable file and I verified that Eclipse has a similar problem. The proposed fix is to convert bytes to string using UTF-8.
Created attachment 26293 [details] Patch for fix
should consider for 3.1.1. It seems this is not a problem on any of the officially supported platforms of Eclipse. We happened to run into this problem on zOS.
Questions about the patch. - Should you not catch UnsupportedEncodingException if for some reason UTF-8 is not supported and use the default encoding then? - What is the difference between specifying "UTF-8" and "UTF8" (no dash '-') encoding. Is it specified in Java that the two are equivilant? Seems that we use both forms in many different places in Eclipse code. Which form is preferred if any?
I went with the java documentation that states all JVMs must support the following encodings ( j2se/1.3/docs/api/java/lang/package-summary.html#charenc ): US-ASCII ISO-8859-1 UTF-8 UTF-16BE UTF-16LE UTF-16 I assumed it would be a JVM issue if UTF-8 was not supported. I went with the javadoc for "UTF-8" instead of "UTF8". It appears most platforms have several mappings for the same encoding - I'm don't know the formal rules though.
Created attachment 26592 [details] New patch I released this new patch to head. I simply added a try-catch just to be extra safe.
Pascal, please review last patch for 3.1.1. Thanks.
good to go.
Fixed for 3.1.1.