-
Bug
-
Resolution: Not an Issue
-
P4
-
None
-
7
A DESCRIPTION OF THE REQUEST :
java.util.Pattern.matcher function throws a NullPointerException if the argument is NULL.
JUSTIFICATION :
This functions shouldn't throw NPE, just do its work as the argument is a text that doesn't matches...
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The works of this function should be the same as if the argument is a text that doesn't matches with the pattern
ACTUAL -
NullPointerException
---------- BEGIN SOURCE ----------
private final static String REGEXP_TEST_EMAIL = " ^blabla(\\.)?(ui)?test(\\.)?(child|teen|adult)?[0-9]*(\\+)?[a-zA-Z0-9]*@gmail.com " ;
private static Pattern emailPattern = Pattern.compile(REGEXP_TEST_EMAIL);
String email = null;
Matcher matcher = emailPattern.matcher(emailAddress);
---------- END SOURCE ----------
java.util.Pattern.matcher function throws a NullPointerException if the argument is NULL.
JUSTIFICATION :
This functions shouldn't throw NPE, just do its work as the argument is a text that doesn't matches...
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The works of this function should be the same as if the argument is a text that doesn't matches with the pattern
ACTUAL -
NullPointerException
---------- BEGIN SOURCE ----------
private final static String REGEXP_TEST_EMAIL = " ^blabla(\\.)?(ui)?test(\\.)?(child|teen|adult)?[0-9]*(\\+)?[a-zA-Z0-9]*@gmail.com " ;
private static Pattern emailPattern = Pattern.compile(REGEXP_TEST_EMAIL);
String email = null;
Matcher matcher = emailPattern.matcher(emailAddress);
---------- END SOURCE ----------