genome-nexus / g2s

A standalone component to provide mappings between protein sequence positions and PDB 3D protein structure models
GNU Affero General Public License v3.0
7 stars 9 forks source link

many functions with Boolean return type always return true #25

Open sheridancbio opened 8 years ago

sheridancbio commented 8 years ago

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

sheridancbio commented 8 years ago

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

juexinwang commented 8 years ago

Done