Just don't write Java assertions containing statements with side effects!
File someDirectory = new File("...");
assert someDirectory.mkdirs();
It took me long enough to figure out why the directory wasn't created even though all the code around the create directory statement was invoked.
Java will by default run without assertions enabled...
http://docs.oracle.com/javase/1.4.2/docs/guide/lang/assert.html
Written by Kim A. Betti
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Java
Authors
Related Tags
#java
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#