Uploaded image for project: 'Tools (JBoss Tools)'
  1. Tools (JBoss Tools)
  2. JBIDE-26548

Nullpointer when renaming inner class java variables - JSFRenameFieldParticipant

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 4.10.0.AM1
    • 4.21.1.AM1
    • jsf
    • None
    • Hide

      Maven multimodule project
      Open java class with inner class
      Right click Refactor - Rename (Shift+Alt+R) a variable of the inner java class

      Show
      Maven multimodule project Open java class with inner class Right click Refactor - Rename (Shift+Alt+R) a variable of the inner java class
    • -

    Description

      Renaming of inner class java variables leads to an Nullpointer in JSFRenameFieldParticipant. The second rename is working, since the JSFRenameFieldParticipant is removed due to the exception.

      !ENTRY org.eclipse.ltk.core.refactoring 4 10009 2019-02-07 08:02:57.183
      !MESSAGE Participant 'org.jboss.tools.jsf.model.handlers.bean.JSFRenameFieldParticipant' removed due to the following exception
      !STACK 0
      java.lang.NullPointerException
              at org.jboss.tools.jsf.model.pv.JSFProjectsTree.getProjectsRoot(JSFProjectsTree.java:45)
              at org.jboss.tools.jsf.model.handlers.bean.JSFRenameFieldHelper.getBeanList(JSFRenameFieldHelper.java:48)
              at org.jboss.tools.jsf.model.handlers.bean.JSFRenameFieldParticipant.createChange(JSFRenameFieldParticipant.java:68)
              at org.eclipse.ltk.core.refactoring.participants.ProcessorBasedRefactoring.createChange(ProcessorBasedRefactoring.java:309)
              at org.eclipse.jdt.internal.ui.refactoring.RefactoringExecutionHelper$Operation.run(RefactoringExecutionHelper.java:102)
              at org.eclipse.jdt.internal.core.BatchOperation.executeOperation(BatchOperation.java:41)
              at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:736)
              at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2295)
              at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2322)
              at org.eclipse.jdt.core.JavaCore.run(JavaCore.java:5810)
              at org.eclipse.jdt.internal.ui.actions.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:108)
              at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122)
      
      public class JavaClass {
        private boolean first; // rename will work
      
        public class InnerClass {
          private boolean second; // rename leads to NPE
        }
      }
      

      Attachments

        Activity

          People

            jmaury@redhat.com Jeff MAURY
            tza.at tom zauner
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: