• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Mr.Stelting, does the Robust Java cover J2SE 5.0, Tiger's features?

 
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Mr.Stelting,
I would like to know whether Robust Java covers new features that were added in J2SE 5.0(Tiger) or not... If so, could you share, in overview, about the topics that you use those features in your book?

Thank you...
 
Ranch Hand
Posts: 884
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ko Ko Naing,

From the Official Tiger Enchancements page, I don't see anything new for exceptions handling in Tiger.

But for JDK 1.4, we've the Chained Exception feature. If you read the sample chapter of the book, you would see a section devoted to it.

Check this out for details on the Chained Exception Facility.

In brief, two new constructors, Throwable(Throwable) & Throwable(String, Throwable) and two new methods initCause(Throwable) & getCause() were added to the Throwable class to facilitate this.

Usually in our codes, we tend to caught an exception & rethrow it as our own custom exception. However, when we do so, the information contained in the original exception are lost, unless we made an effort to retrieve them & include them into our custom exceptions.

With chained exception, we could *chain* the original exception to our custom exception. In this way, we don't have to do the extra work of extracting the information ourself.

Check out the sample chapter for more & clearer explanations!

HTH
[ March 09, 2005: Message edited by: Chengwei Lee ]
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Chengwei Lee:
From the Official Tiger Enchancements page, I don't see anything new for exceptions handling in Tiger.


Even though there is no enhancements listed there, I think other new features might affect the previous exception handling techniques... I just would like to know whether the Author discusses about those things in the book or not...


But for JDK 1.4, we've the Chained Exception feature. If you read the sample chapter of the book, you would see a section devoted to it.

Check this out for details on the Chained Exception Facility.


That's what people in the company are doing... Chained Exception is not that complicated and I feel that it is just a best practice for good developers....
 
Ranch Hand
Posts: 995
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One of the few changes added for exception handling (if not the only one) is related to Thread class which now has uncaughtExceptionHandler (previously only in ThreadGroup).

--
:alex |.::the_mindstorm::.
 
author
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ko Ko Naing,

There HAVE been some additions to the core language in Tiger that I hope to discuss someday... from an exception-al perspective. However, "Robust Java" covers only a few topics in JDK5.0 that I was certain would be in the Tiger release.

I completed work on "Robust Java" a few months before Tiger was released. Of course, I couldn't resist putting some information about generics into my chapter on the I/O and Collection APIs. (Chapter 8)

In the future, I hope to expand on that information, talk about the new threading APIs designed by Doug Lea... probably also branch out into enums and metadata. As Ali mentioned, I'd also like to expand the discussion about "classic" threads in Chapter 4 to include Thread.UncaughtExceptionHandler. It's a pretty significant feature for those who have to write multithreaded code, since it gives developers alternatives for dealing with exceptions that would previously have terminated a running thread.

Hope this helps!
Steve Stelting
reply
    Bookmark Topic Watch Topic
  • New Topic