Change loading of properties files with malformed unicode escape sequences to always fail with IllegalArgumentException.
Certain sequences of properties ending with malformed unicode escape sequences can silently and erroneously be parsed to contain residual values from a preceding line in the property file. Fixing this straight forward bug could theoretically cause some property files that were previously parsed successfully (though incorrectly) without throwing an exception to instead throw an exception.
A property file with malformed unicode sequences is specified to throw IllegalArgumentException. This happen correctly most of the time, e.g., when loading a file looking like this:
But when the malformed unicode codepoint is at the end of a line and there's a preceding line with data that would have been valid had it been on the current line, the unicode codepoint might silently be parsed using the content of the preceding line. For example this properties file:
Here the value of key2 will be parsed as if it was 'bar\u0123'. According to the specification, this should throw an IllegalArgumentException.
Fix the bug and always throw an IllegalArgumentException.
No specification change. The behavior is changed to adhere more strictly to the specification after bug is fixed.