Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

stringBuffer.append(char) now throws IOException?!? HUH?!?

807607Jan 30 2007 — edited Jan 31 2007
I recently had the 1.5 JDK shoved down my throat, and today was the first time I actually had to compile anything in it.

And I suddenly found 7 compiler errors complaining that I'm appending to a StringBuffer without dealing with IOExceptions.

Two questions:

1. Yes, I eventually figured out that StringBuffer inherits this requirement from the new "Appendable" interface, but given that a StringBuffer doesn't do I/O, WHY was it set up this way???

2. Again, given that the method is effectively lying about what it can throw, how am I to deal with it? A "try/catch" with an empty catch?

--
JHHL
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 28 2007
Added on Jan 30 2007
17 comments
638 views