cel-java icon indicating copy to clipboard operation
cel-java copied to clipboard

[BUG] CelDescriptorsUtil throwing duplicate key exception

Open atiwari22 opened this issue 9 months ago • 3 comments

Describe the bug CelDescriptorUtil method descriptorCollectionToMap throws duplicate key exception .

As method getFileDescriptorsForDescriptors collect unique Messagetypes for individual filedescriptors but collects all message types for multiple filedescriptors again duplicating message types in the aggregated collection . And when it tries to convert this collection to a map in descriptorCollectionToMap throws duplicate key exception .

To Reproduce I have a dynamic message with nested message types . As a fix we have collected unique filedescriptor Check which components this affects:

  • [✅ ] parser
  • [ ] checker
  • [ ] runtime

Sample expression and input that reproduces the issue:

// sample expression string

Test setup:

// test case in java

Expected behavior When multiple filedecrptors are provided CelDescriptor should not throw duplicate key exception Additional context Add any other context about the problem here.

atiwari22 avatar May 15 '24 20:05 atiwari22