JDK-8098064 : Exceptions by Invalidation- or ChangeListeners are not caught
  • Type: Enhancement
  • Component: javafx
  • Sub-Component: base
  • Affected Version: 8
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2013-10-17
  • Updated: 2015-06-12
  • Resolved: 2014-02-25
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8u20Fixed
Related Reports
Blocks :  
Relates :  
Description
Currently, if an InvalidationListener or ChangeListener throws an exception during notification, that exception is not caught within the notification loop, and will fall back to the change or invalidation. In particular, other added, following listeners get no notification. Please catch potential exceptions for each single notification call, such that a failure affects no other listeners or the undelying change or invalidation call.
Comments
Changeset: http://hg.openjdk.java.net/openjfx/8u-dev/rt/rev/c3a273e2382a Unit tests: ExpressionHelperTest#testExceptionNotPropagatedFromSingleInvalidation ExpressionHelperTest#testExceptionNotPropagatedFromMultipleInvalidation ExpressionHelperTest#testExceptionNotPropagatedFromSingleChange ExpressionHelperTest#testExceptionNotPropagatedFromMultipleChange ExpressionHelperTest#testExceptionNotPropagatedFromMultipleChangeAndInvalidation ListListenerHelperTest#testExceptionNotPropagatedFromSingleInvalidation ListListenerHelperTest#testExceptionNotPropagatedFromMultipleInvalidation ListListenerHelperTest#testExceptionNotPropagatedFromSingleChange ListListenerHelperTest#testExceptionNotPropagatedFromMultipleChange ListListenerHelperTest#testExceptionNotPropagatedFromMultipleChangeAndInvalidation SetListenerHelperTest#testExceptionNotPropagatedFromSingleInvalidation SetListenerHelperTest#testExceptionNotPropagatedFromMultipleInvalidation SetListenerHelperTest#testExceptionNotPropagatedFromSingleChange SetListenerHelperTest#testExceptionNotPropagatedFromMultipleChange SetListenerHelperTest#testExceptionNotPropagatedFromMultipleChangeAndInvalidation MapListenerHelperTest#testExceptionNotPropagatedFromSingleInvalidation MapListenerHelperTest#testExceptionNotPropagatedFromMultipleInvalidation MapListenerHelperTest#testExceptionNotPropagatedFromSingleChange MapListenerHelperTest#testExceptionNotPropagatedFromMultipleChange MapListenerHelperTest#testExceptionNotPropagatedFromMultipleChangeAndInvalidation
25-02-2014

According to the documentation, that should be called "when a Thread abruptly terminates due to an uncaught exception", which it does not. Such handler could assume that the thread is going to be terminated, which would not happen however.
25-02-2014

I think the Thread.uncaughtExceptionHandler should be called, so that applications have a chance to detect and handle the errors.
24-02-2014

Webrev: http://cr.openjdk.java.net/~msladecek/rt-33633/webrev.00/ If anybody is interested in the change, you can look at the change in webrev. I'm going to push this after M2.
24-02-2014