netbeans icon indicating copy to clipboard operation
netbeans copied to clipboard

Gradle build actions NPE and visually inaccurate state

Open errael opened this issue 2 years ago • 3 comments

Apache NetBeans version

Apache NetBeans 15

What happened

NPE and inconsistent visual state

How to reproduce

gradle projects are created with NewProject > JavaWithGradle > JavaClassLibrary

Get to this dialog with GradleProject > properties > Build > BuildActions

First note that although nothing is selected in the ConfiguredActions list, both the Disable and Reset buttons are enabled. Note that when this first comes up is the only time the configuration details shows up without a ConfiguredActions selection. If you select an action, then deselect, CTRL click, you will see No Selected Action. I like seeing the details area when it first comes up to get an idea of what you can do with an action. But if only came up when something was selected, then there would be no issue with the Reset button.

  • When it first comes up, the Reset button is enabled. Click it and there is an NPE in the NB log.

The rest of this is about stuff that seems/looks wrong, but I'm not familiar enough with this dialog to be certain. For example, what does boldface mean in Configured Actions list? Should some actions start in a disabled state or is there a reason that Restore doesn't restore?

  • Boldface in Configured Actions list inconsistent
    1. Open Build Actions dialog
    2. In Override in Configuration combo select Continuous Mode
    3. In Configure Action combo select build
    4. In Configure Action combo select debug
    5. Observe, debug is in boldface
    6. click OK to close dialog
    7. Re-open Build Actions dialog
    8. In Override in Configuration combo select Continuous Mode
    9. Observe that debug is not boldface

Starting with fresh project

  • Disable button and related (first 4 steps same as previous)
    1. Open Build Actions dialog
    2. In Override in Configuration combo select Continuous Mode
    3. In Configure Action combo select build
    4. In Configure Action combo select debug
    5. Select build, Disable
    6. Select debug, Disable
    7. Select build, Restore
    8. Select debug, Restore
    9. Observe, debug is not Restored
    10. With debug still selected, click Reset
    11. Again, in Configure Action combo select debug
    12. Observe that debug is enabled.
    13. Again select debug, Disable
    14. OK/close Dialog
    15. Re-open dialog
    16. In Override in Configuration combo select Continuous Mode
    17. Select debug, click Reset
    18. Again, in Configure Action combo select debug
    19. Observe that debug is still disabled after reset 12 and 19 are inconsistent.

Following doesn't really belong in this report

  • Start with fresh project
    1. Open subproject lib
    2. Right click subproject lib
    3. Select Delete
    4. Click also delete source
    5. Click Yes
    6. Observe that the dialog doesn't go away.
    7. Observe takes exactly 1 minute for the dialog to go away

Did this work correctly in an earlier version?

No / Don't know

Operating System

Linux harmony 5.19.0-76051900-generic #202207312230~1660780566~22.04~9d60db1

JDK

openjdk version "11.0.2" 2019-01-15

Apache NetBeans packaging

Own source build

Anything else

No response

Are you willing to submit a pull request?

No

Code of Conduct

Yes

errael avatar Sep 29 '22 21:09 errael

Fix for the NPE in #4703 .

@lkishalmi , @sdedic Since I'm not sure what is proper behavior... Even the NPE fix could be handled differently by coming up with "nothing selected".

errael avatar Sep 29 '22 22:09 errael

@mbien , can this be reopened? The "NPE" is fixed but the "visually inaccurate state" is pending; need some feedback on what is proper behavior. The opening comment outlines some inconsistencies in the dialog, and I'm not sure what it's supposed to do.

errael avatar Oct 02 '22 01:10 errael

sure

mbien avatar Oct 02 '22 01:10 mbien