fix: EgovStringUtil의 식별자 표기 변환이 로케일에 따라 다른 결과를 내는 문제 수정 - #331
Open
wantaekchoi wants to merge 1 commit into
Open
Conversation
convertToCamelCase와 convertToUnderScore는 자기 javadoc이 식별자 변환임을
명시한다("This method convert 'string_util' to 'stringUtil'", "Convert a camel
case string to underscore representation"). 그런데 인자 없는 toLowerCase()를
써서 JVM 기본 로케일을 따르므로, 터키어·아제르바이잔어 로케일에서 I가 점 없는
ı(U+0131)로 바뀐다.
convertToCamelCase("PRINT_STATUS", '_') -> "prıntStatus" (기대 "printStatus")
convertToUnderScore("printId") -> "print_ıd" (기대 "print_id")
같은 일을 하는 형제 구현이 이 저장소에 둘 있고 둘 다 로케일 독립이다 —
fdl.security의 CamelCaseUtil.convert2CamelCase와 psl.dataaccess의
CamelUtil.convert2CamelCase가 Character.toUpperCase(char)/toLowerCase(char)를
쓴다. 같은 목적의 EgovStringUtil 메서드만 String 단위 변환을 거친다.
두 호출 지점에 Locale.ROOT를 명시했다. 같은 결함 클래스를 Locale.ROOT로 고친
선례가 이 저장소에 있다 — DefaultMapUserDetailsMapping의 컬럼명 소문자화(eGovFramework#321).
같은 파일의 capitalize와 swapFirstLetterCase도 인자 없는 변환을 쓰지만 범위에서
뺐다. 두 메서드는 식별자 용도라는 근거가 없다. swapFirstLetterCase는 javadoc
예시가 'Password'/'password'이고 기존 테스트도 그 단어만 다룬다. capitalize는
javadoc이 메서드명 한 줄뿐이고 저장소 안에 호출처도 테스트도 없다. 로케일을
고정하면 터키어 단어를 대문자화하려는 정상 사용을 오히려 깨뜨린다.
wantaekchoi
force-pushed
the
fix/string-util-identifier-case-locale
branch
from
August 13, 2026 23:06
39b64c9 to
208114b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
수정 사유 Reason for modification
수정된 소스 내용 Modified source
convertToCamelCase와convertToUnderScore는 자기 javadoc이 식별자 표기 변환임을 명시합니다.그런데 인자 없는
toLowerCase()를 써서 JVM 기본 로케일을 따릅니다. 터키어·아제르바이잔어 로케일에서는I가 점 없는ı(U+0131)로 바뀝니다.같은 일을 하는 형제 구현이 이 저장소에 둘 있고 둘 다 로케일 독립입니다.
CamelCaseUtil.convert2CamelCaseCharacter.toUpperCase(char)/toLowerCase(char)CamelUtil.convert2CamelCaseEgovStringUtil위 두 메서드String.toLowerCase()AS-IS
TO-BE
같은 결함 클래스를
Locale.ROOT로 고친 선례가 이 저장소에 있습니다 —DefaultMapUserDetailsMapping의 컬럼명 소문자화(#321).범위
같은 파일의
capitalize와swapFirstLetterCase도 인자 없는 변환을 쓰지만 뺐습니다. 두 메서드는 식별자 용도라는 근거가 없습니다.swapFirstLetterCase는 javadoc 예시가'Password'/'password'이고, 기존 테스트(EgovStringUtilTest.testSwapFirstLetterCase)도 그 단어만 다룹니다.capitalize는 javadoc이 메서드명 한 줄뿐이고, 저장소 안에 호출처도 테스트도 없습니다.로케일을 고정하면 터키어 단어를 대문자화하려는 정상 사용을 오히려 깨뜨립니다.
ASCII 식별자는 기본 로케일이 무엇이든 결과가 같습니다. 바뀌는 것은 터키어 계열 로케일에서
i/I가 든 이름뿐입니다.JUnit 테스트 JUnit tests
EgovStringUtilLocaleTest2건을 추가했습니다. 기본 로케일을tr-TR로 바꾼 상태와 원래 로케일 양쪽에서 같은 결과가 나오는지 봅니다. 기본 로케일은finally에서 되돌립니다.수정 지점만 되돌린 상태(RED)
수정 후(GREEN, 모듈 전체)