Skip to content

Commit

Permalink
cleanup(perception): moved inspection disabling to statement
Browse files Browse the repository at this point in the history
Signed-off-by: Moritz Schweppenhäuser <[email protected]>
  • Loading branch information
schwepmo committed Dec 6, 2024
1 parent ed3050c commit 1843b81
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@ public List<SpatialObject<?>> getPerceivedObjects() {
*/
abstract List<SpatialObject<?>> getObjectsInRange();

@SuppressWarnings("unchecked") // copy-method assures correct typing
private <T extends SpatialObject<?>> List<T> applyPerceptionModifiers(List<T> objectsInRange) {
List<T> filteredList = new ArrayList<>(objectsInRange);
// create a copy of all perceived objects to avoid interference with modifiers of other perception modules.
//noinspection unchecked
filteredList.replaceAll(object -> (T) object.copy());
for (PerceptionModifier perceptionModifier : configuration.getPerceptionModifiers()) {
filteredList = perceptionModifier.apply(owner, filteredList); // apply filters in sequence
Expand Down

0 comments on commit 1843b81

Please sign in to comment.