private static boolean methodReturnsValue ( CtBehavior method ) throws NotFoundException { if ( method instanceof CtMethod == false ) { return false ; } CtClass returnType = ( ( CtMethod ) method ) . getReturnType ( ) ; String returnTypeName = returnType . getName ( ) ; boolean isVoidMethod = "void" . equals ( returnTypeName ) ; boolean methodReturnsValue = isVoidMethod == false ; return methodReturnsValue ; }
determine if the given method returns a value and return true if so . false otherwise .