diff -r 9199b9092f73 -r 1aa81917016a src/share/classes/com/sun/tools/javac/comp/Infer.java --- a/src/share/classes/com/sun/tools/javac/comp/Infer.java Tue Jan 27 18:38:39 2009 -0800 +++ b/src/share/classes/com/sun/tools/javac/comp/Infer.java Thu Jan 29 12:17:57 2009 +0000 @@ -154,33 +154,15 @@ that.inst = syms.objectType; else if (that.hibounds.tail.isEmpty()) that.inst = that.hibounds.head; - else { - for (List bs = that.hibounds; - bs.nonEmpty() && that.inst == null; - bs = bs.tail) { - // System.out.println("hibounds = " + that.hibounds);//DEBUG - if (isSubClass(bs.head, that.hibounds)) - that.inst = types.fromUnknownFun.apply(bs.head); - } - if (that.inst == null) { - int classCount = 0, interfaceCount = 0; - for (Type t : that.hibounds) { - if (t.tag == CLASS) { - if (t.isInterface()) - interfaceCount++; - else - classCount++; - } - } - if ((that.hibounds.size() == classCount + interfaceCount) && classCount == 1) - that.inst = types.makeCompoundType(that.hibounds); - } - if (that.inst == null || !types.isSubtypeUnchecked(that.inst, that.hibounds, warn)) - throw ambiguousNoInstanceException - .setMessage("no.unique.maximal.instance.exists", - that.qtype, that.hibounds); - } + else + that.inst = types.glb(that.hibounds); } + if (that.inst == null || + that.inst.isErroneous() || + !types.isSubtypeUnchecked(that.inst, that.hibounds, warn)) + throw ambiguousNoInstanceException + .setMessage("no.unique.maximal.instance.exists", + that.qtype, that.hibounds); } //where private boolean isSubClass(Type t, final List ts) {