You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
Also give the methods some javadoc.
Note that "ignoreUnsupported ? f.isSupported : true" is the same as
"!ignoreUnsupported || f.isSupported()", but I find the former easier
to read and understand.
Bug: apache#582
Version
2.14.0-SNAPSHOT
Bug description
Split off from #525:
The implementations of
NamedFactory.setupBuiltinFactories()
andNamedFactory.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 betrue
for supported factories, andfalse
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
The text was updated successfully, but these errors were encountered: