The use case is this:
public void testMethod(String para1, String para2, String para3){
if(para1==null){
System.out.println("para1 cannot be null");
}
if(para2)...
}
As the check null code above, we will be repeating ourselvous on writing the same code to check every parameter. But we cannot really factor out a common method, say, checknull(String para), because we need to output the name of the parameter so the users know which one is wrong.
Maybe there is no way to do this in java I guess. Method parameter names should be gone after compile if I understand it correctly.
So, how do you guys usually address this problem?