The loadIsComplete() 'wait' proxy method an unchecked cast from SearchContext to DetectsLoadCompletion. This presents the very real risk of triggering a ClassCastException by being invoked within a context that doesn't implement this interface. To resolve this, the implementation of the 'wait' proxy apply() method should ensure that the supplied context is instanceofDetectsLoadCompletion, If it's not, log a warning and return true to abort the load completion check gracefully.
The
loadIsComplete()
'wait' proxy method an unchecked cast from SearchContext to DetectsLoadCompletion. This presents the very real risk of triggering a ClassCastException by being invoked within a context that doesn't implement this interface. To resolve this, the implementation of the 'wait' proxyapply()
method should ensure that the supplied context isinstanceof
DetectsLoadCompletion, If it's not, log a warning and returntrue
to abort the load completion check gracefully.