[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-distro-pkg-dev
Subject:    [1.7, 1.8, 1.9 BACKPORT]: /hg/icedtea6: S6638712: Inference with wildcard types
From:       ahughes () redhat ! com (Dr Andrew John Hughes)
Date:       2010-09-30 19:27:21
Message-ID: 20100930192721.GC28424 () rivendell ! middle-earth ! co ! uk
[Download RAW message or body]

On 15:17 Wed 29 Sep     , Deepak Bhole wrote:
> * Dr Andrew John Hughes <ahughes at redhat.com> [2010-09-20 10:32]:
> > Ok for 1.7, 1.8 and 1.9?
> > 
> 
> Looks okay to me for backport as well. It fixes an important issue that
> multiple people have encountered.
> 
> Cheers,
> Deepak
> 
> > ----- Forwarded message from andrew at icedtea.classpath.org -----
> > 
> > Date: Thu, 16 Sep 2010 23:12:05 +0000
> > From: andrew at icedtea.classpath.org
> > To: distro-pkg-dev at openjdk.java.net
> > Subject: /hg/icedtea6: S6638712: Inference with wildcard types causes sel...
> > 
> > changeset 63024b10e2ef in /hg/icedtea6
> > details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=63024b10e2ef
> > author: Andrew John Hughes <ahughes at redhat.com>
> > date: Thu Sep 16 23:36:39 2010 +0100
> > 
> > 	S6638712: Inference with wildcard types causes selection of
> > 	inapplicable method S6650759: Inference of formal type parameter
> > 	(unused in formal parameters) is not performed
> > 
> > 	2010-09-09 Andrew John Hughes <ahughes at redhat.com>
> > 
> > 	 * Makefile.am: Add new patches.
> > 		* NEWS: Document new patches. Fix key.
> > 		* patches/openjdk/6638712-wildcard_types.patch,
> > 		* patches/openjdk/6650759-missing_inference.patch: Fix failure
> > 	in javac compilation.
> > 
> > 
> > diffstat:
> > 
> > 5 files changed, 1582 insertions(+), 3 deletions(-)
> > ChangeLog                                       |   10 
> > Makefile.am                                     |    4 
> > NEWS                                            |    4 
> > patches/openjdk/6638712-wildcard_types.patch    |  669 +++++++++++++++++
> > patches/openjdk/6650759-missing_inference.patch |  898 +++++++++++++++++++++++
> > 
> > diffs (truncated from 1626 to 500 lines):
> > 
> > diff -r a1ccc755c8f7 -r 63024b10e2ef ChangeLog
> > --- a/ChangeLog	Thu Sep 16 14:53:19 2010 -0400
> > +++ b/ChangeLog	Thu Sep 16 23:36:39 2010 +0100
> > @@ -1,4 +1,12 @@ 2010-09-16	Deepak Bhole <dbhole at redhat.c
> > -2010-09-16	Deepak Bhole <dbhole at redhat.com>
> > +2010-09-09  Andrew John Hughes  <ahughes at redhat.com>
> > +
> > +	* Makefile.am: Add new patches.
> > +	* NEWS: Document new patches.  Fix key.
> > +	* patches/openjdk/6638712-wildcard_types.patch,
> > +	* patches/openjdk/6650759-missing_inference.patch:
> > +	Fix failure in javac compilation.
> > +
> > +2010-09-16  Deepak Bhole <dbhole at redhat.com>
> > 
> > 	* plugin/icedteanp/java/sun/applet/PluginAppletViewer.java
> > 	(handleMessage): Output initialization info only in debug mode.
> > diff -r a1ccc755c8f7 -r 63024b10e2ef Makefile.am
> > --- a/Makefile.am	Thu Sep 16 14:53:19 2010 -0400
> > +++ b/Makefile.am	Thu Sep 16 23:36:39 2010 +0100
> > @@ -295,7 +295,9 @@ ICEDTEA_PATCHES = \
> > 	patches/icedtea-too-many-args.patch \
> > 	patches/icedtea-jtreg-OpenGLContextInit.patch \
> > 	patches/openjdk/6969395-net_bugs.patch \
> > -	patches/openjdk/6510892-httpserver_test.patch
> > +	patches/openjdk/6510892-httpserver_test.patch \
> > +	patches/openjdk/6638712-wildcard_types.patch \
> > +	patches/openjdk/6650759-missing_inference.patch
> > 
> > if WITH_RHINO
> > ICEDTEA_PATCHES += \
> > diff -r a1ccc755c8f7 -r 63024b10e2ef NEWS
> > --- a/NEWS	Thu Sep 16 14:53:19 2010 -0400
> > +++ b/NEWS	Thu Sep 16 23:36:39 2010 +0100
> > @@ -1,6 +1,6 @@ Key:
> > Key:
> > 
> > -SX  - http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6969395
> > +SX  - http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=X
> > PRX - http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=X
> > RHX - https://bugzilla.redhat.com/show_bug.cgi?id=X
> > DX  - http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=X
> > @@ -14,6 +14,8 @@ New in release 1.10 (2010-XX-XX):
> > - S4356282, RH525870: RFE: T2K should be used to rasterize CID/CFF fonts
> > - S6954424: Support OpenType/CFF fonts in JDK 7
> > - S6438179: XToolkit.isTraySupported() result has nothing to do with the system \
> > tray +  - S6638712: Inference with wildcard types causes selection of \
> > inapplicable method +  - S6650759: Inference of formal type parameter (unused in \
> >                 formal parameters) is not performed
> > * Netx
> > - A new man page for javaws.
> > * Plugin  
> > diff -r a1ccc755c8f7 -r 63024b10e2ef patches/openjdk/6638712-wildcard_types.patch
> > --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
> > +++ b/patches/openjdk/6638712-wildcard_types.patch	Thu Sep 16 23:36:39 2010 +0100
> > @@ -0,0 +1,669 @@
> > +diff -Nru openjdk.orig/langtools/src/share/classes/com/sun/tools/javac/code/Type.java \
> > openjdk/langtools/src/share/classes/com/sun/tools/javac/code/Type.java +--- \
> > openjdk.orig/langtools/src/share/classes/com/sun/tools/javac/code/Type.java	2010-06-21 \
> > 22:16:20.000000000 +0100 ++++ \
> > openjdk/langtools/src/share/classes/com/sun/tools/javac/code/Type.java	2010-09-09 \
> > 19:54:58.054019539 +0100 +@@ -1061,6 +1061,21 @@
> > +             return qtype.isErroneous();
> > +         }
> > + 
> > ++        /**
> > ++         * Replaces this ForAll's typevars with a set of concrete Java types
> > ++         * and returns the instantiated generic type. Subclasses might override
> > ++         * in order to check that the list of types is a valid instantiation
> > ++         * of the ForAll's typevars.
> > ++         *
> > ++         * @param actuals list of actual types
> > ++         * @param types types instance
> > ++         * @return qtype where all occurrences of tvars are replaced
> > ++         * by types in actuals
> > ++         */
> > ++        public Type inst(List<Type> actuals, Types types) {
> > ++            return types.subst(qtype, tvars, actuals);
> > ++        }
> > ++
> > +         public Type map(Mapping f) {
> > +             return f.apply(qtype);
> > +         }
> > +diff -Nru openjdk.orig/langtools/src/share/classes/com/sun/tools/javac/code/Types.java \
> > openjdk/langtools/src/share/classes/com/sun/tools/javac/code/Types.java +--- \
> > openjdk.orig/langtools/src/share/classes/com/sun/tools/javac/code/Types.java	2010-06-21 \
> > 22:16:20.000000000 +0100 ++++ \
> > openjdk/langtools/src/share/classes/com/sun/tools/javac/code/Types.java	2010-09-09 \
> > 19:54:58.054019539 +0100 +@@ -331,6 +331,14 @@
> > +         if (s.tag >= firstPartialTag)
> > +             return isSuperType(s, t);
> > + 
> > ++        if (s.isCompound()) {
> > ++            for (Type s2 : interfaces(s).prepend(supertype(s))) {
> > ++                if (!isSubtype(t, s2, capture))
> > ++                    return false;
> > ++            }
> > ++            return true;
> > ++        }
> > ++
> > +         Type lower = lowerBound(s);
> > +         if (s != lower)
> > +             return isSubtype(capture ? capture(t) : t, lower, false);
> > +@@ -2766,6 +2774,14 @@
> > +     /**
> > +      * Capture conversion as specified by JLS 3rd Ed.
> > +      */
> > ++
> > ++    public List<Type> capture(List<Type> ts) {
> > ++        List<Type> buf = List.nil();
> > ++        for (Type t : ts) {
> > ++            buf = buf.prepend(capture(t));
> > ++        }
> > ++        return buf.reverse();
> > ++    }
> > +     public Type capture(Type t) {
> > +         if (t.tag != CLASS)
> > +             return t;
> > +diff -Nru openjdk.orig/langtools/src/share/classes/com/sun/tools/javac/comp/Check.java \
> > openjdk/langtools/src/share/classes/com/sun/tools/javac/comp/Check.java +--- \
> > openjdk.orig/langtools/src/share/classes/com/sun/tools/javac/comp/Check.java	2010-06-21 \
> > 22:16:20.000000000 +0100 ++++ \
> > openjdk/langtools/src/share/classes/com/sun/tools/javac/comp/Check.java	2010-09-09 \
> > 19:54:58.054019539 +0100 +@@ -383,6 +383,10 @@
> > +                                      JCDiagnostic.fragment("incompatible.types" \
> > + (d!=null ? ".1" : ""), d), +                                      t, pt);
> > +                 }
> > ++            } catch (Infer.InvalidInstanceException ex) {
> > ++                JCDiagnostic d = ex.getDiagnostic();
> > ++                log.error(pos, "invalid.inferred.types", t.tvars, d);
> > ++                return syms.errType;
> > +             }
> > +         }
> > +     }
> > +diff -Nru openjdk.orig/langtools/src/share/classes/com/sun/tools/javac/comp/Infer.java \
> > openjdk/langtools/src/share/classes/com/sun/tools/javac/comp/Infer.java +--- \
> > openjdk.orig/langtools/src/share/classes/com/sun/tools/javac/comp/Infer.java	2010-06-21 \
> > 22:16:20.000000000 +0100 ++++ \
> > openjdk/langtools/src/share/classes/com/sun/tools/javac/comp/Infer.java	2010-09-09 \
> > 20:00:32.891268438 +0100 +@@ -29,6 +29,7 @@
> > + import com.sun.tools.javac.util.List;
> > + import com.sun.tools.javac.code.*;
> > + import com.sun.tools.javac.code.Type.*;
> > ++import com.sun.tools.javac.code.Symbol.*;
> > + 
> > + import static com.sun.tools.javac.code.Flags.*;
> > + import static com.sun.tools.javac.code.Kinds.*;
> > +@@ -50,6 +51,7 @@
> > + 
> > +     Symtab syms;
> > +     Types types;
> > ++    Resolve rs;
> > + 
> > +     public static Infer instance(Context context) {
> > +         Infer instance = context.get(inferKey);
> > +@@ -62,43 +64,51 @@
> > +         context.put(inferKey, this);
> > +         syms = Symtab.instance(context);
> > +         types = Types.instance(context);
> > ++        rs = Resolve.instance(context);
> > +     }
> > + 
> > +-    public static class NoInstanceException extends RuntimeException {
> > ++    public static class InferenceException extends RuntimeException {
> > +         private static final long serialVersionUID = 0;
> > + 
> > +-        boolean isAmbiguous; // exist several incomparable best instances?
> > +-
> > +         JCDiagnostic diagnostic;
> > + 
> > +-        NoInstanceException(boolean isAmbiguous) {
> > ++        InferenceException() {
> > +             this.diagnostic = null;
> > +-            this.isAmbiguous = isAmbiguous;
> > +-        }
> > +-        NoInstanceException setMessage(String key) {
> > +-            this.diagnostic = JCDiagnostic.fragment(key);
> > +-            return this;
> > +-        }
> > +-        NoInstanceException setMessage(String key, Object arg1) {
> > +-            this.diagnostic = JCDiagnostic.fragment(key, arg1);
> > +-            return this;
> > +-        }
> > +-        NoInstanceException setMessage(String key, Object arg1, Object arg2) {
> > +-            this.diagnostic = JCDiagnostic.fragment(key, arg1, arg2);
> > +-            return this;
> > +         }
> > +-        NoInstanceException setMessage(String key, Object arg1, Object arg2, \
> > Object arg3) { +-            this.diagnostic = JCDiagnostic.fragment(key, arg1, \
> > arg2, arg3); ++        InferenceException setMessage(String key, Object... args) \
> > { ++            this.diagnostic = JCDiagnostic.fragment(key, args);
> > +             return this;
> > +         }
> > ++
> > +         public JCDiagnostic getDiagnostic() {
> > +             return diagnostic;
> > +         }
> > +     }
> > ++
> > ++    public static class NoInstanceException extends InferenceException {
> > ++        private static final long serialVersionUID = 1;
> > ++
> > ++        boolean isAmbiguous; // exist several incomparable best instances?
> > ++
> > ++        NoInstanceException(boolean isAmbiguous) {
> > ++            super();
> > ++            this.isAmbiguous = isAmbiguous;
> > ++       }
> > ++    }
> > ++
> > ++    public static class InvalidInstanceException extends InferenceException {
> > ++        private static final long serialVersionUID = 2;
> > ++
> > ++        InvalidInstanceException() {
> > ++            super();
> > ++        }
> > ++    }
> > ++
> > +     private final NoInstanceException ambiguousNoInstanceException =
> > +         new NoInstanceException(true);
> > +     private final NoInstanceException unambiguousNoInstanceException =
> > +         new NoInstanceException(false);
> > ++    private final InvalidInstanceException invalidInstanceException = new \
> > InvalidInstanceException(); + 
> > + /***************************************************************************
> > +  * Auxiliary type values and classes
> > +@@ -247,7 +257,7 @@
> > +      */
> > +     public Type instantiateExpr(ForAll that,
> > +                                 Type to,
> > +-                                Warner warn) throws NoInstanceException {
> > ++                                Warner warn) throws InferenceException {
> > +         List<Type> undetvars = Type.map(that.tvars, fromTypeVarFun);
> > +         for (List<Type> l = undetvars; l.nonEmpty(); l = l.tail) {
> > +             UndetVar v = (UndetVar) l.head;
> > +@@ -273,8 +283,7 @@
> > +         List<Type> targs = Type.map(undetvars, getInstFun);
> > +         targs = types.subst(targs, that.tvars, targs);
> > +         checkWithinBounds(that.tvars, targs, warn);
> > +-
> > +-        return getInstFun.apply(qtype1);
> > ++        return that.inst(targs, types);
> > +     }
> > + 
> > +     /** Instantiate method type `mt' by finding instantiations of
> > +@@ -282,36 +291,42 @@
> > +      */
> > +     public Type instantiateMethod(List<Type> tvars,
> > +                                   MethodType mt,
> > +-                                  List<Type> argtypes,
> > +-                                  boolean allowBoxing,
> > +-                                  boolean useVarargs,
> > +-                                  Warner warn) throws NoInstanceException {
> > ++                                  final List<Type> argtypes,
> > ++                                  final boolean allowBoxing,
> > ++                                  final boolean useVarargs,
> > ++                                  final Warner warn) throws InferenceException \
> > { +         //-System.err.println("instantiateMethod(" + tvars + ", " + mt + ", " \
> > + argtypes + ")"); //DEBUG +         List<Type> undetvars = Type.map(tvars, \
> > fromTypeVarFun); +         List<Type> formals = mt.argtypes;
> > +-
> > ++        //need to capture exactly once - otherwise subsequent
> > ++        //applicability checks might fail
> > ++        final List<Type> capturedArgs = types.capture(argtypes);
> > ++        List<Type> actuals = capturedArgs;
> > ++        List<Type> actualsNoCapture = argtypes;
> > +         // instantiate all polymorphic argument types and
> > +         // set up lower bounds constraints for undetvars
> > +         Type varargsFormal = useVarargs ? formals.last() : null;
> > +-        while (argtypes.nonEmpty() && formals.head != varargsFormal) {
> > +-            Type ft = formals.head;
> > +-            Type at = argtypes.head.baseType();
> > +-            if (at.tag == FORALL)
> > +-                at = instantiateArg((ForAll) at, ft, tvars, warn);
> > +-            Type sft = types.subst(ft, tvars, undetvars);
> > ++        while (actuals.nonEmpty() && formals.head != varargsFormal) {
> > ++            Type formal = formals.head;
> > ++            Type actual = actuals.head.baseType();
> > ++            Type actualNoCapture = actualsNoCapture.head.baseType();
> > ++            if (actual.tag == FORALL)
> > ++                actual = instantiateArg((ForAll)actual, formal, tvars, warn);
> > ++            Type undetFormal = types.subst(formal, tvars, undetvars);
> > +             boolean works = allowBoxing
> > +-                ? types.isConvertible(at, sft, warn)
> > +-                : types.isSubtypeUnchecked(at, sft, warn);
> > ++                ? types.isConvertible(actual, undetFormal, warn)
> > ++                : types.isSubtypeUnchecked(actual, undetFormal, warn);
> > +             if (!works) {
> > +                 throw unambiguousNoInstanceException
> > +                     .setMessage("no.conforming.assignment.exists",
> > +-                                tvars, at, ft);
> > ++                                tvars, actualNoCapture, formal);
> > +             }
> > +             formals = formals.tail;
> > +-            argtypes = argtypes.tail;
> > ++            actuals = actuals.tail;
> > ++            actualsNoCapture = actualsNoCapture.tail;
> > +         }
> > +         if (formals.head != varargsFormal || // not enough args
> > +-            !useVarargs && argtypes.nonEmpty()) { // too many args
> > ++            !useVarargs && actuals.nonEmpty()) { // too many args
> > +             // argument lists differ in length
> > +             throw unambiguousNoInstanceException
> > +                 .setMessage("arg.length.mismatch");
> > +@@ -319,20 +334,21 @@
> > + 
> > +         // for varargs arguments as well
> > +         if (useVarargs) {
> > +-            Type elt = types.elemtype(varargsFormal);
> > +-            Type sft = types.subst(elt, tvars, undetvars);
> > +-            while (argtypes.nonEmpty()) {
> > +-                Type ft = sft;
> > +-                Type at = argtypes.head.baseType();
> > +-                if (at.tag == FORALL)
> > +-                    at = instantiateArg((ForAll) at, ft, tvars, warn);
> > +-                boolean works = types.isConvertible(at, sft, warn);
> > ++            Type elemType = types.elemtype(varargsFormal);
> > ++            Type elemUndet = types.subst(elemType, tvars, undetvars);
> > ++            while (actuals.nonEmpty()) {
> > ++                Type actual = actuals.head.baseType();
> > ++                Type actualNoCapture = actualsNoCapture.head.baseType();
> > ++                if (actual.tag == FORALL)
> > ++                    actual = instantiateArg((ForAll)actual, elemType, tvars, \
> > warn); ++                boolean works = types.isConvertible(actual, elemUndet, \
> > warn); +                 if (!works) {
> > +                     throw unambiguousNoInstanceException
> > +                         .setMessage("no.conforming.assignment.exists",
> > +-                                    tvars, at, ft);
> > ++                                    tvars, actualNoCapture, elemType);
> > +                 }
> > +-                argtypes = argtypes.tail;
> > ++                actuals = actuals.tail;
> > ++                actualsNoCapture = actualsNoCapture.tail;
> > +             }
> > +         }
> > + 
> > +@@ -363,16 +379,38 @@
> > +         }
> > +         checkWithinBounds(tvars, undettypes.toList(), warn);
> > + 
> > ++        mt = (MethodType)types.subst(mt, tvars, insttypes.toList());
> > ++
> > +         if (!restvars.isEmpty()) {
> > +             // if there are uninstantiated variables,
> > +             // quantify result type with them
> > +-            mt = new MethodType(mt.argtypes,
> > +-                                new ForAll(restvars.toList(), mt.restype),
> > +-                                mt.thrown, syms.methodClass);
> > ++            final List<Type> inferredTypes = insttypes.toList();
> > ++            final List<Type> all_tvars = tvars; //this is the wrong tvars
> > ++            final MethodType mt2 = new MethodType(mt.argtypes, null, mt.thrown, \
> > syms.methodClass); ++            mt2.restype = new ForAll(restvars.toList(), \
> > mt.restype) { ++                @Override
> > ++                public Type inst(List<Type> inferred, Types types) throws \
> > NoInstanceException { ++                    List<Type> formals = \
> > types.subst(mt2.argtypes, tvars, inferred); ++                   if \
> > (!rs.argumentsAcceptable(capturedArgs, formals, ++                           \
> > allowBoxing, useVarargs, warn)) { ++                      // inferred method is \
> > not applicable ++                      throw \
> > invalidInstanceException.setMessage("inferred.do.not.conform.to.params", formals, \
> > argtypes); ++                   }
> > ++                   // check that inferred bounds conform to their bounds
> > ++                   checkWithinBounds(all_tvars,
> > ++                           types.subst(inferredTypes, tvars, inferred), warn);
> > ++                   return super.inst(inferred, types);
> > ++            }};
> > ++            return mt2;
> > ++        }
> > ++        else if (!rs.argumentsAcceptable(capturedArgs, mt.getParameterTypes(), \
> > allowBoxing, useVarargs, warn)) { ++            // inferred method is not \
> > applicable ++            throw \
> > invalidInstanceException.setMessage("inferred.do.not.conform.to.params", \
> > mt.getParameterTypes(), argtypes); ++        }
> > ++        else {
> > ++            // return instantiated version of method type
> > ++            return mt;
> > +         }
> > +-
> > +-        // return instantiated version of method type
> > +-        return types.subst(mt, tvars, insttypes.toList());
> > +     }
> > +     //where
> > + 
> > +@@ -384,7 +422,7 @@
> > +         private Type instantiateArg(ForAll that,
> > +                                     Type to,
> > +                                     List<Type> tvars,
> > +-                                    Warner warn) throws NoInstanceException {
> > ++                                    Warner warn) throws InferenceException {
> > +             List<Type> targs;
> > +             try {
> > +                 return instantiateExpr(that, to, warn);
> > +@@ -401,16 +439,16 @@
> > +     private void checkWithinBounds(List<Type> tvars,
> > +                                    List<Type> arguments,
> > +                                    Warner warn)
> > +-        throws NoInstanceException {
> > ++        throws InvalidInstanceException {
> > +         for (List<Type> tvs = tvars, args = arguments;
> > +              tvs.nonEmpty();
> > +              tvs = tvs.tail, args = args.tail) {
> > +             if (args.head instanceof UndetVar) continue;
> > +             List<Type> bounds = types.subst(types.getBounds((TypeVar)tvs.head), \
> > tvars, arguments); +             if (!types.isSubtypeUnchecked(args.head, bounds, \
> > warn)) +-                throw unambiguousNoInstanceException
> > ++                throw invalidInstanceException
> > +                     .setMessage("inferred.do.not.conform.to.bounds",
> > +-                                arguments, tvars);
> > ++                                args.head, bounds);
> > +         }
> > +     }
> > + }
> > +diff -Nru openjdk.orig/langtools/src/share/classes/com/sun/tools/javac/comp/Resolve.java \
> > openjdk/langtools/src/share/classes/com/sun/tools/javac/comp/Resolve.java +--- \
> > openjdk.orig/langtools/src/share/classes/com/sun/tools/javac/comp/Resolve.java	2010-06-21 \
> > 22:16:20.000000000 +0100 ++++ \
> > openjdk/langtools/src/share/classes/com/sun/tools/javac/comp/Resolve.java	2010-09-09 \
> > 19:54:58.058019555 +0100 +@@ -279,7 +279,7 @@
> > +                         boolean allowBoxing,
> > +                         boolean useVarargs,
> > +                         Warner warn)
> > +-        throws Infer.NoInstanceException {
> > ++        throws Infer.InferenceException {
> > +         if (useVarargs && (m.flags() & VARARGS) == 0) return null;
> > +         Type mt = types.memberType(site, m);
> > + 
> > +@@ -350,7 +350,7 @@
> > +         try {
> > +             return rawInstantiate(env, site, m, argtypes, typeargtypes,
> > +                                   allowBoxing, useVarargs, warn);
> > +-        } catch (Infer.NoInstanceException ex) {
> > ++        } catch (Infer.InferenceException ex) {
> > +             return null;
> > +         }
> > +     }
> > +@@ -562,7 +562,7 @@
> > +                 default: return bestSoFar;
> > +                 }
> > +             }
> > +-        } catch (Infer.NoInstanceException ex) {
> > ++        } catch (Infer.InferenceException ex) {
> > +             switch (bestSoFar.kind) {
> > +             case ABSENT_MTH:
> > +                 return wrongMethod.setWrongSym(sym, ex.getDiagnostic());
> > +diff -Nru openjdk.orig/langtools/src/share/classes/com/sun/tools/javac/resources/compiler.properties \
> > openjdk/langtools/src/share/classes/com/sun/tools/javac/resources/compiler.properties
> >  +--- openjdk.orig/langtools/src/share/classes/com/sun/tools/javac/resources/compiler.properties	2010-06-21 \
> > 22:16:21.000000000 +0100 ++++ \
> > openjdk/langtools/src/share/classes/com/sun/tools/javac/resources/compiler.properties	2010-09-09 \
> > 19:54:58.058019555 +0100 +@@ -454,6 +454,8 @@
> > +     type parameters of {0} cannot be determined
> > + compiler.err.undetermined.type.1=\
> > +     type parameters of {0} cannot be determined; {1}
> > ++compiler.err.invalid.inferred.types=\
> > ++    invalid inferred types for {0}; {1}
> > + compiler.err.unreachable.stmt=\
> > +     unreachable statement
> > + compiler.err.initializer.must.be.able.to.complete.normally=\
> > +@@ -960,7 +962,13 @@
> > + compiler.misc.arg.length.mismatch=\
> > +     cannot instantiate from arguments because actual and formal argument lists \
> > differ in length + compiler.misc.inferred.do.not.conform.to.bounds=\
> > +-    inferred type argument(s) {0} do not conform to bounds of type variable(s) \
> > {1} ++    inferred type does not conform to declared bound(s)\n\
> > ++    inferred: {0}\n\
> > ++    bound(s): {1}
> > ++compiler.misc.inferred.do.not.conform.to.params=\
> > ++    actual arguments do not conforms to inferred formal arguments\n\
> > ++    required: {0}\n\
> > ++    found: {1}
> > + 
> > + #####
> > + 
> > +diff -Nru openjdk.orig/langtools/test/tools/javac/generics/inference/6302954/T6476073.java \
> > openjdk/langtools/test/tools/javac/generics/inference/6302954/T6476073.java +--- \
> > openjdk.orig/langtools/test/tools/javac/generics/inference/6302954/T6476073.java	2010-06-21 \
> > 22:16:25.000000000 +0100 ++++ \
> > openjdk/langtools/test/tools/javac/generics/inference/6302954/T6476073.java	2010-09-09 \
> > 19:54:58.058019555 +0100 +@@ -25,6 +25,7 @@
> > +  * @test
> > +  * @bug     6476073
> > +  * @summary Capture using super wildcard of type variables doesn't work
> > ++ * @ignore awaiting for 6650759 (see bug report for a detailed evaluation)
> > +  * @compile T6476073.java
> > +  */
> > + 
> > +diff -Nru openjdk.orig/langtools/test/tools/javac/generics/inference/6638712/T6638712a.java \
> > openjdk/langtools/test/tools/javac/generics/inference/6638712/T6638712a.java +--- \
> > openjdk.orig/langtools/test/tools/javac/generics/inference/6638712/T6638712a.java	1970-01-01 \
> > 01:00:00.000000000 +0100 ++++ \
> > openjdk/langtools/test/tools/javac/generics/inference/6638712/T6638712a.java	2010-09-09 \
> > 19:54:58.062019572 +0100 +@@ -0,0 +1,41 @@
> > ++/*
> > ++ * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
> > ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
> > ++ *
> > ++ * This code is free software; you can redistribute it and/or modify it
> > ++ * under the terms of the GNU General Public License version 2 only, as
> > ++ * published by the Free Software Foundation.
> > ++ *
> > ++ * This code is distributed in the hope that it will be useful, but WITHOUT
> > ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
> > ++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
> > ++ * version 2 for more details (a copy is included in the LICENSE file that
> > ++ * accompanied this code).
> > ++ *
> > ++ * You should have received a copy of the GNU General Public License version
> > ++ * 2 along with this work; if not, write to the Free Software Foundation,
> > ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
> > ++ *
> > ++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
> > ++ * CA 95054 USA or visit www.sun.com if you need additional information or
> > ++ * have any questions.
> > ++ */
> > ++
> > ++/*
> > ++ * @test
> > ++ * @bug     6638712
> > ++ * @author  mcimadamore
> > 
> > ----- End forwarded message -----
> > 
> > -- 
> > Andrew :)
> > 
> > Free Java Software Engineer
> > Red Hat, Inc. (http://www.redhat.com)
> > 
> > Support Free Java!
> > Contribute to GNU Classpath and the OpenJDK
> > http://www.gnu.org/software/classpath
> > http://openjdk.java.net
> > PGP Key: 94EFD9D8 (http://subkeys.pgp.net)
> > Fingerprint = F8EF F1EA 401E 2E60 15FA  7927 142C 2591 94EF D9D8

This is now in 1.7, 1.8 and 1.9.
-- 
Andrew :)

Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)

Support Free Java!
Contribute to GNU Classpath and the OpenJDK
http://www.gnu.org/software/classpath
http://openjdk.java.net
PGP Key: 94EFD9D8 (http://subkeys.pgp.net)
Fingerprint = F8EF F1EA 401E 2E60 15FA  7927 142C 2591 94EF D9D8


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic