File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Assertions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Assertions" Watch "Assertions" New topic
Author

Assertions

Manish Hatwalne
Ranch Hand

Joined: Sep 22, 2001
Posts: 2578

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

Joined: Aug 26, 2001
Posts: 7610
Bug #4392034 has been fixed


SCJP 5, SCJD, SCBCD, SCWCD, SCDJWS, IBM XML
[Blog] [Blogroll] [My Reviews] My Linked In
Manish Hatwalne
Ranch Hand

Joined: Sep 22, 2001
Posts: 2578

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 ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Assertions