langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java
changeset 19132 e2349c075315
parent 19127 8a0cbd5cb055
child 19493 f2028bc02f0c
equal deleted inserted replaced
19131:519fa466d8ba 19132:e2349c075315
  2193                 Type inferred = deferredAttr.attribSpeculative(tree, env, findDiamondResult).type;
  2193                 Type inferred = deferredAttr.attribSpeculative(tree, env, findDiamondResult).type;
  2194                 Type polyPt = allowPoly ?
  2194                 Type polyPt = allowPoly ?
  2195                         syms.objectType :
  2195                         syms.objectType :
  2196                         clazztype;
  2196                         clazztype;
  2197                 if (!inferred.isErroneous() &&
  2197                 if (!inferred.isErroneous() &&
  2198                     types.isAssignable(inferred, pt().hasTag(NONE) ? polyPt : pt(), types.noWarnings)) {
  2198                     (allowPoly && pt() == Infer.anyPoly ?
       
  2199                         types.isSameType(inferred, clazztype) :
       
  2200                         types.isAssignable(inferred, pt().hasTag(NONE) ? polyPt : pt(), types.noWarnings))) {
  2199                     String key = types.isSameType(clazztype, inferred) ?
  2201                     String key = types.isSameType(clazztype, inferred) ?
  2200                         "diamond.redundant.args" :
  2202                         "diamond.redundant.args" :
  2201                         "diamond.redundant.args.1";
  2203                         "diamond.redundant.args.1";
  2202                     log.warning(tree.clazz.pos(), key, clazztype, inferred);
  2204                     log.warning(tree.clazz.pos(), key, clazztype, inferred);
  2203                 }
  2205                 }