langtools/src/share/classes/com/sun/tools/javac/code/Types.java
changeset 13689 4d519199a6aa
parent 13633 0ea4283af723
child 14048 308d1cf8fe46
equal deleted inserted replaced
13636:bee2d435e11f 13689:4d519199a6aa
  1356             result++;
  1356             result++;
  1357             t = elemtype(t);
  1357             t = elemtype(t);
  1358         }
  1358         }
  1359         return result;
  1359         return result;
  1360     }
  1360     }
       
  1361 
       
  1362     /**
       
  1363      * Returns an ArrayType with the component type t
       
  1364      *
       
  1365      * @param t The component type of the ArrayType
       
  1366      * @return the ArrayType for the given component
       
  1367      */
       
  1368     public ArrayType makeArrayType(Type t) {
       
  1369         if (t.tag == VOID ||
       
  1370             t.tag >= PACKAGE) {
       
  1371             Assert.error("Type t must not be a a VOID or PACKAGE type, " + t.toString());
       
  1372         }
       
  1373         return new ArrayType(t, syms.arrayClass);
       
  1374     }
  1361     // </editor-fold>
  1375     // </editor-fold>
  1362 
  1376 
  1363     // <editor-fold defaultstate="collapsed" desc="asSuper">
  1377     // <editor-fold defaultstate="collapsed" desc="asSuper">
  1364     /**
  1378     /**
  1365      * Return the (most specific) base type of t that starts with the
  1379      * Return the (most specific) base type of t that starts with the
  3809 
  3823 
  3810 
  3824 
  3811     // <editor-fold defaultstate="collapsed" desc="Annotation support">
  3825     // <editor-fold defaultstate="collapsed" desc="Annotation support">
  3812 
  3826 
  3813     public RetentionPolicy getRetention(Attribute.Compound a) {
  3827     public RetentionPolicy getRetention(Attribute.Compound a) {
       
  3828         return getRetention(a.type.tsym);
       
  3829     }
       
  3830 
       
  3831     public RetentionPolicy getRetention(Symbol sym) {
  3814         RetentionPolicy vis = RetentionPolicy.CLASS; // the default
  3832         RetentionPolicy vis = RetentionPolicy.CLASS; // the default
  3815         Attribute.Compound c = a.type.tsym.attribute(syms.retentionType.tsym);
  3833         Attribute.Compound c = sym.attribute(syms.retentionType.tsym);
  3816         if (c != null) {
  3834         if (c != null) {
  3817             Attribute value = c.member(names.value);
  3835             Attribute value = c.member(names.value);
  3818             if (value != null && value instanceof Attribute.Enum) {
  3836             if (value != null && value instanceof Attribute.Enum) {
  3819                 Name levelName = ((Attribute.Enum)value).value.name;
  3837                 Name levelName = ((Attribute.Enum)value).value.name;
  3820                 if (levelName == names.SOURCE) vis = RetentionPolicy.SOURCE;
  3838                 if (levelName == names.SOURCE) vis = RetentionPolicy.SOURCE;