// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
import java.lang.reflect.*;

import org.aspectj.lang.*;
import org.aspectj.lang.annotation.*;

@Aspect
public class NullHandler {
    @Pointcut("execution(* *.getString())")
    public void getStringHandler() {}
    @Around(value = "getStringHandler()")
    public String replaceNull(ProceedingJoinPoint pjp) {
        String res = (String)pjp.proceed();
        if(res == null) {
            res = "Sorry - we got null";
        }
        return res;
    }
}
