Hi Benedikt,

Benedikt Ritter wrote:

> I have reverted the commit and commented why we use an anonymous subclass
> of DefaultExpectionContext. But to be honest I don't really see the point.
> Since the signature of the constructor is
> 
> public ContextedRuntimeException(final String message, final Throwable
> cause, ExceptionContext context)
> 
> every class that implements ExceptionContext can be passed in. Surely all
> subclasses of DefaultExceptionContext implement ExceptionContext. This is
> just how the language works...
> 
> What am I missing here?

The constructor code does:

if (expectionContext == null) {
  exceptionContext = new DefaultExceptionContext();
}

Therefore the difference of passing "null" or "new 
DefaultExceptionContext()" is moot ... however passing "null" is tested 
implicitly by all other constructors.

Basically I admit, that the test could really be improved to show that the 
implementation can use an arbitrary ExceptionContext implementation (e.g. by 
using a mock), but that's currently all we have ;-)

Cheers,
Jörg


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org

Reply via email to