#302 ProgrammingException(String) does not allow initCause

2.1 (final)
open
nobody
1
2007-10-30
2007-10-30
Ernst de Haan
No

When the ProgrammingException(String) constructor is used, then one would expect that it would still be possible to call initCause(Throwable) on the exception afterwards. However, this is not possible.

I consider this a bug.

There is an easy fix, which is to change the ProgrammingException class to check whether the cause exception is null. If it is not, then no root cause exception is initialized.

A work-around is to use an alternative constructor that accepts a constructor.

Discussion

  • Ernst de Haan
    Ernst de Haan
    2007-10-30

    • priority: 5 --> 1
     
  • Ernst de Haan
    Ernst de Haan
    2008-01-01

    Logged In: YES
    user_id=11053
    Originator: YES

    "A work-around is to use an alternative constructor that accepts a
    constructor."

    should be:

    "A work-around is to use an alternative constructor that accepts an exception."