java.lang.StringIndexOutOfBoundsException: begin 0, end 4, length 2

JDK Bug System | Kevin Rushforth | 7 months ago
tip
Do you find the tips below useful? Click on the to mark them and say thanks to rp and rafael . Or join the community to write better ones.
  1. 0

    While testing the latest build of FX for JDK 9, I was doing some random navigation on yahoo.com with HelloWebView and got an IOOBE on one of the pages. The exception message does not cause the application to fail, and the content seems to be rendered correctly in spite of the error. To reproduce, run HelloWebView as follows: $ java HelloWebView http://www.thedailyheel.com/20-stars-you-didnt-know-were-twins/?utm_source=yahoo&utm_medium=All&utm_campaign=DHCelebTwins0829 java.lang.StringIndexOutOfBoundsException: begin 0, end 4, length 2 at java.lang.String.checkBoundsBeginEnd(String.java:3122) at java.lang.String.substring(String.java:1910) at com.sun.javafx.webkit.prism.WCGraphicsPrismContext.drawString(WCGraphicsPrismContext.java:960) at com.sun.webkit.graphics.GraphicsDecoder.decode(GraphicsDecoder.java:290) at com.sun.webkit.graphics.WCRenderQueue.decode(WCRenderQueue.java:91) at com.sun.webkit.graphics.WCRenderQueue.decode(WCRenderQueue.java:102) at com.sun.webkit.graphics.WCImage.flushRQ(WCImage.java:52) at com.sun.javafx.webkit.prism.RTImage.lambda$getPixelBuffer$2(RTImage.java:163) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:514) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:514) at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:307) at com.sun.javafx.tk.RenderJob.run(RenderJob.java:58) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1158) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:632) at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125) at java.lang.Thread.run(Thread.java:804) java.lang.StringIndexOutOfBoundsException: begin 0, end 4, length 2 at java.lang.String.checkBoundsBeginEnd(String.java:3122) at java.lang.String.substring(String.java:1910) at com.sun.javafx.webkit.prism.WCGraphicsPrismContext.drawString(WCGraphicsPrismContext.java:960) at com.sun.webkit.graphics.GraphicsDecoder.decode(GraphicsDecoder.java:290) at com.sun.webkit.graphics.WCRenderQueue.decode(WCRenderQueue.java:91) at com.sun.webkit.graphics.WCRenderQueue.decode(WCRenderQueue.java:102) at com.sun.webkit.graphics.WCImage.flushRQ(WCImage.java:52) at com.sun.javafx.webkit.prism.RTImage.lambda$getPixelBuffer$2(RTImage.java:163) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:514) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:514) at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:307) at com.sun.javafx.tk.RenderJob.run(RenderJob.java:58) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1158) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:632) at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125) at java.lang.Thread.run(Thread.java:804)

    JDK Bug System | 7 months ago | Kevin Rushforth
    java.lang.StringIndexOutOfBoundsException: begin 0, end 4, length 2
  2. 0

    GitHub comment 89#269982442

    GitHub | 4 months ago | matiuri
    java.lang.StringIndexOutOfBoundsException: String index out of range: 4
  3. 0

    java.lang.StringIndexOutOfBoundsException on start-up

    GitHub | 3 weeks ago | pranasblk
    java.lang.StringIndexOutOfBoundsException: String index out of range: 4
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0
    samebug tip
    You need to make sure that capitalisation of the case for the plugin in the properties file is exactly: "AllocinePlugin" and not "allocineplugin"
    via GitHub by Omertron
  6. 0
    samebug tip
    This is a bug when using Micromax devices with VideoView. You can either exclude these devices or look at this workaround: http://stackoverflow.com/a/31942841/4347859
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.StringIndexOutOfBoundsException

    begin 0, end 4, length 2

    at java.lang.String.checkBoundsBeginEnd()
  2. Java RT
    String.substring
    1. java.lang.String.checkBoundsBeginEnd(String.java:3122)
    2. java.lang.String.substring(String.java:1910)
    2 frames
  3. com.sun.javafx
    WCGraphicsPrismContext.drawString
    1. com.sun.javafx.webkit.prism.WCGraphicsPrismContext.drawString(WCGraphicsPrismContext.java:960)
    1 frame
  4. com.sun.webkit
    WCImage.flushRQ
    1. com.sun.webkit.graphics.GraphicsDecoder.decode(GraphicsDecoder.java:290)
    2. com.sun.webkit.graphics.WCRenderQueue.decode(WCRenderQueue.java:91)
    3. com.sun.webkit.graphics.WCRenderQueue.decode(WCRenderQueue.java:102)
    4. com.sun.webkit.graphics.WCImage.flushRQ(WCImage.java:52)
    4 frames
  5. com.sun.javafx
    RTImage.lambda$getPixelBuffer$2
    1. com.sun.javafx.webkit.prism.RTImage.lambda$getPixelBuffer$2(RTImage.java:163)
    1 frame
  6. Java RT
    FutureTask.runAndReset
    1. java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:514)
    2. java.util.concurrent.FutureTask.run(FutureTask.java:266)
    3. java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:514)
    4. java.util.concurrent.FutureTask.runAndReset(FutureTask.java:307)
    4 frames
  7. com.sun.javafx
    RenderJob.run
    1. com.sun.javafx.tk.RenderJob.run(RenderJob.java:58)
    1 frame
  8. Java RT
    ThreadPoolExecutor$Worker.run
    1. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1158)
    2. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:632)
    2 frames
  9. com.sun.javafx
    QuantumRenderer$PipelineRunnable.run
    1. com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
    1 frame
  10. Java RT
    Thread.run
    1. java.lang.Thread.run(Thread.java:804)
    1 frame