{"record":{"id":"6c48b74174553215","repo":"quarkusio/quarkus","slug":"timestamp-must-not-be-null-6c48b7","errorCode":null,"errorMessage":"`timestamp` must not be `null`","messagePattern":"`timestamp` must not be `null`","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"extensions/redis-client/runtime/src/main/java/io/quarkus/redis/datasource/value/GetExArgs.java","lineNumber":64,"sourceCode":"     * Set the expiration timestamp as a number of seconds since the Unix epoch.\n     *\n     * @param timestamp the timestamp\n     * @return the current {@code GetExArgs}\n     */\n    public GetExArgs exAt(long timestamp) {\n        this.exAt = timestamp;\n        return this;\n    }\n\n    /**\n     * Set the expiration timestamp as a number of seconds since the Unix epoch.\n     *\n     * @param timestamp the timestamp\n     * @return the current {@code GetExArgs}\n     */\n    public GetExArgs exAt(Instant timestamp) {\n        if (timestamp == null) {\n            throw new IllegalArgumentException(\"`timestamp` must not be `null`\");\n        }\n        exAt(timestamp.toEpochMilli() / 1000);\n        return this;\n    }\n\n    /**\n     * Set the expiration timeout, in milliseconds.\n     *\n     * @param timeout expiration timeout in milliseconds\n     * @return the current {@code GetExArgs}\n     */\n    public GetExArgs px(long timeout) {\n        this.px = timeout;\n        return this;\n    }\n\n    /**\n     * Set the expiration timeout, in milliseconds.","sourceCodeStart":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/redis-client/runtime/src/main/java/io/quarkus/redis/datasource/value/GetExArgs.java#L46-L82","documentation":"GetExArgs.exAt(Instant) sets expiration as seconds since the Unix epoch, dividing timestamp.toEpochMilli() by 1000. A null Instant has no epoch value, so IllegalArgumentException is thrown eagerly. This guards the seconds-precision variant of GETEX expiration.","triggerScenarios":"Calling GetExArgs.exAt(null) — e.g. a nullable expiry Instant from a database entity, missing JSON field, or unset variable.","commonSituations":"Optional expiry fields on domain objects; deserialization leaving the timestamp null; scheduling code where the computed deadline was never assigned.","solutions":["Pass a valid Instant, e.g. GetExArgs.INSTANCE.exAt(Instant.now().plusSeconds(60))","Default the timestamp: Instant ts = expiryAt != null ? expiryAt : Instant.now().plusSeconds(60)","Reject the request upstream if expiryAt is mandatory"],"exampleFix":"// before\nGetExArgs args = GetExArgs.INSTANCE.exAt(expiryAt); // may be null\n// after\nObjects.requireNonNull(expiryAt, \"expiryAt is required\");\nGetExArgs args = GetExArgs.INSTANCE.exAt(expiryAt);","handlingStrategy":"validation","validationCode":"if (timestamp == null) {\n    throw new IllegalArgumentException(\"timestamp is required before GetExArgs.exAt()\");\n}\nGetExArgs.INSTANCE.exAt(timestamp);","typeGuard":"boolean hasExpiry(Instant t) { return t != null && t.isAfter(Instant.EPOCH); }","tryCatchPattern":"try {\n    GetExArgs.INSTANCE.exAt(expiryAt);\n} catch (IllegalArgumentException e) {\n    throw new IllegalStateException(\"Missing expiry timestamp for GETEX\", e);\n}","preventionTips":["Make expiry fields non-optional in domain models when Redis expiry is mandatory","Validate/repair nullable timestamps right after deserialization","Use Instant.now().plus(default) as fallback for missing deadlines"],"tags":["java","redis","null-argument","validation"],"backgroundTag":"null-argument-validation","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}