From 560ded50127b12bd8168f8ae2bada47253f15bc8 Mon Sep 17 00:00:00 2001
From: Reinier Zwitserloot new SomeException(message, null)
will initialize
the cause to be no cause, and this cannot be later changed by invoking initCause
. However, lombok's
standard exceptions do let you overwrite an explicit no-cause with initCause
later.
+
+ A second slight functional difference: Normally, invoking new SomeException(cause)
, if implemented as super(cause);
, will set the message to be equal to the message of the cause. However, lombok does not do this - it leaves the exception as having no message at all. We think inheriting the message is fundamentally wrong - messages are not guaranteed to be sensible in the absence of the context of the exception-type. The cause ought to be listed anywhere where it is relevant; if you are using messages as direct user feedback (which is rare, in the java community), @StandardException
can't really help you anyway; the infrastructure of e.g. getLocalizedMessage()
is too complicated.