Skip to content

Commit

Permalink
setIncludeResource used removeAll
Browse files Browse the repository at this point in the history
Somehow the author got an immutable list in the BndEditModel. The BndEditoModel was not
designed for this and this will generally cause problems. The method is not used
anywhere in the code base so I'v deprecated it. I also made a copy of the list used
in removeAll to prevent this.
This code sucks but so are many things. If you start to use the API, the onus on you is
to just provide a PR and get it over with.

---
 Signed-off-by: Peter Kriens <[email protected]>

Signed-off-by: Peter Kriens <[email protected]>
  • Loading branch information
pkriens committed Dec 4, 2023
1 parent 504aebd commit 618a0b3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion biz.aQute.bndlib/src/aQute/bnd/build/model/BndEditModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -1190,8 +1190,10 @@ public List<String> getIncludeResource() {
.collect(toList());
}

@Deprecated
public void setIncludeResource(List<String> newEntries) {
List<String> resourceEntries1 = getEntries(Constants.INCLUDERESOURCE, listConverter);
List<String> resourceEntries1 = getEntries(Constants.INCLUDERESOURCE, listConverter).stream()
.toList();
List<String> resourceEntries2 = getEntries(Constants.INCLUDE_RESOURCE, listConverter);

Set<String> resourceEntries = Stream.concat(resourceEntries1.stream(), resourceEntries2.stream())
Expand Down

0 comments on commit 618a0b3

Please sign in to comment.