Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
2.4
-
None
Description
This runs successfully :
ExtendedMessageFormat templateFormat = new ExtendedMessageFormat("''{0}''"); System.out.println(templateFormat.format(new String[] { "MESSAGE" }));
The result is 'MESSAGE'.
This raises an error :
Map<String, FormatFactory> formatFactory = new HashMap<String, FormatFactory>(); formatFactory.put("formatDate", new FormatFactory() { @SuppressWarnings("all") public Format getFormat(String name, String arguments, Locale locale) { return new SimpleDateFormat(); } }); ExtendedMessageFormat templateFormat = new ExtendedMessageFormat("''{0}''", , formatFactory); System.out.println(templateFormat.format(new String[] { "MESSAGE" }));
The result is an exception (java heap space).
way : In appendQuotedString method the code above doesn't seem to increment the index pos before returning