fix: convert2CamelCase 빈/null 입력 예외 방지#246
Open
z3rotig4r wants to merge 1 commit into
Open
Conversation
CamelUtil.convert2CamelCase와 CamelCaseUtil.convert2CamelCase는 입력이 빈 문자열이면 charAt(0)에서 StringIndexOutOfBoundsException이, null이면 NullPointerException이 발생합니다. CamelUtil은 EgovMap.put이 모든 맵 키마다 호출하므로(키가 빈 문자열이거나 null인 경우) MyBatis EgovMap resultType 처리 경로에서 예외로 이어질 수 있습니다. 두 유틸 모두 진입부에 null/빈 문자열 가드를 추가해 입력을 그대로 반환하도록 했습니다. 각 테스트 클래스에 빈 문자열·null 회귀 테스트를 추가했습니다.
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.
문제
언더스코어 표기를 카멜 표기로 바꾸는 두 유틸이 빈 문자열·
null입력에서 예외를 던집니다.org.egovframe.rte.psl.dataaccess.util.CamelUtil.convert2CamelCaseorg.egovframe.rte.fdl.security.userdetails.util.CamelCaseUtil.convert2CamelCase빈 문자열이면
charAt(0)에서StringIndexOutOfBoundsException이,null이면indexOf호출(CamelCaseUtil은isSkipCase내부)에서NullPointerException이 발생합니다.특히
CamelUtil은EgovMap.put이 모든 맵 키마다 호출합니다.따라서 키가
null이거나 빈 문자열이면 MyBatisEgovMapresultType 처리 경로에서 예외로 이어질 수 있습니다.수정
두 유틸 모두 진입부에
null/빈 문자열 가드를 추가해 입력을 그대로 반환하도록 했습니다.기존 변환 동작은 그대로 유지됩니다.
검증
각 테스트 클래스에 빈 문자열·
null회귀 테스트를 추가했습니다.