I think we should be a bit careful with doing this on public API methods,
since it may be surprising for Java developers using those methods.

So should we really do it in DefaultConfigurationBuilder ?

On Fri, Sep 2, 2016 at 7:10 AM, Matt Sicker <[email protected]> wrote:

> Yeah, it preserves the original stacktrace. The way it works is that it
> uses generics to fool javac into thinking the Throwable has been cast to a
> RuntimeException, thus allowing it to throw it unchecked, but after being
> compiled, the generic cast is erased. As in all other JVM languages,
> there's no difference between checked and unchecked exceptions, so it ends
> up allowing a loophole where a checked exception can be thrown unchecked in
> Java source code.
>
> On 1 September 2016 at 20:22, Remko Popma <[email protected]> wrote:
>
>> As long as the stacktrace still shows what happened before the rethrow,
>> I'm happy. :-)
>>
>> Sent from my iPhone
>>
>> On 2016/09/02, at 9:44, Gary Gregory <[email protected]> wrote:
>>
>> It is better than before because there one less "caused by" level.
>>
>> Gary
>>
>> On Sep 1, 2016 8:28 PM, "Remko Popma" <[email protected]> wrote:
>>
>>> Does that preserve the original stacktrace?
>>>
>>> Sent from my iPhone
>>>
>>> On 2016/09/02, at 6:06, Gary Gregory <[email protected]> wrote:
>>>
>>> On Wed, Aug 31, 2016 at 7:22 PM, Matt Sicker <[email protected]> wrote:
>>>
>>>> If it's just to rethrow a checked exception, it should use
>>>> Throwables.rethrow(Throwable t). No exception wrapping is done in that
>>>> method anymore thanks to an abuse of generics I found a couple months ago,
>>>> so the stacktrace looks better.
>>>>
>>>
>>> Done in Git master.
>>>
>>> Gary
>>>
>>>
>>>>
>>>> On 31 August 2016 at 11:29, Gary Gregory <[email protected]>
>>>> wrote:
>>>>
>>>>> We've got a few of these... not good. Surely there is a better
>>>>> exception checked or not we can use.
>>>>>
>>>>> Gary
>>>>>
>>>>> --
>>>>> E-Mail: [email protected] | [email protected]
>>>>> Java Persistence with Hibernate, Second Edition
>>>>> <http://www.manning.com/bauer3/>
>>>>> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
>>>>> Spring Batch in Action <http://www.manning.com/templier/>
>>>>> Blog: http://garygregory.wordpress.com
>>>>> Home: http://garygregory.com/
>>>>> Tweet! http://twitter.com/GaryGregory
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Matt Sicker <[email protected]>
>>>>
>>>
>>>
>>>
>>> --
>>> E-Mail: [email protected] | [email protected]
>>> Java Persistence with Hibernate, Second Edition
>>> <http://www.manning.com/bauer3/>
>>> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
>>> Spring Batch in Action <http://www.manning.com/templier/>
>>> Blog: http://garygregory.wordpress.com
>>> Home: http://garygregory.com/
>>> Tweet! http://twitter.com/GaryGregory
>>>
>>>
>
>
> --
> Matt Sicker <[email protected]>
>



-- 
[image: MagineTV]

*Mikael Ståldal*
Senior software developer

*Magine TV*
[email protected]
Grev Turegatan 3  | 114 46 Stockholm, Sweden  |   www.magine.com

Privileged and/or Confidential Information may be contained in this
message. If you are not the addressee indicated in this message
(or responsible for delivery of the message to such a person), you may not
copy or deliver this message to anyone. In such case,
you should destroy this message and kindly notify the sender by reply
email.

Reply via email to