[ 
https://issues.apache.org/jira/browse/SLING-2699?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13533073#comment-13533073
 ] 

Felix Meschberger commented on SLING-2699:
------------------------------------------

Looking at the code, the # flag as no effect in string arguments -- in fact 
this only may have an effect for arguments implementing the Formattable 
interface (which String doesn't).

In Java 6 there is no effect, while in Java 7 (and current Java 8 builds), 
using # with an argument not implementing the Formattable interface throws an 
exception. Looks like this is implied by the description "Depends on the 
definition of Formattable." in the Formatter JavaDoc.
                
> FormatFlagsConversionMismatchException in RequestHistoryConsolePlugin  with 
> Java 7
> ----------------------------------------------------------------------------------
>
>                 Key: SLING-2699
>                 URL: https://issues.apache.org/jira/browse/SLING-2699
>             Project: Sling
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: Engine 2.2.6
>         Environment: java version "1.7.0_07"
> Java(TM) SE Runtime Environment (build 1.7.0_07-b11)
> Java HotSpot(TM) 64-Bit Server VM (build 23.3-b01, mixed mode)
>            Reporter: Bertrand Delacretaz
>            Priority: Minor
>
> I haven't tried it myself but a colleague reports getting the below stack 
> trace with Java7:
> 0.10.2012 04:40:09.447 INFO [0:0:0:0:0:0:0:1 [1349869209447] GET 
> /system/console/requests HTTP/1.1] servletengine Servlet threw exception: 
> java.util.FormatFlagsConversionMismatchException: Conversion = s, Flags = #
> at java.util.Formatter$FormatSpecifier.failMismatch(Unknown Source)
> at java.util.Formatter$FormatSpecifier.printString(Unknown Source)
> at java.util.Formatter$FormatSpecifier.print(Unknown Source)
> at java.util.Formatter.format(Unknown Source)
> at java.util.Formatter.format(Unknown Source)
> at java.lang.String.format(Unknown Source)
> at 
> org.apache.sling.engine.impl.request.RequestHistoryConsolePlugin$Plugin.getLinksTable(RequestHistoryConsolePlugin.java:168)
> at 
> org.apache.sling.engine.impl.request.RequestHistoryConsolePlugin$Plugin.doGet(RequestHistoryConsolePlugin.java:239)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to