{"record":{"id":"e026c7ad16514268","repo":"lingochamp/FileDownloader","slug":"isresuming","errorCode":null,"errorMessage":"isResuming","messagePattern":"isResuming","errorType":"exception","errorClass":"NoFieldException","httpStatus":null,"severity":"error","filePath":"library/src/main/java/com/liulishuo/filedownloader/message/MessageSnapshot.java","lineNumber":53,"sourceCode":"\n    @Override\n    public int getId() {\n        return id;\n    }\n\n    @Override\n    public Throwable getThrowable() {\n        throw new NoFieldException(\"getThrowable\", this);\n    }\n\n    @Override\n    public int getRetryingTimes() {\n        throw new NoFieldException(\"getRetryingTimes\", this);\n    }\n\n    @Override\n    public boolean isResuming() {\n        throw new NoFieldException(\"isResuming\", this);\n    }\n\n    @Override\n    public String getEtag() {\n        throw new NoFieldException(\"getEtag\", this);\n    }\n\n    @Override\n    public long getLargeSofarBytes() {\n        throw new NoFieldException(\"getLargeSofarBytes\", this);\n    }\n\n    @Override\n    public long getLargeTotalBytes() {\n        throw new NoFieldException(\"getLargeTotalBytes\", this);\n    }\n\n    @Override","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/lingochamp/FileDownloader/blob/6237a8cac174bcc916e4342b14ab1ab72a5768d4/library/src/main/java/com/liulishuo/filedownloader/message/MessageSnapshot.java#L35-L71","documentation":"MessageSnapshot's base isResuming() throws NoFieldException because this snapshot type has no 'resuming' field. Only pending/connected/progress-type snapshots override isResuming() with a real value; calling it on others (started, warn, etc.) is an invalid field access.","triggerScenarios":"Calling IMessageSnapshot.isResuming() on a MessageSnapshot subclass that does not override it — e.g. StartedMessageSnapshot. Reached from the update/handoverMessage pipeline or from user code probing resume state on an arbitrary snapshot.","commonSituations":"UI code that renders 'resumed from breakpoint' state for every message without checking status; code migrated from a task-based API where isResuming was always available; snapshots reconstructed from Parcel in a way that changes their type.","solutions":["Check getStatus() before calling isResuming() — it is only valid on pending/connected/progress snapshots","Query the download task (BaseDownloadTask / FileDownloader) for resume state instead of the snapshot","Wrap the accessor in a try-catch for IllegalStateException when iterating all message types","Keep using the listener-callback model rather than inspecting internal snapshots"],"exampleFix":"// before\nboolean resuming = snapshot.isResuming();\n// after\nboolean resuming = snapshot.getStatus() == FileDownloadStatus.progress && snapshot.isResuming();","handlingStrategy":"validation","validationCode":"boolean statusSupportsResuming(byte status) {\n    return status == FileDownloadStatus.pending\n        || status == FileDownloadStatus.connected\n        || status == FileDownloadStatus.progress;\n}","typeGuard":"boolean safeIsResuming(IMessageSnapshot s) {\n    if (!statusSupportsResuming(s.getStatus())) return false;\n    try { return s.isResuming(); } catch (IllegalStateException e) { return false; }\n}","tryCatchPattern":"try {\n    boolean resuming = snapshot.isResuming();\n} catch (IllegalStateException e) {\n    // snapshot type has no resuming field\n}","preventionTips":["Check status (pending/connected/progress) before calling isResuming()","Query the BaseDownloadTask for resume state instead of the snapshot","Wrap snapshot accessors in defensive helpers with try-catch","Avoid inspecting raw MessageSnapshots outside the intended lifecycle"],"tags":["android","filedownloader","no-field","snapshot-accessor"],"backgroundTag":"unsupported-operation","analyzedSha":"6237a8cac174bcc916e4342b14ab1ab72a5768d4","analyzedAt":"2026-09-08T23:50:48.168Z","contentChangedAt":"2026-09-08T23:50:48.168Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}