Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Assertions

 
Manish Hatwalne
Ranch Hand
Posts: 2591
Android Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Java language guide to assertions mentions in design FAQs(http://java.sun.com/j2se/1.4/docs/guide/lang/assert.html#design-faq-enable-disable)
3. Why does setClassAssertionStatus return a boolean instead of throwing an exception if it is invoked when it's too late to set the assertion status (that is, if the named class has already been initialized)?
No action (other than perhaps a warning message) is necessary or desirable if it's too late to set the assertion status. An exception seems unduly heavyweight.
But as per JDK 1.4 API documentation(http://java.sun.com/j2se/1.4/docs/api/java/lang/ClassLoader.html#setClassAssertionStatus(java.lang.String, boolean)) - the method setClassAssertionStatus return void and not a boolean.
Looks like a documentation error from Sun, has anyone noticed/reported this?
- Manish
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bug #4392034 has been fixed
 
Manish Hatwalne
Ranch Hand
Posts: 2591
Android Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Strange!!
The bug parade indeed says it has been fixed, but I just visited the link -http://java.sun.com/j2se/1.4/docs/guide/lang/assert.html#design-faq-enable-disable
that I had included in the previous post, and the documentation still says it returns a boolean. I wonder what has been fixed?
I did send a mail abt it to Sun a few days agao, but no reply from them. Perhaps, they believe it has been fixed, since the bug parade says so.
- Manish
[ August 26, 2002: Message edited by: Manish Hatwalne ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic