[Bug] Incorrect regular expression for validating email pattern
The regular expression for validating email here results in an incorrect validation.
private static final Pattern emailPattern = Pattern.compile("^(.+)@(.+?)\\.(.+?)$");
Refer to the test here. The test should throw an exception because of this line. Even when an invalid email id is given in this test, it returns true from isValidEmail
method and does not result in exception, thereby treating the given id as USER
. (Object type USER
is returned from the method getObjectTypeForInputId
).
cc: @kibattul @polavishnu @kiveerap
Edited by Aalekh Jain