langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java
changeset 16331 fafe9741fb7e
parent 16330 66e277848a69
child 16333 a6e1ded87200
equal deleted inserted replaced
16330:66e277848a69 16331:fafe9741fb7e
  2149                     //create a 'fake' diamond AST node by removing type-argument trees
  2149                     //create a 'fake' diamond AST node by removing type-argument trees
  2150                     ta.arguments = List.nil();
  2150                     ta.arguments = List.nil();
  2151                     ResultInfo findDiamondResult = new ResultInfo(VAL,
  2151                     ResultInfo findDiamondResult = new ResultInfo(VAL,
  2152                             resultInfo.checkContext.inferenceContext().free(resultInfo.pt) ? Type.noType : pt());
  2152                             resultInfo.checkContext.inferenceContext().free(resultInfo.pt) ? Type.noType : pt());
  2153                     Type inferred = deferredAttr.attribSpeculative(tree, env, findDiamondResult).type;
  2153                     Type inferred = deferredAttr.attribSpeculative(tree, env, findDiamondResult).type;
       
  2154                     Type polyPt = allowPoly ?
       
  2155                             syms.objectType :
       
  2156                             clazztype;
  2154                     if (!inferred.isErroneous() &&
  2157                     if (!inferred.isErroneous() &&
  2155                         types.isAssignable(inferred, pt().hasTag(NONE) ? syms.objectType : pt(), types.noWarnings)) {
  2158                         types.isAssignable(inferred, pt().hasTag(NONE) ? polyPt : pt(), types.noWarnings)) {
  2156                         String key = types.isSameType(clazztype, inferred) ?
  2159                         String key = types.isSameType(clazztype, inferred) ?
  2157                             "diamond.redundant.args" :
  2160                             "diamond.redundant.args" :
  2158                             "diamond.redundant.args.1";
  2161                             "diamond.redundant.args.1";
  2159                         log.warning(tree.clazz.pos(), key, clazztype, inferred);
  2162                         log.warning(tree.clazz.pos(), key, clazztype, inferred);
  2160                     }
  2163                     }