refactor: EgovSecurityConfiguration 의 읽히지 않는 securityConfigPath 필드 제거 - #377
Open
wantaekchoi wants to merge 1 commit into
Open
Conversation
securityConfigPath 는 @value 로 주입되지만 이 클래스 어디에서도 읽지 않는다. Globals.SecurityConfigPath 를 실제로 쓰는 egovSecurityConfigReader 와 egovSecurityConfig 는 둘 다 같은 이름의 @value 파라미터를 따로 선언하며, 그 파라미터가 필드를 가린다. 컴파일 결과에도 이 필드를 읽거나 쓰는 명령이 없다. 같은 자리의 applicationContext 와 securityConfig 는 getfield 로 나타난다. 모듈 안에 리플렉션으로 필드에 접근하는 곳도 없다. 필드 선언만 지웠다. 프로퍼티를 읽는 두 @bean 파라미터는 그대로 두므로 동작은 변하지 않는다.
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
EgovSecurityConfiguration은Globals.SecurityConfigPath를@Value로 필드에 주입받는데, 이 필드를 읽는 자리가 클래스 안에 없습니다.이 프로퍼티를 실제로 쓰는
@Bean두 개가 같은 이름의@Value파라미터를 따로 선언하고, 메서드 안에서는 그 파라미터가 필드를 가리기 때문입니다. 현재 main 기준으로 이 이름이 나오는 자리는 다섯 곳입니다.83줄이 필드 선언이고, 96·97줄은
egovSecurityConfigReader(...), 102·104줄은egovSecurityConfig(...)의 파라미터 선언과 그 파라미터를 넘기는 자리입니다. 필드를 읽는 줄은 없습니다.바깥에서 읽는 경로도 없습니다.
private필드라 다른 클래스가 이름으로 참조할 수 없고, 저장소 전체git grep -n securityConfigPath는 열두 줄인데 위 다섯 줄 외 일곱 줄은 전부 테스트 쪽EgovSecurityTestConfig안의 동명 지역 변수입니다..java밖에서 잡히는 줄이 없으므로 XML·프로퍼티 설정이 이 이름으로 값을 넣는 경로도 없습니다.리플렉션으로 우회해 읽는 곳도 모듈 안에 없습니다.
AS-IS / TO-BE
영향 범위
필드 선언 세 줄이 전부이고 같은 파일 안에서 끝납니다. 프로퍼티를 읽는 두
@Bean파라미터는 그대로라Globals.SecurityConfigPath를 읽어 오는 동작은 변하지 않습니다.@Valueimport 도 그 두 파라미터가 계속 씁니다(수정 후 93·99줄).동작이 변하지 않는 정리를 별도 PR 로 받은 선례가 있어(#247) 같은 결로 하나만 담았습니다. 같은 클래스에는
loadUrlAuthorizationsFromDb(main 기준 137줄)와 그 안에서만 불리는calculateUrlSpecificity(188줄)가 묶음으로 남아 있는데 이 묶음을 부르는 곳이 없고, 같은 모양의 필드가EgovAccessConfiguration(43줄)·EgovCryptoConfiguration(48줄)에도 있습니다. 성격과 모듈이 갈려 이 PR 에는 담지 않았습니다.JUnit 테스트 JUnit tests
새 테스트는 없습니다. 동작을 바꾸지 않는 삭제라 이 변경으로 상태가 갈리는 테스트를 쓸 수 없어, 기존 스위트로 회귀만 확인했습니다.
먼저 수정 전 기준선이 초록인지 확인했습니다.
필드를 지운 뒤 같은 명령의 결과가 같습니다.
테스트 브라우저 Test Browser
테스트 스크린샷 또는 캡처 영상 Test screenshots or captured video
화면이 없는 실행환경 모듈이라 첨부하지 않았습니다.