{"record":{"id":"ff9acb14b768478b","repo":"microg/GmsCore","slug":"missing-required-properties-token","errorCode":null,"errorMessage":"Missing required properties: token","messagePattern":"Missing required properties: token","errorType":"validation","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"play-services-auth/src/main/java/com/google/android/gms/auth/api/identity/ClearTokenRequest.java","lineNumber":54,"sourceCode":"    ClearTokenRequest(@NonNull @Param(1) String token, @Nullable @Param(2) String sessionId) {\n        this.token = token;\n        this.sessionId = sessionId;\n    }\n\n    /**\n     * Returns a new {@link ClearTokenRequest.Builder}.\n     */\n    public static ClearTokenRequest.Builder builder() {\n        return new ClearTokenRequest.Builder() {\n            @Nullable\n            private String token;\n            @Nullable\n            private String sessionId;\n\n            @Override\n            public ClearTokenRequest build() {\n                if (token == null) {\n                    throw new IllegalStateException(\"Missing required properties: token\");\n                }\n                return new ClearTokenRequest(token, sessionId);\n            }\n\n            @Override\n            public ClearTokenRequest.Builder setToken(@NonNull String token) {\n                this.token = token;\n                return this;\n            }\n\n            @Override\n            public ClearTokenRequest.Builder setSessionId(@Nullable String sessionId) {\n                this.sessionId = sessionId;\n                return this;\n            }\n        };\n    }\n","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/microg/GmsCore/blob/157c9d86ac46c195a86c2f15ab55c84036223f95/play-services-auth/src/main/java/com/google/android/gms/auth/api/identity/ClearTokenRequest.java#L36-L72","documentation":"ClearTokenRequest.Builder.build() requires the token property to have been set. If setToken(...) was never called, token is null and build() throws IllegalStateException naming the missing property. This is a standard AutoValue-style 'Missing required properties' guard.","triggerScenarios":"Calling ClearTokenRequest.builder().build() without a prior setToken(String) call.","commonSituations":"Conditionally skipping setToken because the token variable was null/empty (e.g. sign-out flow where the cached token is already gone); copying builder code and dropping the setToken line.","solutions":["Always call setToken(...) with a non-null token before build().","If the token may be absent, check it first and skip building/sending the request entirely rather than building with a null token.","Log a clear message when skipping so the missing-token path is debuggable."],"exampleFix":"// before\nClearTokenRequest req = ClearTokenRequest.builder().build();\n// after\nif (token == null) return; // nothing to clear\nClearTokenRequest req = ClearTokenRequest.builder().setToken(token).build();","handlingStrategy":"validation","validationCode":"if (token == null || token.isEmpty()) { skipClearToken(); return; }","typeGuard":null,"tryCatchPattern":"try { req = ClearTokenRequest.builder().setToken(token).build(); } catch (IllegalStateException e) { log.warn(\"ClearTokenRequest missing token\", e); }","preventionTips":["Call setToken immediately after builder() so it's never forgotten.","Check token availability before entering the clear-token flow.","Use a small wrapper function that takes a non-null token."],"tags":["android","identity","builder","required-property"],"backgroundTag":"missing-required-argument","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"}