fix(dataaccess): CalendarMapperTypeHandler 인덱스 getResult NULL 가드 추가#258
Open
z3rotig4r wants to merge 1 commit into
Open
fix(dataaccess): CalendarMapperTypeHandler 인덱스 getResult NULL 가드 추가#258z3rotig4r wants to merge 1 commit into
z3rotig4r wants to merge 1 commit into
Conversation
인덱스 기반 getResult(ResultSet, int)가 컬럼명 기반 형제 메서드와 달리 NULL Timestamp 컬럼에 대한 가드가 없어, NULL 컬럼을 인덱스로 매핑할 때 Calendar.setTime(null)로 NullPointerException이 발생했다. 형제 메서드와 동일하게 NULL이면 null을 반환하도록 가드를 대칭 추가했다. 비-NULL 값의 변환 동작은 종전과 동일하다. 테스트: NULL 컬럼 null 반환·비-NULL 변환 2건 추가.
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.
문제
CalendarMapperTypeHandler의 인덱스 기반getResult(ResultSet, int)에 NULL 가드가 없다. 컬럼명 기반 형제 메서드는 가드가 있다.NULL Timestamp 컬럼을 인덱스로 매핑하면
Calendar.setTime(null)에서NullPointerException이 발생한다. MyBatis가 인덱스 기반 매핑 경로에서 이 메서드를 호출할 때 노출된다.수정
형제 메서드와 동일한 NULL 가드를 대칭으로 추가했다.
null을 반환한다.테스트
CalendarMapperTypeHandlerTest신규 2건, 모듈 통과. 기존 테스트 컨벤션(JDK ProxyResultSet)을 따라 외부 의존성 없이 검증한다.nullColumnReturnsNullWithoutNpe: NULL 컬럼 → 예외 없이nullnonNullColumnConverts: 비-NULL → millis 일치 변환