fix: EgovFileUtil 이 VFS 초기화 실패를 debug 로 삼켜 이후 호출이 원인 불명 NPE 로 끝나던 문제 수정, 결함 API deprecated - #418
Merged
jei007 merged 1 commit intoSep 14, 2026
Conversation
…수정, 결함 API deprecated EgovFileUtil 은 static 초기화에서 Commons VFS 매니저와 기준 디렉터리를 만들다 실패하면 debug 로그만 남기고 넘어간다. 그 뒤의 rm/cp/mv/touch/cd/pwd 호출은 전부 null 필드를 참조해 NullPointerException 이 되고, 로그 레벨이 debug 가 아니면 원인을 알 수 없다. rm/cp/mv 의 실패도 debug 로만 남아 운영 로그에는 아무 흔적이 없다. - 초기화 실패는 WARN 으로 남기고, 사용 시점에는 manager()/basefile() 가드가 원인을 담은 IllegalStateException 을 던진다 - rm/cp/mv 의 실패 로그를 WARN 으로 올린다. 예외를 던지지 않는 기존 계약(rm 은 -1, cp/mv 는 조용히 복귀)은 그대로다 - 결함이 있는 API 를 @deprecated 로 표기하고 대체 경로를 안내한다. cd/pwd 는 프로세스 전역 기준 경로를 바꿔 동시 요청에서 안전하지 않고, grep 은 패턴에 맞는 줄이 아니라 패턴으로 나눈 조각을 돌려주며, ls 는 항상 빈 리스트를 돌려준다. 동작은 모두 그대로 유지한다 EgovFileUtilInitGuardTest 를 추가해 VFS 미초기화 상태에서 pwd/rm/touch 가 IllegalStateException 을 던지는지, cp/mv 가 없는 원본에 대해 예외 없이 WARN 을 남기는지, grep/ls 의 기존 동작이 그대로인지 확인한다.
jei007
approved these changes
Sep 14, 2026
jei007
left a comment
Contributor
There was a problem hiding this comment.
표준프레임워크에 대한 지속적인 참여에
대단히 감사드립니다.
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
문제
EgovFileUtil은 static 초기화에서 Commons VFS 매니저와 기준 디렉터리를 만드는데, 실패하면 debug 로그만 남기고넘어갑니다. 그 뒤의
rm/cp/mv/touch/cd/pwd호출은 전부null필드를 참조해NullPointerException으로끝나고, 로그 레벨이 debug 가 아니면 원인을 알 길이 없습니다.
rm/cp/mv의 실패도 debug 로만 남습니다. 예외를 던지지 않는 계약이라 호출자는 반환값(rm의 -1)이나 파일 상태를직접 확인해야 하는데, 운영 로그에는 아무 흔적이 없어 "복사됐다고 믿었는데 파일이 없는" 상황을 사후에 추적할 수 없습니다.
그리고 이름과 동작이 다른 API 가 있습니다.
cd/pwdcd가 다른 모든 스레드의 상대 경로 해석 기준을 바꾼다grep(2종)ls수정
IllegalStateException(manager()/basefile()가드)rm/cp/mv실패cd/pwd/grep×2/ls@Deprecated+ javadoc 에 결함 내용과 대체 경로(EgovFiles) 안내. 동작은 그대로기존 동작을 바꾼 것은 없습니다. 초기화가 성공한 환경(정상)에서는 로그 내용만 달라지고, 실패한 환경에서는 NPE 대신
설명이 있는 예외를 받습니다.
호환성
rm의 -1 반환,cp/mv의 무예외 복귀는 그대로입니다.NullPointerException을 잡고 있던 코드가 있다면 이제IllegalStateException을 받습니다.둘 다
RuntimeException입니다.JUnit 테스트 JUnit tests
EgovFileUtilInitGuardTest5건 신규,fdl.filehandling모듈 전건 통과.Tests run: 127, Failures: 0, Errors: 0, Skipped: 2Tests run: 127, Failures: 0, Errors: 0, Skipped: 5Skipped 는 기존 테스트의 OS 조건부 건너뛰기(플랫폼별 파일시스템 동작)이며 이 PR 과 무관합니다. 신규 5건은 두 환경 모두 실행·통과했습니다.
rm/touch/cp/mv가IllegalStateException(메시지에 원인과EgovFiles안내) · 기준 디렉터리가 없으면pwd가 같은 예외cp/mv하면 예외 없이 돌아오고 WARN 로그가 남는다(Log4j2 캡처)grep은 조각을,ls는 빈 리스트를 그대로 돌려준다가드 테스트는 static 필드를 리플렉션으로 비웠다가 반드시 되돌리므로 다른 테스트에 영향을 주지 않습니다.
수동 확인: 현재
main(cc2b332) 위에서fdl.filehandling모듈 빌드·테스트가 통과함을 Windows 와 Linux 에서 확인했습니다.테스트 브라우저 Test Browser
해당 없음 — 라이브러리 내부 수정입니다.
테스트 스크린샷 또는 캡처 영상 Test screenshots or captured video
해당 없음 — 위 JUnit 테스트 결과로 갈음합니다.
base:
eGovFramework:main@cc2b332(2026-09-10 fetch 기준, #366~#379 머지 후) · 단일 커밋