Groovy
  1. Groovy
  2. GROOVY-2725

Semicolon required for certain generics declarations

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.5.4
    • Fix Version/s: 1.6-beta-1, 1.5.7
    • Component/s: parser-antlr
    • Labels:
      None

      Description

      According to this thread:
      http://markmail.org/message/us25dkia37qif75f

      It seems that sometimes a semi-colon is required after a generics declaration with type coercion.
      The semi shouldn't be needed.

       import java.util.concurrent.atomic.AtomicInteger
      
       public class ThreadId
       {
        // Atomic integer containing the next thread ID to be assigned
        private static final AtomicInteger nextId = new AtomicInteger(0)
      
        // Thread local variable containing each thread's ID
        private static final ThreadLocal<Integer> threadId = [
                        initialValue: { return nextId.getAndIncrement() }
                        ] as ThreadLocal<Integer>;
       // The Semi-colon at the end of the prior line seems to be required.
      
      
        // Returns the current thread's unique ID, assigning it if necessary
        public static int get()
        {
            System.out.println( "Thread ID: " + threadId.get());
            return threadId.get();
        }
      
      
        public static void main( String[] args )
        {
            1.upto(3) {
                Thread.start { new ThreadId().get(); }
      
      
            }
        }
      
       }
      

        Activity

        Guillaume Delcroix created issue -
        Guillaume Delcroix made changes -
        Field Original Value New Value
        Fix Version/s 1.5.5 [ 14028 ]
        Fix Version/s 1.5.6 [ 14189 ]
        Jochen Theodorou made changes -
        Fix Version/s 1.5.6 [ 14189 ]
        Fix Version/s 1.5.7 [ 14242 ]
        Jochen Theodorou made changes -
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Closed [ 6 ]
        Mark Thomas made changes -
        Project Import Sun Apr 05 13:32:57 UTC 2015 [ 1428240777691 ]
        Mark Thomas made changes -
        Workflow jira [ 12731751 ] Default workflow, editable Closed status [ 12743650 ]
        Mark Thomas made changes -
        Project Import Mon Apr 06 02:11:23 UTC 2015 [ 1428286283443 ]
        Mark Thomas made changes -
        Workflow jira [ 12973294 ] Default workflow, editable Closed status [ 12979114 ]

          People

          • Assignee:
            Jochen Theodorou
            Reporter:
            Guillaume Delcroix
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development