Skip to content

Commit

Permalink
Allow single character field names (#230)
Browse files Browse the repository at this point in the history
## Before this PR
Single character field names were not allowed (eg: `Point { x, y }`)

## After this PR
Allows single character field names.
  • Loading branch information
ellisjoe authored and bulldozer-bot[bot] committed Feb 18, 2019
1 parent 21d5f67 commit ad024f2
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ public abstract class FieldName {
private static final Logger log = LoggerFactory.getLogger(FieldName.class);

private static final Pattern CAMEL_CASE_PATTERN =
Pattern.compile("^[a-z]([A-Z]{1,2}[a-z0-9]|[a-z0-9])+[A-Z]?$");
Pattern.compile("^[a-z]([A-Z]{1,2}[a-z0-9]|[a-z0-9])*[A-Z]?$");
private static final Pattern KEBAB_CASE_PATTERN =
Pattern.compile("^[a-z]((-[a-z]){1,2}[a-z0-9]|[a-z0-9])+(-[a-z])?$");
Pattern.compile("^[a-z]((-[a-z]){1,2}[a-z0-9]|[a-z0-9])*(-[a-z])?$");
private static final Pattern SNAKE_CASE_PATTERN =
Pattern.compile("^[a-z]((_[a-z]){1,2}[a-z0-9]|[a-z0-9])+(_[a-z])?$");
Pattern.compile("^[a-z]((_[a-z]){1,2}[a-z0-9]|[a-z0-9])*(_[a-z])?$");

public enum Case {
LOWER_CAMEL_CASE(CAMEL_CASE_PATTERN, CaseFormat.LOWER_CAMEL),
Expand Down

0 comments on commit ad024f2

Please sign in to comment.