Skip to content

Commit

Permalink
\#102 Message type detection more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
seime committed Nov 23, 2020
1 parent 39a2e74 commit ed11a2f
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -496,11 +496,10 @@ private void uppercaseMessageNames(Map<String, ProtoFile> packageToProtoFileMap,

private CaseFormat getCaseFormatName(String s) throws IllegalFormatException {
if (s.contains("_")) {
if (s.toUpperCase().equals(s)) {
return CaseFormat.UPPER_UNDERSCORE;
}
if (s.toLowerCase().equals(s)) {
if (Character.isLowerCase(s.charAt(0))) {
return CaseFormat.LOWER_UNDERSCORE;
} else {
return CaseFormat.UPPER_UNDERSCORE;
}
} else if (s.contains("-")) {
if (s.toLowerCase().equals(s)) {
Expand Down

0 comments on commit ed11a2f

Please sign in to comment.