src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java
changeset 58713 ad69fd32778e
parent 57725 ffc34eaf7b49
equal deleted inserted replaced
58712:14e098407bb0 58713:ad69fd32778e
  1393                     target = proxy;
  1393                     target = proxy;
  1394                 } else if (proxy.type.tsym == syms.repeatableType.tsym) {
  1394                 } else if (proxy.type.tsym == syms.repeatableType.tsym) {
  1395                     repeatable = proxy;
  1395                     repeatable = proxy;
  1396                 } else if (proxy.type.tsym == syms.deprecatedType.tsym) {
  1396                 } else if (proxy.type.tsym == syms.deprecatedType.tsym) {
  1397                     sym.flags_field |= (DEPRECATED | DEPRECATED_ANNOTATION);
  1397                     sym.flags_field |= (DEPRECATED | DEPRECATED_ANNOTATION);
  1398                     for (Pair<Name, Attribute> v : proxy.values) {
  1398                     setFlagIfAttributeTrue(proxy, sym, names.forRemoval, DEPRECATED_REMOVAL);
  1399                         if (v.fst == names.forRemoval && v.snd instanceof Attribute.Constant) {
  1399                 }  else if (proxy.type.tsym == syms.previewFeatureType.tsym) {
  1400                             Attribute.Constant c = (Attribute.Constant)v.snd;
  1400                     sym.flags_field |= PREVIEW_API;
  1401                             if (c.type == syms.booleanType && ((Integer)c.value) != 0) {
  1401                     setFlagIfAttributeTrue(proxy, sym, names.essentialAPI, PREVIEW_ESSENTIAL_API);
  1402                                 sym.flags_field |= DEPRECATED_REMOVAL;
  1402                 }
  1403                             }
  1403                 proxies.append(proxy);
  1404                         }
  1404             }
       
  1405         }
       
  1406         annotate.normal(new AnnotationCompleter(sym, proxies.toList()));
       
  1407     }
       
  1408     //where:
       
  1409         private void setFlagIfAttributeTrue(CompoundAnnotationProxy proxy, Symbol sym, Name attribute, long flag) {
       
  1410             for (Pair<Name, Attribute> v : proxy.values) {
       
  1411                 if (v.fst == attribute && v.snd instanceof Attribute.Constant) {
       
  1412                     Attribute.Constant c = (Attribute.Constant)v.snd;
       
  1413                     if (c.type == syms.booleanType && ((Integer)c.value) != 0) {
       
  1414                         sym.flags_field |= flag;
  1405                     }
  1415                     }
  1406                 }
  1416                 }
  1407                 proxies.append(proxy);
  1417             }
  1408             }
  1418         }
  1409         }
       
  1410         annotate.normal(new AnnotationCompleter(sym, proxies.toList()));
       
  1411     }
       
  1412 
  1419 
  1413     /** Read parameter annotations.
  1420     /** Read parameter annotations.
  1414      */
  1421      */
  1415     void readParameterAnnotations(Symbol meth) {
  1422     void readParameterAnnotations(Symbol meth) {
  1416         int numParameters = buf.getByte(bp++) & 0xFF;
  1423         int numParameters = buf.getByte(bp++) & 0xFF;