groovy
  1. groovy
  2. GROOVY-4542

@ConditionalInterrupt AST Transformation

    Details

    • Type: New Feature New Feature
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.8-beta-3
    • Component/s: None
    • Labels:
      None
    • Patch Submitted:
      Yes
    • Number of attachments :
      2

      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

        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.
        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.
        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
        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.

          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: