From 5dae063fe5e3f7bb54fc0a434d9ab233f96342bc Mon Sep 17 00:00:00 2001 From: curry772 Date: Thu, 23 Apr 2026 10:34:22 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20FLAT=20=EC=A7=81=EB=A0=AC=ED=99=94=20?= =?UTF-8?q?=EC=8B=9C=20=EB=B9=84=ED=99=9C=EC=84=B1=20=EC=A1=B0=EA=B1=B4?= =?UTF-8?q?=EB=B6=80=20GROUP=20=EB=B8=94=EB=A1=9D=20=EB=B0=94=EC=9D=B4?= =?UTF-8?q?=ED=8A=B8=20=ED=8F=AC=ED=95=A8=20=EB=B2=84=EA=B7=B8=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit toByteArray() / getBytesDataLength() GROUP 케이스에서 size==0 이면 refPath/refValue 유무와 무관하게 무조건 skip 하도록 변경. (toJson() 동작과 일치) 기존 로직은 refPath 또는 refValue 가 없는 경우에만 skip 하여, 조건부 블록(EZDATA, MSG 등)이 비활성 상태(size=0, isHidden=false)일 때도 FLAT 바이트에 잘못 포함되는 문제가 있었음. → FlatReader 파싱 시 오프셋 불일치로 overflow 예외 또는 DATA 필드 오염 발생. Co-Authored-By: Claude Sonnet 4.6 --- .../com/eactive/eai/message/StandardItem.java | 22 +++++-------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/src/main/java/com/eactive/eai/message/StandardItem.java b/src/main/java/com/eactive/eai/message/StandardItem.java index cf750fd..8da5eec 100644 --- a/src/main/java/com/eactive/eai/message/StandardItem.java +++ b/src/main/java/com/eactive/eai/message/StandardItem.java @@ -1023,20 +1023,15 @@ public class StandardItem implements Serializable, Cloneable { totalSize += getLength(); break; case StandardType.GROUP : - // skip variable group - if( getSize() == 0 - //카카오뱅크 => 카카오카드 400응답시 아래 로직을 추가해야 전체건수에서 메시지부가 처리됨 - //메시지부 size 0 refPath refValue 사용 해서 있고 없고 처리 - && (StringUtils.isBlank(getRefPath()) - || StringUtils.isBlank(getRefValue())) - ) { + // skip inactive/conditional group (size==0 means not activated) + if( getSize() == 0 ) { break; } if (isHidden) break; keyIter = childs.keySet().iterator(); while(keyIter.hasNext()) { String key = keyIter.next(); - StandardItem item = childs.get(key); + StandardItem item = childs.get(key); totalSize +=item.getBytesDataLength(charset); } break; @@ -1123,20 +1118,15 @@ public class StandardItem implements Serializable, Cloneable { } break; case StandardType.GROUP : - // skip variable group - if( getSize() == 0 - //카카오뱅크 => 카카오카드 400응답시 아래 로직을 추가해야 전체건수에서 메시지부가 처리됨 - //메시지부 size 0 refPath refValue 사용 해서 있고 없고 처리 - && (StringUtils.isBlank(getRefPath()) - || StringUtils.isBlank(getRefValue())) - ) { + // skip inactive/conditional group (size==0 means not activated) + if( getSize() == 0 ) { break; } if (isHidden) break; keyIter = childs.keySet().iterator(); while(keyIter.hasNext()) { String key = keyIter.next(); - StandardItem item = childs.get(key); + StandardItem item = childs.get(key); bos.write(item.toByteArray(withBizData,charset)); //하위로 내려갈때 withBizDat 값이 없어져서 추가 jun's 20231101 } break;