Bug 1244

Summary: MovieSimple: String format %d implicit conversion from boolean to int fails using OpenJDK 1.8
Product: [JogAmp] Jogl Reporter: Xerxes Rånby <xerxes>
Component: coreAssignee: Sven Gothel <sgothel>
Status: RESOLVED FIXED    
Severity: trivial CC: sgothel
Priority: ---    
Version: 2.3.2   
Hardware: All   
OS: all   
Type: DEFECT SCM Refs:
7464d081c5381d513af2b8fd8c388390f8c60cf7
Workaround: ---

Description Xerxes Rånby 2015-10-03 15:39:36 CEST
Running MovieSimple fails using OpenJDK 1.8.0_51 with the exception:
Caused by: java.util.IllegalFormatConversionException: d != java.lang.Boolean
	at java.util.Formatter$FormatSpecifier.failConversion(Formatter.java:4302)
	at java.util.Formatter$FormatSpecifier.printInteger(Formatter.java:2793)
	at java.util.Formatter$FormatSpecifier.print(Formatter.java:2747)
	at java.util.Formatter.format(Formatter.java:2520)
	at java.util.Formatter.format(Formatter.java:2455)
	at java.lang.String.format(String.java:2928)
	at com.jogamp.opengl.test.junit.jogl.demos.es2.av.MovieSimple$InfoTextRendererGLELBase.display(MovieSimple.java:189)

final String text1 = String.format("%0"+ptsPrec+"f/%0"+ptsPrec+"f s, %s (%01.2fx, vol %01.2f), a %01.2f, fps %02.1f -> %02.1f / %02.1f, v-sync %d",
                    pts, mPlayer.getDuration() / 1000f,
                    mPlayer.getState().toString().toLowerCase(), mPlayer.getPlaySpeed(), mPlayer.getAudioVolume(),
                    aspect, mPlayer.getFramerate(), lfps, tfps, swapIntervalSet);

openjdk version "1.8.0_51"
OpenJDK Runtime Environment (build 1.8.0_51-b16)
OpenJDK 64-Bit Server VM (build 25.51-b03, mixed mode)

replace
v-sync %d with
v-sync %b
fixes the issue
Comment 2 Sven Gothel 2015-10-03 18:02:09 CEST
merged  7464d081c5381d513af2b8fd8c388390f8c60cf7