Last Updated: February 25, 2016
·
365
· kimble

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