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

XMLWordPrintable

    • Severity 3 - Minor

      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.

       

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

              Created:
              Updated:
              Resolved: