question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] StringIndexOutOfBoundsException that occurred in the PhpPsiElementsUtil.getElementUnderCursor

See original GitHub issue

Describe the bug (*)

A clear and concise description of what the bug is.

java.lang.StringIndexOutOfBoundsException: offset 1842,length 944
	at java.base/java.lang.String.checkOffset(String.java:3289)
	at java.base/java.lang.AbstractStringBuilder.insert(AbstractStringBuilder.java:1117)
	at java.base/java.lang.StringBuilder.insert(StringBuilder.java:331)
	at com.intellij.psi.templateLanguages.RangeCollectorImpl.insertDummyStringIntoInsertionRanges(RangeCollectorImpl.java:137)
	at com.intellij.psi.templateLanguages.RangeCollectorImpl.applyRangeCollectorAndExpandChameleon(RangeCollectorImpl.java:384)
	at com.intellij.psi.templateLanguages.TemplateDataElementType.parseWithOuterAndRemoveRangesApplied(TemplateDataElementType.java:315)
	at com.intellij.lang.javascript.types.JSEmbeddedContentElementType.parseContents(JSEmbeddedContentElementType.java:105)
	at com.intellij.psi.impl.source.tree.LazyParseableElement.lambda$ensureParsed$2(LazyParseableElement.java:175)
	at com.intellij.psi.impl.DebugUtil.performPsiModification(DebugUtil.java:481)
	at com.intellij.psi.impl.source.tree.LazyParseableElement.ensureParsed(LazyParseableElement.java:174)
	at com.intellij.psi.impl.source.tree.LazyParseableElement.getFirstChildNode(LazyParseableElement.java:226)
	at com.intellij.psi.impl.source.tree.CompositeElement.findLeafElementAt(CompositeElement.java:126)
	at com.intellij.psi.impl.source.tree.CompositeElement.findLeafElementAt(CompositeElement.java:33)
	at com.intellij.psi.AbstractFileViewProvider.findElementAt(AbstractFileViewProvider.java:246)
	at com.intellij.psi.MultiplePsiFilesPerDocumentFileViewProvider.findElementAt(MultiplePsiFilesPerDocumentFileViewProvider.java:162)
	at com.intellij.psi.MultiplePsiFilesPerDocumentFileViewProvider.findElementAt(MultiplePsiFilesPerDocumentFileViewProvider.java:174)
	at com.intellij.psi.impl.source.PsiFileImpl.findElementAt(PsiFileImpl.java:523)
	at com.magento.idea.magento2plugin.util.php.PhpPsiElementsUtil.getElementUnderCursor(PhpPsiElementsUtil.java:93)
	at com.magento.idea.magento2plugin.util.php.PhpPsiElementsUtil.getPhpMethod(PhpPsiElementsUtil.java:45)
	at com.magento.idea.magento2plugin.actions.generation.NewWebApiDeclarationAction.update(NewWebApiDeclarationAction.java:39)
	at com.intellij.openapi.actionSystem.ex.ActionUtil.lambda$performDumbAwareUpdate$0(ActionUtil.java:130)
	at com.intellij.openapi.actionSystem.ex.ActionUtil.performDumbAwareUpdate(ActionUtil.java:144)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater.doUpdate(ActionUpdater.java:592)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$updateActionReal$7(ActionUpdater.java:132)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$callAction$9(ActionUpdater.java:187)
	at com.intellij.openapi.progress.ProgressManager.lambda$runProcess$0(ProgressManager.java:57)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:183)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:705)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:647)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:63)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:170)
	at com.intellij.openapi.progress.ProgressManager.runProcess(ProgressManager.java:57)
	at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$callAction$10(ActionUpdater.java:185)
	at com.intellij.openapi.actionSystem.impl.ActionUpdateEdtExecutor.lambda$computeOnEdt$0(ActionUpdateEdtExecutor.java:45)
	at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:199)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:794)
	at com.intellij.openapi.application.impl.ApplicationImpl.lambda$invokeLater$4(ApplicationImpl.java:350)
	at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:84)
	at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:133)
	at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:46)
	at com.intellij.openapi.application.impl.FlushQueue$FlushNow.run(FlushQueue.java:189)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:885)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:754)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:441)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:825)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:440)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:794)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:486)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

Please complete the following information: (*)

  • OS: Windows 10 10.0
  • PhpStorm/Intellij version: 2021.2.3
  • Plugin Version: 4.1.0

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
bohdan-harniukcommented, Feb 1, 2022

Hello, @Mr-Leonerrr!

Thank you for checking it!

Regards,

1reaction
Mr-Leonerrrcommented, Jan 24, 2022

Hello, @bohdan-harniuk!

The error has not appeared anymore, so I have not been able to reproduce it again, it used to happen with any project I was working on, but apparently it has been resolved.

Read more comments on GitHub >

github_iconTop Results From Across the Web

java.lang.StringIndexOutOfBoundsException error occurs ...
StringIndexOutOfBoundsException error occurs when trying to run Content Engine Bulk Import (CEBI). Troubleshooting. Problem. Running Content ...
Read more >
What is a StringIndexOutOfBoundsException? How can I fix it?
Error Description There is an IndexOutOfBound exception occurred in your MainActivity class Inside second inner class's OnResponse function ...
Read more >
How to Handle String Index Out Of Bounds Exception in Java
The StringOutOfBoundsException in Java that occurs when accessing a string at an index which is negative/greater than the string length.
Read more >
Funcotator error: StringIndexOutOfBoundsException - GATK
When someone tries to access the characters with limits exceeding the range of actual string value, this exception occurs. A subset of the ......
Read more >
java.lang.StringIndexOutOfBoundsException: String index out ...
39] ERROR org.grails.web.errors.GrailsExceptionResolver - StringIndexOutOfBoundsException occurred when processing request: [GET] /scripts/.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found