Skip to content

Add compile-time validation for effectively always cancelling listeners #110

@PaintNinja

Description

@PaintNinja

The validator detects and warns for effectively never cancelling listeners, however effectively always cancelling ones have been overlooked.

@SubscribeEvent
boolean neverCancellingListener(ExampleCancellableEvent event) {
    return false; // validator suggests changing this method’s return type to void because it’s always returning false
}

@SubscribeEvent
boolean alwaysCancellingListener(ExampleCancellableEvent event) {
    return true; // it would be good if the compile-time validator detected this and suggested changing this method’s return type to void and putting @SubscribeEvent(alwaysCancelling = true)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions