microsoftgraph / microsoftgraph/msgraph-sdk-java
"java.lang.IllegalArgumentException: Collection is empty" when calling `lastEstimateStatisticsOperation`
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 444
- Forks
- 154
- Avg merge
- 18h 28m
- Merged PRs (30d)
- 4
Description
Describe the bug
I'm fetching Search estimate statistics in Purview using the following call:
EdiscoveryEstimateOperation estimateOperation = client.security()
.cases()
.ediscoveryCases()
.byEdiscoveryCaseId(caseId)
.searches()
.byEdiscoverySearchId(searchId)
.lastEstimateStatisticsOperation()
.get();
This consistently fails with the following error:
java.lang.IllegalArgumentException: Collection is empty
at java.base/java.util.EnumSet.copyOf(EnumSet.java:177)
at com.microsoft.kiota.serialization.JsonParseNode.getEnumSetValue(JsonParseNode.java:257)
at com.microsoft.graph.beta.models.security.EdiscoveryEstimateOperation.lambda$getFieldDeserializers$6(EdiscoveryEstimateOperation.java:41)
at com.microsoft.kiota.serialization.JsonParseNode.assignFieldValues(JsonParseNode.java:280)
at com.microsoft.kiota.serialization.JsonParseNode.getObjectValue(JsonParseNode.java:192)
at com.microsoft.kiota.http.OkHttpRequestAdapter.send(OkHttpRequestAdapter.java:322)
at com.microsoft.graph.beta.security.cases.ediscoverycases.item.searches.item.lastestimatestatisticsoperation.LastEstimateStatisticsOperationRequestBuilder.get(LastEstimateStatisticsOperationRequestBuilder.java:61)
at com.microsoft.graph.beta.security.cases.ediscoverycases.item.searches.item.lastestimatestatisticsoperation.LastEstimateStatisticsOperationRequestBuilder.get(LastEstimateStatisticsOperationRequestBuilder.java:47)
It seems like response deserialization isn't working correctly, probably for the statisticsOptions field? It might be relevant that there doesn't seem to be any way to specify statisticsOptions when triggering statistics generation through the API.
Expected behavior
I expect this SDK call to successfully return an EdiscoveryEstimateOperation for the given search.
How to reproduce
I'm starting statistics generation with the following call:
client.security()
.cases()
.ediscoveryCases()
.byEdiscoveryCaseId(caseId)
.searches()
.byEdiscoverySearchId(searchId)
.microsoftGraphSecurityEstimateStatistics()
.post();
Fetching statistics with the call listed above then triggers the bug.
SDK Version
beta 6.61.0
Latest version known to work for scenario above?
No response
Known Workarounds
No response
Debug output
Click to expand log
```</details>
### Configuration
_No response_
### Other information
_No response_
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the generated EdiscoveryEstimateOperation deserializer at EdiscoveryEstimateOperation.java:41 and trace JsonParseNode.getEnumSetValue, using the reported lastEstimateStatisticsOperation request as the reproduction. Compare the response handling for statisticsOptions with the API response and add or update a focused deserialization test if the repository provides one. Done means the call returns an EdiscoveryEstimateOperation without the empty-collection exception.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100