title: parseInt returns double in rhino
body: <p>I have this JavaScript file (Rhino 1.7R4).</p>
  
  <pre class="lang-js prettyprint-override"><code>importPackage(java.io);
  importPackage(java.lang);
  importPackage(java.util);
  
  var reader = new BufferedReader( new InputStreamReader(System['in']) );
  
  var line = reader.readLine();
  var tok = new java.util.StringTokenizer(line);
  
  var A = Integer.parseInt(tok.nextToken());
  var B = Integer.parseInt(tok.nextToken());
  var C = Integer.parseInt(tok.nextToken());
  
  // System.out.printf( "A=%d, B=%d, C=%d\n", A, B, C );
  System.out.printf( "A=%f, B=%f, C=%f\n", A, B, C );
  </code></pre>
  
  <p>When I uncomment first <code>printf</code> - I'm getting</p>
  
  <pre><code>A=Exception in thread "main" org.mozilla.javascript.WrappedException: Wrapped java.util.IllegalFormatConversionException: d != java.lang.Double
          at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1754)
          at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:148)
          at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:225)
          at org.mozilla.javascript.optimizer.OptRuntime.callN(OptRuntime.java:52)
          at test._c_script_0(Unknown Source)
          at test.call(Unknown Source)
          at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:394)
          at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3091)
          at test.call(Unknown Source)
          at test.exec(Unknown Source)
          at org.mozilla.javascript.optimizer.OptRuntime$1.run(OptRuntime.java:218)
          at org.mozilla.javascript.Context.call(Context.java:489)
          at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:504)
          at org.mozilla.javascript.optimizer.OptRuntime.main(OptRuntime.java:206)
          at test.main(Unknown Source)
  Caused by: java.util.IllegalFormatConversionException: d != java.lang.Double
          at java.util.Formatter$FormatSpecifier.failConversion(Unknown Source)
          at java.util.Formatter$FormatSpecifier.printInteger(Unknown Source)
          at java.util.Formatter$FormatSpecifier.print(Unknown Source)
          at java.util.Formatter.format(Unknown Source)
          at java.io.PrintStream.format(Unknown Source)
          at java.io.PrintStream.printf(Unknown Source)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
          at java.lang.reflect.Method.invoke(Unknown Source)
          at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:126)
          ... 13 more
  </code></pre>