I wrote this simple function:
private String getOperatorForCardinality(String op)
{
String operator ="";
if(op!=null)
{
if(op.equals(">="))
{
operator = ">=";
}
else if (op.equals("<="))
{
operator = "<=";
}
}
else
{
operator = "empty";
}
return operator;
}
which returns a string.
In the main program I call this function, when the argument is null the compiler displays the error of NullPointerException. The reason is pretty clear, but I do not know how to deal with the null value when is passed by argument.