langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java
changeset 12087 31eeebc3ef49
parent 12081 42f541476d14
child 12333 7b02d0529a97
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java	Thu Mar 08 08:19:58 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java	Fri Mar 09 17:10:56 2012 +0000
@@ -2725,6 +2725,8 @@
                                       useVarargs,
                                       noteWarner);
 
+        boolean unchecked = noteWarner.hasNonSilentLint(LintCategory.UNCHECKED);
+
         // If this fails, something went wrong; we should not have
         // found the identifier in the first place.
         if (owntype == null) {
@@ -2735,10 +2737,10 @@
                           Type.toString(pt().getParameterTypes()));
             owntype = types.createErrorType(site);
             return types.createErrorType(site);
-        } else if (owntype.getReturnType().tag == FORALL) {
+        } else if (owntype.getReturnType().tag == FORALL && !unchecked) {
             return owntype;
         } else {
-            return chk.checkMethod(owntype, sym, env, argtrees, argtypes, useVarargs);
+            return chk.checkMethod(owntype, sym, env, argtrees, argtypes, useVarargs, unchecked);
         }
     }