• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Assertions

 
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In the book of Kathy Sierra it is written that the assertions for a package can be enabled/disabled by the command:
"java -ea:foo.sampleprogs" where the "foo.sampleprogs" is a package.
But to my disappointment it doesen't work. The following command works :
"java -ea:foo.sampleprogs...".
Can anybody please clarify this inconsistency. Please answer urgently. I have exam in the next week only.
 
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Urgent!
But to my disappointment it doesen't work
can you share with us why it doesn't work? any stack trace, error, etc?
 
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is an error in K&B, which they know about. Here's a link to a page with the current errata for their book errata
 
Anirban dutta
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry I didn't provide sufficient information. When given without the 3 dots(java -ea:foo.sampleprogs), the ea flag is ignored silently and hence the assertions are disabled(as they are disabled by default). Nothing special happens and the execution proceeds normally.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic