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 during UCT inspection via action execution

See original GitHub issue

Describe the bug (*)

A clear and concise description of what the bug is.

java.lang.StringIndexOutOfBoundsException: begin 0, end 39, length 38
	at java.base/java.lang.String.checkBoundsBeginEnd(String.java:3319)
	at java.base/java.lang.String.substring(String.java:1874)
	at com.magento.idea.magento2uct.util.php.MagentoTypeEscapeUtil.escape(MagentoTypeEscapeUtil.java:35)
	at com.magento.idea.magento2uct.versioning.VersionStateManager.escapeFqn(VersionStateManager.java:186)
	at com.magento.idea.magento2uct.versioning.VersionStateManager.isDeprecated(VersionStateManager.java:62)
	at com.magento.idea.magento2uct.inspections.php.deprecation.CallingDeprecatedMethod.execute(CallingDeprecatedMethod.java:31)
	at com.magento.idea.magento2uct.inspections.php.CallMethodInspection$1.visitPhpMethodReference(CallMethodInspection.java:43)
	at com.jetbrains.php.lang.psi.elements.impl.MethodReferenceImpl.accept(MethodReferenceImpl.java:44)
	at com.jetbrains.php.lang.psi.elements.impl.PhpASTElementImpl.accept(PhpASTElementImpl.java:26)
	at com.magento.idea.magento2uct.inspections.UctInspectionManager.run(UctInspectionManager.java:69)
	at com.magento.idea.magento2uct.execution.GenerateUctReportCommand.lambda$execute$0(GenerateUctReportCommand.java:120)
	at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:828)
	at com.magento.idea.magento2uct.execution.GenerateUctReportCommand.lambda$execute$2(GenerateUctReportCommand.java:104)
	at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:265)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
	at java.base/java.lang.Thread.run(Thread.java:829)

To Reproduce (*)

Steps to reproduce the behavior:

  1. Go to ‘…’
  2. Click on ‘…’
  3. Scroll down to ‘…’
  4. See error

Expected behavior (*)

A clear and concise description of what you expected to happen.

Screenshots

If applicable, add screenshots to help explain your problem.

Please complete the following information: (*)

  • OS: Mac OS X 11.6
  • PhpStorm/Intellij version: 2021.2.2
  • Plugin Version: 4.2.0

Additional context

Add any other context about the problem here.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
karyna-tsymbal-atwixcommented, Dec 16, 2021

Hi @bohdan-harniuk , I re-checked with a 4.2.2 plugin version on the same project - everything is working fine. Thanks for the fix!

0reactions
bohdan-harniukcommented, Dec 16, 2021

Hi, @karyna-tsymbal-atwix!

Thank you for your assistance!

Read more comments on GitHub >

github_iconTop Results From Across the Web

StringIndexOutOfBoundsException on test failure · Issue #2077
I am not using the build cache, and the build is not parallel. The gradle wrapper version is 3.5. The failing test is...
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 >
What is a StringIndexOutOfBoundsException? How can I fix it?
IndexOutOfBoundsException is a subclass of RuntimeException mean it is an unchecked exception which is thrown to indicate that an index of some ...
Read more >
4.2.2 Release - magento/magento2-phpstorm-plugin Wiki
A StringIndexOutOfBoundsException during UCT inspection via action execution. A NullPointerException in the PluginDeclarationInspection.
Read more >
String index out of range: -16" in Power Center - Search
​The substring function in Java transformation gives a StringIndexOutOfBoundsException error while incorrect value is defined in one of its ...
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