fix: TypedMessage가 attachment value null을 허용해 인터페이스 문서와 모순되는 문제 수정 - #327
Open
wantaekchoi wants to merge 1 commit into
Open
fix: TypedMessage가 attachment value null을 허용해 인터페이스 문서와 모순되는 문제 수정#327wantaekchoi wants to merge 1 commit into
wantaekchoi wants to merge 1 commit into
Conversation
EgovIntegrationMessage 인터페이스는 setAttachments와 putAttachment에 대해 value가 null이면 IllegalArgumentException을 던진다고 번호를 매겨 선언한다. setAttachments 3. Argument attachments의 value 값들 중 null 값이 있는 경우 putAttachment 2. Argument attachment 값이 null인 경우 TypedMessage는 두 메서드 모두 key만 StringUtils.hasText로 검사하고 value는 전혀 보지 않아 null이 그대로 attachments 맵에 들어간다. 형제 구현체 SimpleMessage는 #311에서 같은 계약을 지키도록 고쳐졌고, 이 클래스만 남았다. setBody는 이번 범위에서 뺐다. SimpleMessage는 자기 생성자 javadoc이 body의 value null 계약을 따로 선언하고 있어 #311이 함께 고쳤지만, TypedMessage에는 그 문서가 없고 인터페이스의 setBody javadoc도 body 자체가 null인 경우만 규정한다. 근거가 없는 곳까지 넓히지 않았다. TypedMessage의 attachments는 TypedMap을 거치지 않는 평범한 HashMap이라 바디부의 타입 변환과는 무관한 경로다.
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
EgovIntegrationMessage인터페이스는 두 메서드에 대해 value가null이면IllegalArgumentException을 던진다고 번호를 매겨 선언합니다.TypedMessage는 두 메서드 모두 key만StringUtils.hasText로 검사하고 value는 보지 않아null이 그대로 attachments 맵에 들어갑니다.형제 구현체
SimpleMessage는 #311에서 같은 계약을 지키도록 고쳐졌고 이 클래스만 남았습니다.AS-IS
TO-BE
범위
setBody는 뺐습니다.SimpleMessage는 자기 생성자 javadoc이 body의 value null 계약을 따로 선언하고 있어 #311이 함께 고쳤지만,TypedMessage에는 그 문서가 없고 인터페이스의setBodyjavadoc도 body 자체가 null인 경우만 규정합니다.TypedMessage의 attachments는TypedMap을 거치지 않는 평범한HashMap이라 바디부의 타입 변환과는 무관한 경로입니다.JUnit 테스트 JUnit tests
TypedMessageTest3건을 추가했습니다(#311에서 추가한SimpleMessageTest와 같은 구성).수정 전(RED)
수정 후(GREEN, 모듈 전체)