phpStorm exception - java.lang.StringIndexOutOfBoundsException: String index out of range: 0
See original GitHub issueDescribe the bug (*)
PhpStorm Error Notification
java.lang.StringIndexOutOfBoundsException: String index out of range: 0
at java.base/java.lang.StringLatin1.charAt(StringLatin1.java:47)
at java.base/java.lang.String.charAt(String.java:693)
at com.magento.idea.magento2plugin.inspections.php.PluginInspection$1.getTargetMethodName(PluginInspection.java:323)
at com.magento.idea.magento2plugin.inspections.php.PluginInspection$1.visitPhpMethod(PluginInspection.java:93)
at com.jetbrains.php.lang.psi.elements.impl.MethodImpl.accept(MethodImpl.java:93)
at com.jetbrains.php.lang.psi.elements.impl.PhpPsiElementImpl.accept(PhpPsiElementImpl.java:73)
at com.intellij.codeInspection.InspectionEngine.acceptElements(InspectionEngine.java:65)
at com.intellij.codeInspection.InspectionEngine.createVisitorAndAcceptElements(InspectionEngine.java:56)
at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.runToolOnElements(LocalInspectionsPass.java:294)
at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.lambda$visitPriorityElementsAndInit$3(LocalInspectionsPass.java:263)
at com.intellij.util.AstLoadingFilter.forceAllowTreeLoading(AstLoadingFilter.java:155)
at com.intellij.util.AstLoadingFilter.forceAllowTreeLoading(AstLoadingFilter.java:147)
at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.lambda$visitPriorityElementsAndInit$4(LocalInspectionsPass.java:262)
at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:126)
at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:115)
at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.lambda$visitPriorityElementsAndInit$5(LocalInspectionsPass.java:262)
at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:149)
at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:162)
at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:162)
at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:162)
at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1110)
at com.intellij.concurrency.ApplierCompleter.lambda$wrapInReadActionAndIndicator$1(ApplierCompleter.java:105)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:629)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:581)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
at com.intellij.concurrency.ApplierCompleter.wrapInReadActionAndIndicator(ApplierCompleter.java:117)
at com.intellij.concurrency.ApplierCompleter.lambda$compute$0(ApplierCompleter.java:96)
at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:170)
at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:182)
at com.intellij.concurrency.ApplierCompleter.compute(ApplierCompleter.java:96)
at java.base/java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:746)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
To Reproduce (*)
Steps to reproduce the behavior:
- There is not specific conditions for reproduce this issue.
Expected behavior (*)
Works without any errors)
Screenshots
Please complete the following information: (*)
- OS: Ubuntu 20.04.1 LTS
- PhpStorm 2020.2.2 Build #PS-202.7319.77, built on September 23, 2020
- Plugin Version - 1.0.1
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
java.lang.StringIndexOutOfBoundsException: String index out ...
It seems pretty clear why you would get an index out of bounds exception, seeing as when i is length - 1, j...
Read more >String index out of range: -287 : SCL-964 - YouTrack - JetBrains
java.lang.StringIndexOutOfBoundsException: String index out of range: -287 ; Project, Scala ; Subsystem, No Subsystem ; Type, Exception ; Priority, Normal N.
Read more >STRING INDEX OUT OF RANGE: 0 AT TEST GENERATION
ACTUAL BEHAVIOR : The test generation fails with an exception of type : ava.lang.StringIndexOutOfBoundsException: String index out of range: 0 at java.lang.
Read more >StringIndexOutOfBoundsException: String index out of range ...
The following code below leads to throwing "java.lang.StringIndexOutOfBoundsException: String index out of range: 0" JDK7 b70 - PASSES JDK7 b73 - FAILS JDK7 ......
Read more >String index out of range: 0” when workflow engine is not ...
ERROR : “java.lang.StringIndexOutOfBoundsException: String index out of range: 0” when workflow engine is not starting in 10.1.1 ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hello!
It is already fixed in the scope of #798. The fix will be delivered in the next bug-fix release (4.2.1).
cc. @gnysek, @VitaliyBoyko, @phpWebStudio.
Thanks, Bohdan
I’m also getting
com.magento.idea.magento2plugin.actions.CopyMagentoPath.getIndexOf(CopyMagentoPath.java:82)
, Phpstorm 2021.2 (newest, even if integration isn’t enabled for current project)