You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
sheridancbio
changed the title
function with Boolean return type always return true
many functions with Boolean return type always return true
Jul 30, 2016
Examples are not complete .. scan the full code base for similar cases.
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
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
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
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
PdbScriptsPipelineMakeSQL.java
The text was updated successfully, but these errors were encountered: