Open GoogleCodeExporter opened 8 years ago
What's your use case? I don't recall ever having implemented `equals` for an
exception type, and neither do the exception types in the JDK.
Original comment by pnied...@gmail.com
on 16 Oct 2012 at 9:49
Or, I should say, I don't typically implement `equals` for exception types,
even though I quite often make them hold state other than just a message.
Original comment by pnied...@gmail.com
on 16 Oct 2012 at 9:52
My use case is to save one line of test code. Here's my test:
when:
def results = new ResolverResults(resolvedConfiguration, fatalFailure)
then:
results.resolvedConfiguration
when:
results.resolutionResult
then:
def ex = thrown(ResolveException)
ex == fatalFailure
Feel free to discard this request if you don't like it :)
Original comment by szcze...@gmail.com
on 16 Oct 2012 at 10:11
Oh, you want to check for identity, on purpose? I'm afraid people might think
they can somehow compare exceptions for equality.
Original comment by pnied...@gmail.com
on 16 Oct 2012 at 10:48
I would expect it to compare for equality. Anyhow - up to you - feel free to
discard :)
Original comment by szcze...@gmail.com
on 16 Oct 2012 at 3:23
I would expect it to compare for equality. Anyhow - up to you - feel free to
discard :)
Original comment by szcze...@gmail.com
on 16 Oct 2012 at 3:23
Sure, but since exceptions almost never implement `equals()`, it boils down to
an identity check.
Original comment by pnied...@gmail.com
on 16 Oct 2012 at 4:24
To be clear, my concern is that the feature suggests that exceptions can be
sensibly compared for equality, when typically they cannot.
Original comment by pnied...@gmail.com
on 16 Oct 2012 at 4:30
Original issue reported on code.google.com by
szcze...@gmail.com
on 16 Oct 2012 at 9:35