@Test void testI18nAttributeNameNumber() { assertThrows(MolgenisDataException.class, () -> NameValidator.validateAttributeName("test-n2")); }
public static void validateAttributeName(String name) { checkForKeyword(name); checkForLeadingDigit(name); if (!name.matches("[a-zA-Z0-9_#]+(-[a-z]{2,3})??$")) { throw new MolgenisDataException( "Invalid characters in: [" + name + "] Only letters (a-z, A-Z), digits (0-9), underscores (_) and hashes (#) are allowed."); } }
NameValidator { public static void validateAttributeName(String name) { checkForKeyword(name); checkForLeadingDigit(name); if (!name.matches("[a-zA-Z0-9_#]+(-[a-z]{2,3})??$")) { throw new MolgenisDataException( "Invalid characters in: [" + name + "] Only letters (a-z, A-Z), digits (0-9), underscores (_) and hashes (#) are allowed."); } } }
NameValidator { public static void validateAttributeName(String name) { checkForKeyword(name); checkForLeadingDigit(name); if (!name.matches("[a-zA-Z0-9_#]+(-[a-z]{2,3})??$")) { throw new MolgenisDataException( "Invalid characters in: [" + name + "] Only letters (a-z, A-Z), digits (0-9), underscores (_) and hashes (#) are allowed."); } } private  NameValidator(); }
NameValidator { public static void validateAttributeName(String name) { checkForKeyword(name); checkForLeadingDigit(name); if (!name.matches("[a-zA-Z0-9_#]+(-[a-z]{2,3})??$")) { throw new MolgenisDataException( "Invalid characters in: [" + name + "] Only letters (a-z, A-Z), digits (0-9), underscores (_) and hashes (#) are allowed."); } } private  NameValidator(); static void validateAttributeName(String name); static void validateEntityName(String name); }
NameValidator { public static void validateAttributeName(String name) { checkForKeyword(name); checkForLeadingDigit(name); if (!name.matches("[a-zA-Z0-9_#]+(-[a-z]{2,3})??$")) { throw new MolgenisDataException( "Invalid characters in: [" + name + "] Only letters (a-z, A-Z), digits (0-9), underscores (_) and hashes (#) are allowed."); } } private  NameValidator(); static void validateAttributeName(String name); static void validateEntityName(String name); @SuppressWarnings("java:S2386") // false positive: Mutable fields should not be "static"
  static final Set<String> KEYWORDS; }