File f = new File("foo.txt");
if( f.exists() )
assert f.delete();
That all looked good to me, right up to the point that I discovered that an assert expression isn't even evaluated if asserts are not enabled, had to change it to.
if( f.exists() ){
boolean deleted = f.delete();
assert deleted;
}
No comments:
Post a Comment