--- old/src/share/classes/com/sun/tools/javac/comp/Check.java 2010-06-30 14:15:14.000000000 -0700 +++ new/src/share/classes/com/sun/tools/javac/comp/Check.java 2010-06-30 14:15:14.000000000 -0700 @@ -1603,6 +1603,22 @@ return false; } + /** + * Check that a resource is a valid arm resource (e.g. the resource type must be + * a subtype of java.lang.autoCloseable). + * + * @param resource resource tree + */ + void checkArmResource(JCTree resource) { + if (types.asSuper(resource.type, syms.autoCloseableType.tsym) == null) { + typeError(resource.pos(), + diags.fragment("arm.not.applicable.to.type"), + resource.type, + syms.autoCloseableType); + resource.type = types.createErrorType(resource.type); + } + } + /** Check that a given method conforms with any method it overrides. * @param tree The tree from which positions are extracted * for errors.