[
https://issues.apache.org/jira/browse/LANG-578?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Olivier TERRIEN updated LANG-578:
---------------------------------
Description:
This runs successfully :
{code:java}
ExtendedMessageFormat templateFormat = new ExtendedMessageFormat("''{0}''");
System.out.println(templateFormat.format(new String[] { "MESSAGE" }));
{code}
The result is 'MESSAGE'.
This raises an error :
{code:java}
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" }));
{code}
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
was:
This runs successfully :
{code:java}
ExtendedMessageFormat templateFormat = new ExtendedMessageFormat("''{0}''");
System.out.println(templateFormat.format(new String[] { "MESSAGE" }));
{code}
The result is 'MESSAGE'.
This raises an error :
{code:java}
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" }));
{code}
The result is an exception (java heap space).
*way* : In _appendQuotedString_ method the code bellow doesn't seem to
increment the index pos before returning
> Problem with using of simple quotes in ExtendedMessageFormat when a registry
> is specified
> -----------------------------------------------------------------------------------------
>
> Key: LANG-578
> URL: https://issues.apache.org/jira/browse/LANG-578
> Project: Commons Lang
> Issue Type: Bug
> Components: lang.text.*
> Affects Versions: 2.4
> Reporter: Olivier TERRIEN
>
> This runs successfully :
> {code:java}
> ExtendedMessageFormat templateFormat = new ExtendedMessageFormat("''{0}''");
> System.out.println(templateFormat.format(new String[] { "MESSAGE" }));
> {code}
> The result is 'MESSAGE'.
> This raises an error :
> {code:java}
> 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" }));
> {code}
> 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
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.