refactor: Foundation 지역 StringBuffer를 StringBuilder로 변경 (불필요한 동기화 제거)#271
Open
EricSeokgon wants to merge 3 commits into
Open
refactor: Foundation 지역 StringBuffer를 StringBuilder로 변경 (불필요한 동기화 제거)#271EricSeokgon wants to merge 3 commits into
EricSeokgon wants to merge 3 commits into
Conversation
1 task
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.
수정 사유
단일 스레드 메서드 내부에서만 사용하는 문자열 버퍼에 동기화 비용이 있는
StringBuffer대신StringBuilder를 사용하도록 변경했습니다. 정적분석 도구가 권장하는 개선(PMDAvoidStringBufferField계열, SonarQubejava:S1149)이며, egovframe-common-components에 제출한 동일 계열 PR(eGovFramework/egovframe-common-components#1138, #1139)의 실행환경(Foundation) 버전입니다.수정 내용
fdl.filehandling/.../EgovFileUtil.javareadFile지역 변수 1곳,listChildren(private) 반환형·지역 변수 2곳fdl.string/.../EgovStringUtil.javareverse의 지역 표현식 1곳fdl.idgnr/.../EgovIdGnrStrategyImpl.javaEgovFileUtil.readTextFile은 반환형이StringBuffer인 공개 메서드라 호환성을 위해 의도적으로 제외했습니다.listChildren은 private 메서드로 클래스 외부에 노출되지 않으며, 호출부는LOGGER.debug의 인자(CharSequence)라 동작이 동일합니다.테스트 여부
mvn compile통과 (JDK 17)