Uploaded image for project: 'Clover'
  1. Clover
  2. CLOV-1934

Allow usage of explicit "this" as first method argument (JSR 308)

    XMLWordPrintable

Details

    • Severity 3 - Minor

    Description

      A follow up of CLOV-1839

      JSR 308 (type annotations) allows to annotate any occurrence of the type.

      As all instance methods have an implicit "this" argument, in order to make it possible to annotate it, the JSR specification extended the grammar for method signatures, so that you can use "this" keyword as argument name (only for a first argument). 

      These two methods are equivalent for javac:

      
      class A { public String toString() { ... } }   
      
      class A { public String toString(A this) { ... } }
      
      

       

      Currently Clover throws parse exception if encounters "this" keyword as name of an argument.

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              mparfianowicz Marek Parfianowicz
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: