Skip to content

Commit 316c952

Browse files
committed
#807 Fix PR suggestions (Thanks @codarabbitai).
1 parent 6b8909b commit 316c952

File tree

1 file changed

+3
-1
lines changed
  • cobol-parser/src/main/scala/za/co/absa/cobrix/cobol/parser

1 file changed

+3
-1
lines changed

cobol-parser/src/main/scala/za/co/absa/cobrix/cobol/parser/Copybook.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,9 @@ class Copybook(val ast: CopybookAST) extends Logging with Serializable {
191191
if (foundFields.isEmpty) {
192192
throw new IllegalStateException(s"Field '$fieldName' is not found in the copybook.")
193193
} else if (foundFields.lengthCompare(1) == 0) {
194-
foundFields.head
194+
val result = foundFields.head
195+
cacheStatements.put(fieldName, result)
196+
result
195197
} else {
196198
throw new IllegalStateException(s"Multiple fields with name '$fieldName' found in the copybook. Please specify the exact field using '.' " +
197199
s"notation.")

0 commit comments

Comments
 (0)