When discussing this, you should know JDK1.4, released about 10 years ago. He invented an exception chain, which simply means that you have a constructor that accepts the cause of the exception. And then a nice complex stack trace is printed for all this stuff. Prior to JDK1.4, there were many such implementations in JDK, and they were combined into a single consistent solution. Now, what has been done is to provide some base simlar classes to get this idea for older JDKs. However, since many events have occurred:
- JDK 1.3 has ended the maintenance period.
- The period of public support for JDK 1.4 has ended.
- JDK 5 public service period has ended.
- and now the JDK 6 public maintenance period is nearing completion.
Thus, no one else is interested in versions of previous versions of JDK 1.4.
Now, on the other hand, this exception to the contextual thing has nothing to do with any version of the JDK. These are again the base classes for exceptions, but it has a Map in which to put things. This is usually implemented by special types of exceptions with additional fields. It is a safe type, beautiful and clean. Having a card on each exception means you never know what will be on that card. I cannot think of any benefit that this provides. So, if you don't have a really great plan to use it, I would not recommend it.
source share