langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java
changeset 10198 84698d93792c
parent 10187 983f0e987540
child 10459 3908f37df0fc
equal deleted inserted replaced
10197:28afe0fb34c8 10198:84698d93792c
  1835         ((ClassSymbol) clazztype.tsym).members_field = mapping.snd;
  1835         ((ClassSymbol) clazztype.tsym).members_field = mapping.snd;
  1836         Symbol constructor;
  1836         Symbol constructor;
  1837         try {
  1837         try {
  1838             constructor = rs.resolveDiamond(tree.pos(),
  1838             constructor = rs.resolveDiamond(tree.pos(),
  1839                     localEnv,
  1839                     localEnv,
  1840                     clazztype.tsym.type,
  1840                     clazztype,
  1841                     argtypes,
  1841                     argtypes,
  1842                     typeargtypes);
  1842                     typeargtypes);
  1843         } finally {
  1843         } finally {
  1844             ((ClassSymbol) clazztype.tsym).members_field = mapping.fst;
  1844             ((ClassSymbol) clazztype.tsym).members_field = mapping.fst;
  1845         }
  1845         }
  2870         // Attribute type parameters
  2870         // Attribute type parameters
  2871         List<Type> actuals = attribTypes(tree.arguments, env);
  2871         List<Type> actuals = attribTypes(tree.arguments, env);
  2872 
  2872 
  2873         if (clazztype.tag == CLASS) {
  2873         if (clazztype.tag == CLASS) {
  2874             List<Type> formals = clazztype.tsym.type.getTypeArguments();
  2874             List<Type> formals = clazztype.tsym.type.getTypeArguments();
  2875 
  2875             if (actuals.isEmpty()) //diamond
  2876             if (actuals.length() == formals.length() || actuals.length() == 0) {
  2876                 actuals = formals;
       
  2877 
       
  2878             if (actuals.length() == formals.length()) {
  2877                 List<Type> a = actuals;
  2879                 List<Type> a = actuals;
  2878                 List<Type> f = formals;
  2880                 List<Type> f = formals;
  2879                 while (a.nonEmpty()) {
  2881                 while (a.nonEmpty()) {
  2880                     a.head = a.head.withTypeVar(f.head);
  2882                     a.head = a.head.withTypeVar(f.head);
  2881                     a = a.tail;
  2883                     a = a.tail;