Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add MANY assertions #39

Closed
jankotek opened this issue Mar 19, 2012 · 1 comment
Closed

Add MANY assertions #39

jankotek opened this issue Mar 19, 2012 · 1 comment

Comments

@jankotek
Copy link
Owner

JDBM currently have some assertions. This is not enough, we should be much more paranoid and have MUCH more assert statements. Each method should should verify all its arguments.

Java assert() is not good. JDBM tries to minimize jar file. Assert code and messages are always linked into class files.

Better is to have static final boolean field which would control assertions. If this field is off, javac outputs 'unreachable code warning' and removes assertion code. Something like:

if(CompileConfig.ASSERT && recid<0)
throw new IllegalArgumentException("recid is negative: "+recid);

By default flag will be on. We always release two jar files, one with assertions included for debuging, second without assertions for production. Both releases will have to pass acceptance tests.

@jankotek
Copy link
Owner Author

jankotek commented May 9, 2012

Closing, not going to fix right now

@jankotek jankotek closed this as completed May 9, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant