bndtools / bnd

Bnd/Bndtools. Tooling to build OSGi bundles including Eclipse, Maven, and Gradle plugins.
https://bndtools.org
Other
526 stars 304 forks source link

NPE in Add to -buildpath Quickfix #6096

Closed chrisrueger closed 2 months ago

chrisrueger commented 2 months ago

I am on Snapshot Bndtools 7.1.0.DEV-202404191120-gd2fc304 and just got this, which I haven't seen before.

  1. use the Quickfix for "Add to buildpath"
image
  1. I got this: image
java.lang.NullPointerException: Cannot invoke "java.io.File.toPath()" because "file" is null
    at aQute.lib.io.IO.stream(IO.java:1255)
    at aQute.bnd.build.model.BndEditModel.loadFrom(BndEditModel.java:436)
    at aQute.bnd.build.model.BndEditModel.load(BndEditModel.java:1543)
    at org.bndtools.core.editors.quickfix.AddBundleCompletionProposal.lambda$runInWorkspace$0(AddBundleCompletionProposal.java:107)
    at aQute.bnd.build.WorkspaceLock.locked(WorkspaceLock.java:168)
    at aQute.bnd.build.Workspace.readLocked(Workspace.java:1504)
    at org.bndtools.core.editors.quickfix.AddBundleCompletionProposal.runInWorkspace(AddBundleCompletionProposal.java:104)
    at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:43)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

The bnd.bnd is not updated anymore. I remember this used to work, as I use it quiete often.

Maybe related to the recent work on BndEditModel ? @pkriens

pkriens commented 2 months ago

Yes, my bad. Just pushed a PR

chrisrueger commented 2 months ago

@pkriens I can confirm this fixes the problem above. Quickfix is working again 👍