u1 vs. u2 in JSR 308 classfile format

Michael Ernst mernst at cs.washington.edu
Sat Dec 22 21:13:48 PST 2012


The JSR 308 class file format contains what seems like a rather haphazard
choices between u1 and u2, for values that we expect to be small as a rule:

    type_parameter_target {
	u1 type_parameter_index;
    };

    supertype_target {
	u2 supertype_index;
    };

    type_parameter_bound_target {
	u1 type_parameter_index;
	u1 bound_index;
    };

    method_parameter_target {
	u1 method_parameter_index;
    };

    throws_target {
	u2 throws_type_index;
    };

(By contrast, it's good to use u2 for indices into code, exception tables,
etc.)

Should all of these be made u1?  This is a rather minor issue either way.

		    -Mike


More information about the type-annotations-spec-experts mailing list