Groovy
  1. Groovy
  2. GROOVY-4542

@ConditionalInterrupt AST Transformation

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.8-beta-3
    • Component/s: None
    • Labels:
      None
    • Flags:
      Patch

      Description

      Write an AST Transformation which allows the user to create custom interrupt conditions, instead of the Thread.currentThread().isInterrupted() check from @ThreadInterrupt.

      N.B : Attached patch is not complete. Documentation is not up to date and no test case is attached. Used for discussion only.

        Activity

        Cédric Champeau created issue -
        Hide
        Cédric Champeau added a comment -

        Working version with test cases. Ready for review + commit I guess.

        Show
        Cédric Champeau added a comment - Working version with test cases. Ready for review + commit I guess.
        Cédric Champeau made changes -
        Field Original Value New Value
        Attachment ConditionalInterrupt_AST_Transformation_v2.patch [ 52432 ]
        Hide
        Cédric Champeau added a comment -

        Changing assignee for review. Let me know if it's ok.

        Show
        Cédric Champeau added a comment - Changing assignee for review. Let me know if it's ok.
        Cédric Champeau made changes -
        Assignee Cédric Champeau [ melix ] Hamlet D'Arcy [ hamletdrc ]
        Hamlet D'Arcy made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Hide
        Hamlet D'Arcy added a comment -

        OK, I checked in the first revision. a couple comments:
        1. I changed the exception text to be more descriptive. You may want to look at it.
        2. We need more test cases. there is no coverage for the various loop types.
        3. I will update the Javadoc shortly.

        Show
        Hamlet D'Arcy added a comment - OK, I checked in the first revision. a couple comments: 1. I changed the exception text to be more descriptive. You may want to look at it. 2. We need more test cases. there is no coverage for the various loop types. 3. I will update the Javadoc shortly.
        Hide
        Hamlet D'Arcy added a comment -

        fixed in 1.8. checking in javadoc fixes momentarily

        Show
        Hamlet D'Arcy added a comment - fixed in 1.8. checking in javadoc fixes momentarily
        Hamlet D'Arcy made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Hamlet D'Arcy added a comment -

        checking in final changes now. 2 things:
        1. made the condition method private. There is no need to make it protected, in fact this could open up ways to subvert this annotation (ie it would be unsecure)
        2. Made the condition method return object. That way it participates in Groovy Truth comparisons and not just plain old boolean comparisons.

        Show
        Hamlet D'Arcy added a comment - checking in final changes now. 2 things: 1. made the condition method private. There is no need to make it protected, in fact this could open up ways to subvert this annotation (ie it would be unsecure) 2. Made the condition method return object. That way it participates in Groovy Truth comparisons and not just plain old boolean comparisons.
        Hide
        Cédric Champeau added a comment -

        Looks fine to me. Thanks.

        Show
        Cédric Champeau added a comment - Looks fine to me. Thanks.
        Paul King made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Mark Thomas made changes -
        Project Import Sun Apr 05 13:32:57 UTC 2015 [ 1428240777691 ]
        Mark Thomas made changes -
        Workflow jira [ 12733476 ] Default workflow, editable Closed status [ 12741041 ]
        Mark Thomas made changes -
        Patch Submitted Yes [ 10763 ]
        Flags Patch [ 10430 ]
        Mark Thomas made changes -
        Project Import Mon Apr 06 02:11:23 UTC 2015 [ 1428286283443 ]
        Mark Thomas made changes -
        Workflow jira [ 12967648 ] Default workflow, editable Closed status [ 12975416 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open In Progress In Progress
        4d 21h 25m 1 Hamlet D'Arcy 05/Dec/10 00:35
        In Progress In Progress Resolved Resolved
        2d 10h 42m 1 Hamlet D'Arcy 07/Dec/10 11:17
        Resolved Resolved Closed Closed
        8d 11h 13m 1 Paul King 15/Dec/10 22:31

          People

          • Assignee:
            Hamlet D'Arcy
            Reporter:
            Cédric Champeau
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development