magento / magento2-phpstorm-plugin

PHPStorm Plugin for Magento 2
Open Software License 3.0
435 stars 102 forks source link

Exception "The method designed for fully qualified names only" #630

Closed DmitryFurs closed 2 years ago

DmitryFurs commented 3 years ago

Describe the bug

For an unknown reason, an exception has appeared

java.lang.Throwable: The method designed for fully qualified names only. Got "null|string".
    at com.intellij.openapi.diagnostic.Logger.error(Logger.java:182)
    at com.jetbrains.php.util.PhpContractUtil.assertFqn(PhpContractUtil.java:19)
    at com.jetbrains.php.codeInsight.PhpCodeInsightUtil.isSameNamespace(PhpCodeInsightUtil.java:1629)
    at com.magento.idea.magento2plugin.actions.generation.references.PhpClassReferenceResolver.alreadyImported(PhpClassReferenceResolver.java:98)
    at com.magento.idea.magento2plugin.actions.generation.references.PhpClassReferenceResolver.importWithConflictResolve(PhpClassReferenceResolver.java:135)
    at com.magento.idea.magento2plugin.actions.generation.references.PhpClassReferenceResolver.importReferences(PhpClassReferenceResolver.java:68)
    at com.magento.idea.magento2plugin.actions.generation.generator.PluginClassGenerator.lambda$generate$0(PluginClassGenerator.java:182)
    at com.intellij.openapi.command.WriteCommandAction.lambda$runWriteCommandAction$4(WriteCommandAction.java:348)
    at com.intellij.openapi.command.WriteCommandAction$BuilderImpl.lambda$doRunWriteCommandAction$1(WriteCommandAction.java:143)
    at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:936)
    at com.intellij.openapi.command.WriteCommandAction$BuilderImpl.lambda$doRunWriteCommandAction$2(WriteCommandAction.java:141)
    at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:216)
    at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:182)
    at com.intellij.openapi.command.WriteCommandAction$BuilderImpl.doRunWriteCommandAction(WriteCommandAction.java:150)
    at com.intellij.openapi.command.WriteCommandAction$BuilderImpl.run(WriteCommandAction.java:117)
    at com.intellij.openapi.command.WriteCommandAction.runWriteCommandAction(WriteCommandAction.java:348)
    at com.intellij.openapi.command.WriteCommandAction.runWriteCommandAction(WriteCommandAction.java:336)
    at com.magento.idea.magento2plugin.actions.generation.generator.PluginClassGenerator.generate(PluginClassGenerator.java:94)
    at com.magento.idea.magento2plugin.actions.generation.generator.FileGenerator.generate(FileGenerator.java:41)
    at com.magento.idea.magento2plugin.actions.generation.dialog.CreateAPluginDialog.onOK(CreateAPluginDialog.java:172)
    at com.magento.idea.magento2plugin.actions.generation.dialog.CreateAPluginDialog.lambda$new$0(CreateAPluginDialog.java:127)
    at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1967)
    at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2308)
    at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405)
    at java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262)
    at java.desktop/javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:270)
    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$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
    at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:748)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:887)
    at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.java:816)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:753)
    at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:443)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:825)
    at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:442)
    at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:794)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:494)
    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.pumpEventsForFilter(EventDispatchThread.java:117)
    at java.desktop/java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:190)
    at java.desktop/java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:235)
    at java.desktop/java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:233)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.desktop/java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:233)
    at java.desktop/java.awt.Dialog.show(Dialog.java:1063)
    at java.desktop/java.awt.Com

Expected behavior (*)

No exceptions in the error reports section.

Please complete the following information: (*)

m2-assistant[bot] commented 3 years ago

Hi @DmitryFurs. Thank you for your report. To help us process this issue please make sure that you provided sufficient information.

Please, add a comment to assign the issue: @magento I am working on this


bohdan-harniuk commented 2 years ago

Hello, @DmitryFurs !

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

Thank you!

bohdan-harniuk commented 2 years ago

Hello, @DmitryFurs!

Could you please provide method's code for which you tried to generate plugin (before, after or around)? I need to reproduce this bug before fixing it. It is not clear for me for now, how to do this.

Thank you in advance!

DmitryFurs commented 2 years ago

Hello, @bohdan-harniuk!

The steps are unknown, but if you try to create before plugin for this method \Magento\Framework\App\Config\MutableScopeConfigInterface::setValue() you will get the following result image

And if you try to create after plugin for this method \Magento\Catalog\Model\ResourceModel\Category::getParentCategories() you will get the following result image

bohdan-harniuk commented 2 years ago

@DmitryFurs, thank you a lot! It is exactly what I need to find the reason and fix it!

bohdan-harniuk commented 2 years ago

Hello, @DmitryFurs!

This issue is resolved and will be delivered in the next bug-fix release: 4.2.1.

Thank you for your help!