Skip to content

NamedFactory uses wrong filter expression #582

@tomaswolf

Description

@tomaswolf

Version

2.14.0-SNAPSHOT

Bug description

Split off from #525:

The implementations of NamedFactory.setupBuiltinFactories() and NamedFactory.setupTransformedFactories() use incorrect filter expressions to filter out algorithms not supported by the platform.

They use the expression ignoreUnsupported || f.isSupported() and expect that to be true for supported factories, and false for unsupported ones.

However, that is not correct. The parameter ignoreUnsupported actually implements the semantics of "include unsupported".

This needs to be fixed. The correct expression would be ignoreUnsupported ? f.isSupported() : true, or !ignoreUnsupported || f.isSupported().

This bug exists in the code since 2015.

Actual behavior

NamedFactory.setupBuiltinFactories(true, ...) includes factories for unsupported algorithms in the returned list.

Expected behavior

NamedFactory.setupBuiltinFactories(true, ...) includes only factories for supported algorithms in the returned list.

Relevant log output

No response

Other information

No response

Metadata

Metadata

Assignees

Labels

bugAn issue describing a bug in the code

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions