Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Edited by NavBot (vkp) v1.0

...

Wiki Markup
Assertions should not be used to validate parameters of {{public}} methods. According to the Java Language Specification \[[JLS 2005|AA. JavaBibliography#JLS References#JLS 05]\], section 14.10 "The {{assert}} Statement":

...

Wiki Markup
\[[JLS 2005|AA. JavaBibliography#JLS References#JLS 05]\] 14.10 The assert Statement
\[[Bloch 2008|AA. Java References#BlochBibliography#Bloch 08]\] Item 38: Check parameters for validity
\[[ESA 2005|AA. Java References#ESABibliography#ESA 05]\] Rule 68: Explicitly check method parameters for validity, and throw an adequate exception in case they are not valid. Do not use the assert statement for this purpose
\[[Daconta 2003|AA. Java References#DacontaBibliography#Daconta 03]\] Item 7: My Assertions Are Not Gratuitous

...