Currently, I use a very conservative way to stop malfunctioing code. It is annoying at the time of a change when I have to change the checker parts as well.
            if(ds==null||s==null||maxDs==null)
            {
                    System.out.println("NULL in getDirs(ds[],s,maxDs)");
                    System.exit(9);
            }
So is there some prebuild-ready Null checker for pars in the API?
- 开发者_开发知识库Does Java build some ready table for Parameters? Perhaps similar to Stdin argv[].
- If so, where can I find all automatically build tables like argv[]?
Wanna-check-for-parameters
for(Object p:pars)
{
    if(p.isNull())
    {
       System.out.println("Lollipop arg your pars are in Lava!");
       System.exit(9);
    }
}
I'm not aware of anything built in, but it should be possible to write your own annotation processet to inject some suitable code. It seems possible that only some methods need a null check, so having the control that annotations would give could be useful.
@ParamNotNull
public void myMethod(X anX, Y aY) { ...
public void myTolerantMethod(X couldbeNull) { ...
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论