Uploaded image for project: 'NetBeans'
  1. NetBeans
  2. NETBEANS-5709

[PHP] Cannot refactor (rename) method, cannot even right-click it

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • 12.3, 12.4
    • None
    • php - Refactoring
    • None
    • Windows 10, 20H2/21H1.

      Java 8/11.

    Description

      An unexpected exception error occurs every time I try to right-click a method's name in order to bring up the context menu. The same happens when simply pressing Ctrl+R (rename).

      This is the exception:

      java.lang.ClassNotFoundException: javax.lang.model.element.Element starting from ModuleCL@122f4698[org.netbeans.modules.refactoring.java] with possible defining loaders null and declared parents [ModuleCL@1895e026[org.netbeans.modules.java.source.base], ModuleCL@69e5af93[org.netbeans.modules.javahelp], org.netbeans.JarClassLoader@6aaf855b, ModuleCL@ed98ed3[org.netbeans.modules.java.project.ui], ModuleCL@4ff54bd7[org.netbeans.modules.java.source], ModuleCL@62025a33[org.netbeans.api.java], ModuleCL@3f154503[org.netbeans.libs.javacapi], ModuleCL@55f25c05[org.netbeans.modules.editor.lib2], ModuleCL@2db9ad3[org.netbeans.api.java.classpath], ModuleCL@22b0ff49[org.openide.windows], ...33 more]
      	at org.netbeans.ProxyClassLoader.doFindClass(ProxyClassLoader.java:215)
      	at org.netbeans.ProxyClassLoader.loadClass(ProxyClassLoader.java:125)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      Caused: java.lang.NoClassDefFoundError: javax/lang/model/element/Element
      	at org.netbeans.modules.refactoring.java.ui.RefactoringActionsProvider.canFindUsages(RefactoringActionsProvider.java:223)
      	at org.netbeans.modules.refactoring.api.impl.ActionsImplementationFactory.canFindUsages(ActionsImplementationFactory.java:75)
      	at org.netbeans.modules.refactoring.spi.impl.WhereUsedAction.enable(WhereUsedAction.java:67)
      	at org.netbeans.modules.refactoring.spi.impl.RefactoringGlobalAction$ContextAction.isEnabled(RefactoringGlobalAction.java:157)
      	at org.openide.awt.Actions$MenuBridge.updateState(Actions.java:1311)
      	at org.openide.awt.Actions$Bridge.addNotify(Actions.java:960)
      	at org.openide.awt.Actions$MenuBridge.prepare(Actions.java:1296)
      	at org.openide.awt.Actions.connect(Actions.java:197)
      	at org.openide.awt.Actions$MenuItem.<init>(Actions.java:1657)
      	at org.netbeans.modules.refactoring.spi.impl.RefactoringGlobalAction$ContextAction.getPopupPresenter(RefactoringGlobalAction.java:190)
      	at org.netbeans.modules.editor.NbEditorKit.createLocalizedMenuItem(NbEditorKit.java:338)
      	at org.netbeans.modules.editor.NbEditorKit.access$400(NbEditorKit.java:111)
      	at org.netbeans.modules.editor.NbEditorKit$NbBuildPopupMenuAction.addAction(NbEditorKit.java:749)
      	at org.netbeans.modules.editor.NbEditorKit$NbBuildPopupMenuAction.buildPopupMenu(NbEditorKit.java:725)
      	at org.netbeans.editor.ext.ExtKit$BuildPopupMenuAction.actionPerformed(ExtKit.java:254)
      	at org.netbeans.editor.BaseAction.actionPerformed(BaseAction.java:322)
      	at org.netbeans.spi.editor.AbstractEditorAction.actionPerformed(AbstractEditorAction.java:445)
      	at org.netbeans.editor.EditorUI.showPopupMenu(EditorUI.java:1792)
      	at org.netbeans.editor.EditorUI$7.run(EditorUI.java:1714)
      	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
      	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
      	at java.awt.EventQueue.access$500(EventQueue.java:97)
      	at java.awt.EventQueue$3.run(EventQueue.java:709)
      	at java.awt.EventQueue$3.run(EventQueue.java:703)
      	at java.security.AccessController.doPrivileged(Native Method)
      	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
      	at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
      	at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:136)
      [catch] at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
      	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
      	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
      	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
      	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
      	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
      

      The issue is 100% reproducible. It started to happen while using NetBeans 12.3 (but not since the beginning) and then when I have installed 12.4 it worked fine for a short period of time, then it started throwing the same error.

      It throws the error in any open project, even if I close/reopen them or restart NetBeans.

      Attachments

        Activity

          People

            Unassigned Unassigned
            zoli.szabo Zoli Szabó
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: