azure-sdk-for-java: [Bug] infinite iteration over blobList
Query/Question When I’m calling following code
PagedIterable<BlobItem> items = azure.listBlobsByHierarchy(path);
ArrayList<String> strings = new ArrayList<>();
for (BlobItem item : items) {
strings.add(item.getName());
}
return strings;
it cames out that loop is infinite, constantly repeating item1 → item2 → item3 → item1 → …
Why is this not a Bug or a feature Request? It doen’t look like a bug because I can’t reproduce it in clean environment. My custom environment is plugin for browsing Azure Blob Storage in IDEA.
Setup (please complete the following information if applicable):
- OS: Manjaro Linux, 19.0.2, kernel 5.5.8-1-MANJARO
- IDE : IntelliJ
- Version of the Library used: 12.5.0
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 53 (22 by maintainers)
If we follow the instruction listed in the above IntelliJ plugin thread, then Jackson is able to use the ServiceLoader:
not sure this is the optimal solution for plugin though.
I’ve experienced this same issue upgrading to
2.12.0, the problem seems to be that the default behaviour in that version has changed (https://github.com/FasterXML/jackson-dataformat-xml/issues/411) and for an empty block, it now returns an empty string instead ofnull. I don’t think there’s a way to inject a customSerializerAdapter. The fix should be fairly trivial to implement inJacksonAdapter#JacksonAdapterand configure the parser to behave as expected.I am facing the same problem with listBlobs(). Is there a solution other than changing classloader?
The easiest way is to just call gradle’s
runIdetask. If you’ll run it from idea — wull.be able to debug it@anuchandy I think the service always returns the empty xml element
<NextMarker />when there isn’t a next page. The rest docs state “Note that the Prefix, Marker, MaxResults, and Delimiter elements are present only if they were specified on the request URI. The NextMarker element has a value only if the list results are not complete.” I believe that implies NexMarker will always be present but may not always have a value.Is there any chance the different environment is somehow causing the deserializer to give empty string instead of null? We could also make the check for null or empty instead of just null?
Sorry for delay, I believe it’s difference it TZs. Here it is