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

many functions with Boolean return type always return true #25

Open
sheridancbio opened this issue Jul 30, 2016 · 2 comments
Open

many functions with Boolean return type always return true #25

sheridancbio opened this issue Jul 30, 2016 · 2 comments

Comments

@sheridancbio
Copy link
Collaborator

There are functions with a boolean return type (hypothetically to indicate success or failure of function) but which only return a true value. Either identify, detect, and report failures, or change these functions into return type "void". Failures can be reported either by the return type or by throwing an exception, but if the return type is never "false" then switch to void.

Also, if a function does return a true/false success value the calling code must check that value and report a problem if there was a failure, then take corrective action.

If exceptions are thrown, the appropriate "throws" clause must be put on the throwing function and the calling code should have an appropriate "try/catch". Do not use the "unchecked" RuntimeException classes unless they are actually appropriate to the case. The program should not "exception out" of execution unless it is a serious and hard to predict situation.

examples:
PdbScriptsPipelinePreprocessing.java

  • preprocessPDBsequences()
  • preprocessPDBsequencesUpdate()
    PdbScriptsPipelineMakeSQL.java
  • parse2sql
  • parseblastresultsSmallMem
  • generateSQLstatementsSingle
  • genereateSQLstatementsSmallMem
@sheridancbio sheridancbio changed the title function with Boolean return type always return true many functions with Boolean return type always return true Jul 30, 2016
@sheridancbio
Copy link
Collaborator Author

Examples are not complete .. scan the full code base for similar cases.

@sheridancbio sheridancbio changed the title many functions with Boolean return type always return true Pri3 : many functions with Boolean return type always return true Aug 4, 2016
@juexinwang
Copy link
Collaborator

Done

@juexinwang juexinwang changed the title Pri3 : many functions with Boolean return type always return true Rev3 : many functions with Boolean return type always return true Aug 10, 2016
@sheridancbio sheridancbio changed the title Rev3 : many functions with Boolean return type always return true many functions with Boolean return type always return true Aug 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants