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

NPE in "compile file" in gradle project

Rank to TopRank to BottomVotersWatch issueWatchersConvert to sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

      Description

      I get a NPE when I press F9 for "compile file" in a gradle project.

      java.lang.NullPointerException
          at org.netbeans.modules.gradle.java.GradleJavaTokenProvider.evaluateSingleMethod(GradleJavaTokenProvider.java:158)
          at org.netbeans.modules.gradle.java.GradleJavaTokenProvider.processSelectedMethod(GradleJavaTokenProvider.java:104)
          at org.netbeans.modules.gradle.java.GradleJavaTokenProvider.createReplacements(GradleJavaTokenProvider.java:80)
          at org.netbeans.modules.gradle.actions.ReplaceTokenProviderMerger.createReplacements(ReplaceTokenProviderMerger.java:72)
          at org.netbeans.modules.gradle.ActionProviderImpl.replaceTokens(ActionProviderImpl.java:532)
          at org.netbeans.modules.gradle.ActionProviderImpl.evalueteArgs(ActionProviderImpl.java:299)
          at org.netbeans.modules.gradle.ActionProviderImpl.invokeProjectAction(ActionProviderImpl.java:200)
          at org.netbeans.modules.gradle.ActionProviderImpl.invokeAction(ActionProviderImpl.java:128)
          at org.netbeans.modules.project.ui.actions.FileAction$3$1.run(FileAction.java:219)
          at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
          at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:764)
          at java.desktop/java.awt.EventQueue.access$500(EventQueue.java:97)
          at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:717)
          at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:711)
          at java.base/java.security.AccessController.doPrivileged(Native Method)
          at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:89)
          at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:734)
          at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:136)
      [catch] at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:199)
          at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
          at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
          at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
          at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
          at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

      I have a problem with the new gradle support. I tried to press F9 for "compile File" in a gradle project. The reason why I would like to have support for compiling a single file is, because I'm using https://immutables.github.io/ which is a annotation processor for generating implementations and builders for an interface. So it is necessary to compile the interface, for getting the builder.

      With to other plugin for gradle it was possible, to "compile on save". The new official gradle support don't support this feature and I found an issue (NETBEANS-680), which implies, that this feature maybe never be supported. I can live with that, but I would love to have a shortcut for triggering the compilation task.

      My current workaround is clicking on the project and select the task from the navigator. This feels very uncomfortable.

        Attachments

          Activity

          $i18n.getText('security.level.explanation', $currentSelection) Viewable by All Users
          Cancel

            People

            • Assignee:
              lkishalmi Laszlo Kishalmi
              Reporter:
              andreas.eberhoefer Andreas Eberhöfer

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 20m
                20m

                  Issue deployment