{"record":{"id":"c4dd6d0f231cc310","repo":"microg/GmsCore","slug":"databuffer-reference-of-type","errorCode":null,"errorMessage":"DataBuffer reference of type ","messagePattern":"DataBuffer reference of type ","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"play-services-base/src/main/java/com/google/android/gms/common/data/SingleRefDataBufferIterator.java","lineNumber":30,"sourceCode":"\n@Hide\npublic class SingleRefDataBufferIterator<T> extends DataBufferIterator<T> {\n    private T element;\n\n    public SingleRefDataBufferIterator(@NonNull DataBuffer<T> dataBuffer) {\n        super(dataBuffer);\n    }\n\n    @Override\n    public T next() {\n        if (!hasNext()) {\n            throw new NoSuchElementException(\"Cannot advance the iterator beyond \" + position);\n        }\n        ++position;\n        if (position == 0) {\n            element = dataBuffer.get(position);\n            if (!(element instanceof DataBufferRef)) {\n                throw new IllegalStateException(\"DataBuffer reference of type \" + element.getClass() + \" is not movable\");\n            }\n        } else {\n            ((DataBufferRef) element).setDataRow(position);\n        }\n        return element;\n    }\n}\n","sourceCodeStart":12,"sourceCodeEnd":38,"githubUrl":"https://github.com/microg/GmsCore/blob/157c9d86ac46c195a86c2f15ab55c84036223f95/play-services-base/src/main/java/com/google/android/gms/common/data/SingleRefDataBufferIterator.java#L12-L38","documentation":"Thrown in SingleRefDataBufferIterator.next when the element returned by dataBuffer.get(0) is not a DataBufferRef. This iterator caches a single reusable ref object, so it requires buffers whose elements are DataBufferRef instances; the actual type is appended to the message.","triggerScenarios":"Thrown at play-services-base/src/main/java/com/google/android/gms/common/data/SingleRefDataBufferIterator.java:30 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a DataBuffer implementation whose get() returns DataBufferRef instances","Use DataBufferIterator or a plain iterator for buffers returning other element types"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"157c9d86ac46c195a86c2f15ab55c84036223f95","analyzedAt":"2026-09-06T17:27:33.892Z","contentChangedAt":"2026-09-06T17:27:33.892Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}