# HG changeset patch # User darcy # Date 1330019589 28800 # Node ID fdcc73079b81a6674ab3571b598eb9e9d3157cd9 # Parent c51754cddc037b9609e202b9ed38363d8683e7a8 7148025: javac should not warn about InterrupttedException on the declaration of AutoCloseable itself Reviewed-by: mcimadamore diff -r c51754cddc03 -r fdcc73079b81 langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java --- a/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java Wed Jul 05 18:03:20 2017 +0200 +++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java Thu Feb 23 09:53:09 2012 -0800 @@ -1146,7 +1146,8 @@ void checkAutoCloseable(DiagnosticPosition pos, Env env, Type resource) { if (!resource.isErroneous() && - types.asSuper(resource, syms.autoCloseableType.tsym) != null) { + types.asSuper(resource, syms.autoCloseableType.tsym) != null && + !types.isSameType(resource, syms.autoCloseableType)) { // Don't emit warning for AutoCloseable itself Symbol close = syms.noSymbol; boolean prevDeferDiags = log.deferDiagnostics; Queue prevDeferredDiags = log.deferredDiagnostics;