Skip to content

ScheduledFutureTask#delayNanos doesn't return negative values #7840

@Scottmitch

Description

@Scottmitch

ScheduledFutureTask#delayNanos doesn't return negative values [1], but it looks like the Delayed allows negative values to represent "the delay has elapsed". Do we always need to limit to positive values, and can we remove some computation here?

It looks like NioEventLoop may be depending upon the non-negative values [2].

[1] https://github.com/netty/netty/blob/4.1/common/src/main/java/io/netty/util/concurrent/ScheduledFutureTask.java#L85-L91
[2] https://github.com/netty/netty/blob/4.1/transport/src/main/java/io/netty/channel/nio/NioEventLoop.java#L732

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions