fix(codegen.model): 연관관계 양방향 end 이름·타입이 반대편 end에서 잘못 복사되는 오타 수정 - #140
Open
EricSeokgon wants to merge 1 commit into
Open
fix(codegen.model): 연관관계 양방향 end 이름·타입이 반대편 end에서 잘못 복사되는 오타 수정#140EricSeokgon wants to merge 1 commit into
EricSeokgon wants to merge 1 commit into
Conversation
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)
문제
egovframework.dev.imp.codegen.model.converter.NonEclipseModelConverter.convertAssociation()에서 연관관계(Association)의 두 번째 end를 만들 때, 가드는 두 번째 end를 검사하지만 값은 첫 번째 end에서 읽어오는 복붙 오타가 2곳 있습니다.1) 양방향(ownedEnd 2개) 분기 — line 773
2) memberEnd 2개 분기 — line 849
그 결과 두 번째 end 의 이름(memberEnd 분기에서는 타입까지)이 첫 번째 end 값으로 덮여, 생성되는 연관관계의 양 끝 property 이름이 같아지거나(bidirectional) 자기 자신을 가리키는 자기참조 연관으로 잘못 생성됩니다.
대조 증거: 동일 로직의 형제 변환기
UML2NonEclipseModelConverter.convertAssociation()은 memberEnd 분기(line 1126)에서memberEnd2.getAttribute("xmi:idref")로 올바르게 구현돼 있어, 위 line 849 가 오타임이 확인됩니다.수정 내용
ownedEnd1->ownedEnd2memberEnd1->memberEnd2검증 (실측)
실제 클래스는 EMF/UML2 의존으로 standalone 컴파일이 어려워, 결함 메서드의 해당 분기를 그대로 추출해 JDK
org.w3c.dom으로 동일 XMI 를 파싱하여 검증했습니다(UML2createAssociation싱크만 인자 기록용으로 스텁).createAssociation인자[Order, orders, Order, orders]— 자기참조로 붕괴[Order, orders, Customer, customer][Board, writer, Comment, writer]— end2 이름이 "writer" 로 잘못[Board, writer, Comment, comments]참고
동일한 ownedEnd 복붙 오타가 형제 변환기
UML2NonEclipseModelConverter.java(line 1007)에도 존재합니다. 원하시면 이 PR 에 함께 반영하거나 별도로 정리하겠습니다.