Skip to content

Commit b51ccfe

Browse files
committed
remove unneeded @nullable
method `faker.credentials.userId()` never returns null.
1 parent 85e44df commit b51ccfe

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/net/datafaker/providers/base/Credentials.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,11 @@ public String weakPassword() {
146146
* Generates a user ID based on the regex pattern defined in the resource file.
147147
* If the regex is null or invalid, it returns null.
148148
*
149-
* @return A randomly generated user ID based on the regex or null if the regex is null or invalid
149+
* @return A randomly generated user ID
150150
*/
151-
@Nullable
152151
public String userId() {
153-
return userId(resolve("credentials.uid_pattern"));
152+
String regex = resolve("credentials.uid_pattern");
153+
return faker.regexify(regex);
154154
}
155155

156156
/**

0 commit comments

Comments
 (0)