Skip to content

ArrayIndexOutOfBoundsException when used Copy Path/Reference action on the requirejs-config.js file #798

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
fascinosum opened this issue Nov 23, 2021 · 1 comment · Fixed by #808
Assignees
Labels
bug Priority: P1 Needs to be fixed before any other issues release-4.2.1 reproduced

Comments

@fascinosum
Copy link

Describe the bug (*)

A clear and concise description of what the bug is.

java.lang.ArrayIndexOutOfBoundsException: Index 4 out of bounds for length 4
	at com.magento.idea.magento2plugin.actions.CopyMagentoPath.getIndexOf(CopyMagentoPath.java:103)
	at com.magento.idea.magento2plugin.actions.CopyMagentoPath.getIndexOf(CopyMagentoPath.java:103)
	at com.magento.idea.magento2plugin.actions.CopyMagentoPath.getIndexOf(CopyMagentoPath.java:103)
	at com.magento.idea.magento2plugin.actions.CopyMagentoPath.getIndexOf(CopyMagentoPath.java:103)
	at com.magento.idea.magento2plugin.actions.CopyMagentoPath.getPathToElement(CopyMagentoPath.java:93)
	at com.intellij.ide.actions.CopyPathProvider.getQualifiedName(CopyPathProvider.kt:71)
	at com.intellij.ide.actions.CopyReferencePopup$1$1.customizeComponent(CopyReferencePopup.java:94)
	at com.intellij.ide.actions.CopyReferencePopup$1$1.customizeComponent(CopyReferencePopup.java:50)
	at com.intellij.ui.popup.list.GroupedItemsListRenderer.getListCellRendererComponent(GroupedItemsListRenderer.java:57)
	at com.intellij.ui.ExpandedItemListCellRendererWrapper.getListCellRendererComponent(ExpandedItemListCellRendererWrapper.java:24)
	at com.intellij.ui.components.WideSelectionListUI.updateLayoutState(WideSelectionListUI.java:197)
	at java.desktop/javax.swing.plaf.basic.BasicListUI.maybeUpdateLayoutState(BasicListUI.java:1389)
	at java.desktop/javax.swing.plaf.basic.BasicListUI.getPreferredSize(BasicListUI.java:648)
	at java.desktop/javax.swing.JComponent.getPreferredSize(JComponent.java:1683)
	at com.intellij.ui.components.JBList.getPreferredSize(JBList.java:182)
	at com.intellij.ui.components.JBViewport.getPreferredSizeWithoutScrollBars(JBViewport.java:527)
	at com.intellij.ui.components.JBViewport.getPreferredScrollableViewportSize(JBViewport.java:546)
	at com.intellij.ui.components.JBViewport.getPreferredScrollableViewportSize(JBViewport.java:519)
	at com.intellij.ui.components.JBViewport$1.preferredLayoutSize(JBViewport.java:66)
	at java.desktop/java.awt.Container.preferredSize(Container.java:1823)
	at java.desktop/java.awt.Container.getPreferredSize(Container.java:1807)
	at java.desktop/javax.swing.JComponent.getPreferredSize(JComponent.java:1685)
	at com.intellij.ui.components.JBScrollPane$Layout.preferredLayoutSize(JBScrollPane.java:801)
	at java.desktop/java.awt.Container.preferredSize(Container.java:1823)
	at java.desktop/java.awt.Container.getPreferredSize(Container.java:1807)
	at java.desktop/javax.swing.JComponent.getPreferredSize(JComponent.java:1685)
	at java.desktop/java.awt.BorderLayout.preferredLayoutSize(BorderLayout.java:724)
	at java.desktop/java.awt.Container.preferredSize(Container.java:1823)
	at java.desktop/java.awt.Container.getPreferredSize(Container.java:1807)
	at java.desktop/javax.swing.JComponent.getPreferredSize(JComponent.java:1685)
	at com.intellij.ui.popup.WizardPopup$MyContainer.getPreferredSize(WizardPopup.java:322)
	at com.intellij.ui.popup.AbstractPopup.getSizeForPositioning(AbstractPopup.java:587)
	at com.intellij.ui.popup.AbstractPopup.relativePointByQuickSearch(AbstractPopup.java:573)
	at com.intellij.ui.popup.AbstractPopup.showInBestPositionFor(AbstractPopup.java:522)
	at com.intellij.ide.actions.CopyReferencePopup.actionPerformed(CopyReferencePopup.java:130)
	at com.intellij.openapi.actionSystem.ex.ActionUtil.lambda$performActionDumbAwareWithCallbacks$4(ActionUtil.java:240)
	at com.intellij.openapi.actionSystem.ex.ActionUtil.performDumbAwareWithCallbacks(ActionUtil.java:261)
	at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAwareWithCallbacks(ActionUtil.java:240)
	at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.lambda$actionPerformed$0(ActionMenuItem.java:248)
	at com.intellij.openapi.wm.impl.FocusManagerImpl.runOnOwnContext(FocusManagerImpl.java:236)
	at com.intellij.openapi.wm.impl.IdeFocusManagerImpl.runOnOwnContext(IdeFocusManagerImpl.java:67)
	at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.actionPerformed(ActionMenuItem.java:240)
	at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1967)
	at com.intellij.openapi.actionSystem.impl.ActionMenuItem.lambda$fireActionPerformed$0(ActionMenuItem.java:90)
	at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:94)
	at com.intellij.openapi.actionSystem.impl.ActionMenuItem.fireActionPerformed(ActionMenuItem.java:90)
	at com.intellij.ui.plaf.beg.BegMenuItemUI.doClick(BegMenuItemUI.java:515)
	at com.intellij.ui.plaf.beg.BegMenuItemUI$MyMouseInputHandler.mouseReleased(BegMenuItemUI.java:545)
	at java.desktop/java.awt.Component.processMouseEvent(Component.java:6652)
	at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3345)
	at java.desktop/java.awt.Component.processEvent(Component.java:6417)
	at java.desktop/java.awt.Container.processEvent(Container.java:2263)
	at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5027)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4859)
	at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918)
	at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4547)
	at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307)
	at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2784)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4859)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:778)
	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.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:751)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:749)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSec

To Reproduce (*)

Steps to reproduce the behavior:

  1. Magento OS git installation
  2. Open app/code/Magento/Theme/view/base/requirejs-config.js
  3. Right click on the file -> Copy Path/Reference
  4. See error

Expected behavior (*)

Path copied

Screenshots

Please complete the following information: (*)

  • OS: Mac OS X 11.6
  • PhpStorm/Intellij version: 2021.2.3
  • Plugin Version: 4.1.0

Additional context

@bohdan-harniuk
Copy link
Collaborator

Hello, @fascinosum!

Thank you for your report!
We'll try to deliver fix in the next bug release.

Thanks, Bohdan

@bohdan-harniuk bohdan-harniuk removed their assignment Nov 25, 2021
@bohdan-harniuk bohdan-harniuk added next release Priority: P1 Needs to be fixed before any other issues labels Nov 25, 2021
@bohdan-harniuk bohdan-harniuk self-assigned this Nov 25, 2021
@bohdan-harniuk bohdan-harniuk changed the title Bug Report 2021/11/23 ArrayIndexOutOfBoundsException when used Copy Path/Reference action on the requirejs-config.js file Nov 25, 2021
@bohdan-harniuk bohdan-harniuk linked a pull request Nov 25, 2021 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Priority: P1 Needs to be fixed before any other issues release-4.2.1 reproduced
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants