7148025: javac should not warn about InterrupttedException on the declaration of AutoCloseable itself

Thu, 23 Feb 2012 09:53:09 -0800

author
darcy
date
Thu, 23 Feb 2012 09:53:09 -0800
changeset 1207
3ad851a7e884
parent 1200
be456f9c64e8
child 1208
e6b5c3aff85c

7148025: javac should not warn about InterrupttedException on the declaration of AutoCloseable itself
Reviewed-by: mcimadamore

src/share/classes/com/sun/tools/javac/comp/Attr.java file | annotate | diff | comparison | revisions
     1.1 --- a/src/share/classes/com/sun/tools/javac/comp/Attr.java	Sat Feb 18 16:12:28 2012 -0800
     1.2 +++ b/src/share/classes/com/sun/tools/javac/comp/Attr.java	Thu Feb 23 09:53:09 2012 -0800
     1.3 @@ -1146,7 +1146,8 @@
     1.4  
     1.5      void checkAutoCloseable(DiagnosticPosition pos, Env<AttrContext> env, Type resource) {
     1.6          if (!resource.isErroneous() &&
     1.7 -                types.asSuper(resource, syms.autoCloseableType.tsym) != null) {
     1.8 +            types.asSuper(resource, syms.autoCloseableType.tsym) != null &&
     1.9 +            !types.isSameType(resource, syms.autoCloseableType)) { // Don't emit warning for AutoCloseable itself
    1.10              Symbol close = syms.noSymbol;
    1.11              boolean prevDeferDiags = log.deferDiagnostics;
    1.12              Queue<JCDiagnostic> prevDeferredDiags = log.deferredDiagnostics;

mercurial