[Checkers] Class file format for wildcard bounds

Mahmood Ali mahmood at MIT.EDU
Wed Feb 4 05:14:34 EST 2009


Greetings,

Thanks for the clarification request.

I take back the discussions of bound_index.  Unlike type parameters,  
it's illegal syntactically to specify an intersection type, e.g. '?  
extends A & B'.

The problem is that we need to describe the wildcard location, and I  
was suggesting that we reuse the same type annotations mechanism, as  
specified with:

The current spec specifies:
   {
     u1 wildcard_location_type;   // the location tag of the wildcard
     {
         ...
     } reference_info;  // uniquely identifies the wildcard
   } reference_info

wildcard_location_type is analogues to annotation's target_type and  
takes all of its values.

Here is a set of examples:

(1)
   void m(List<? extends @A String> lst) { }

@A is described as:
   target_type = WILDCARD_BOUND
   reference_info =
     {
       wildcard_location_type = METHOD_PARAMETER (0x0C)
       wildcard_location =
         {
           u1 parameter_index = 0;
         }
     }

(2)
   Map<Object, ? extends List<@A String>> newMap() { ... }

@A is described as:
   target_type = WILDCARD_BOUND_GENERIC_OR_ARRAY
   reference_info =
   {
     // location of wildcard: type argument of the return type
     wildcard_location_type = RETURN_TYPE_GENERIC_OR_ARRAY;
     wildcard_location =
     {
       // the second type variable
       location_length = 1;
       location = { 1 };
     }
     // the generic information of the annotation itself
     location_length = 1;
     location = { 0 };
   }

Regards,
Mahmood




More information about the checkers mailing list