Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Buffer Overflow & J2EE

 
kha nguyen
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can buffer overflow in a Java/J2EE-Application occur? Should we actively take it to consideration designing a J2EE-based apllication?

Thank you in advance,
Kha Nguyen
 
Jeff Walker
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by kha nguyen:
Can buffer overflow in a Java/J2EE-Application occur? Should we actively take it to consideration designing a J2EE-based apllication?

Thank you in advance,
Kha Nguyen


Hi Kha,
the short answer is yes, it 'can' occur. When it does, it is considered a system level error and there is nothing you can directly do. (Because it extends RuntimeException).

Go here "http://java.sun.com/javase/6/docs/api/" to see a list of all Java clases available in Java6 SE edition. Somewhere down the list, is a class called BufferOverflowException, in the java.nio package. (Also possible, is a BufferUnderflowException as well).

These are both class extensions of the more generic RuntimeException class, which Java programs (and consequently J2EE programs) do not need to explicitly catch in their try-catch blocks. So, technically, you do not explicitly need to design for their occurrence. You do need some sort of behavior for RuntimeExceptions in general, though. (Even if that is simply that the runtime exception bubbles up to the main() method call and the program exits).

But this question doesn't belong in the SCEA forum. It is a Java language specific question, I believe.
Thanks,
-jeff
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic