6922300: [308] populate the reference_info for type annotations targeting primitive class literals
authorjjg
Wed, 03 Feb 2010 11:33:57 -0800
changeset 4875 e7607996f83d
parent 4874 67e82eb7b395
child 4876 321ed2a5afcf
6922300: [308] populate the reference_info for type annotations targeting primitive class literals Reviewed-by: darcy, jjg Contributed-by: mali@csail.mit.edu, mernst@cs.washington.edu
langtools/src/share/classes/com/sun/tools/javac/jvm/Gen.java
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/Gen.java	Wed Feb 03 11:28:21 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/Gen.java	Wed Feb 03 11:33:57 2010 -0800
@@ -2158,6 +2158,11 @@
             code.emitop2(ldc2, makeRef(tree.pos(), tree.selected.type));
             result = items.makeStackItem(pt);
             return;
+        } else if (tree.name == names.TYPE) {
+            // Set the annotation positions for primitive class literals
+            // (e.g. int.class) which have been converted to TYPE field
+            // access on the corresponding boxed type (e.g. Integer.TYPE).
+            setTypeAnnotationPositions(tree.pos);
         }
 
         Symbol ssym = TreeInfo.symbol(tree.selected);